mirror of
https://github.com/Sneed-Group/scuregpt
synced 2025-01-09 16:53:16 +00:00
19 lines
646 B
JavaScript
19 lines
646 B
JavaScript
|
/**
|
||
|
* The preload script runs before. It has access to web APIs
|
||
|
* as well as Electron's renderer process modules and some
|
||
|
* polyfilled Node.js functions.
|
||
|
*
|
||
|
* https://www.electronjs.org/docs/latest/tutorial/sandbox
|
||
|
*/
|
||
|
window.addEventListener('DOMContentLoaded', () => {
|
||
|
function clearSiteData(url) {
|
||
|
session.defaultSession.clearStorageData({
|
||
|
storages: ['appcache', 'cookies', 'filesystem', 'indexdb', 'localstorage', 'shadercache', 'websql', 'serviceworkers'],
|
||
|
quotas: ['temporary', 'persistent'],
|
||
|
origins: [url]
|
||
|
}, () => {
|
||
|
console.log(`Site data cleared for ${url}`);
|
||
|
});
|
||
|
}
|
||
|
})
|