Main: Clear cache and storage data only when the last window is closed
This prevents the CONSENT cookie from being deleted after a window is closed by the user, making it so that the user can no longer load the comment section.
This commit is contained in:
parent
b37c46f12d
commit
640ed6818a
|
@ -327,19 +327,22 @@ function runApp() {
|
||||||
})
|
})
|
||||||
|
|
||||||
newWindow.on('close', () => {
|
newWindow.on('close', () => {
|
||||||
newWindow.webContents.session.clearCache()
|
// Clear cache and storage if it's the last window
|
||||||
newWindow.webContents.session.clearStorageData({
|
if (openedWindows.length === 1) {
|
||||||
storages: [
|
newWindow.webContents.session.clearCache()
|
||||||
'appcache',
|
newWindow.webContents.session.clearStorageData({
|
||||||
'cookies',
|
storages: [
|
||||||
'filesystem',
|
'appcache',
|
||||||
'indexdb',
|
'cookies',
|
||||||
'shadercache',
|
'filesystem',
|
||||||
'websql',
|
'indexdb',
|
||||||
'serviceworkers',
|
'shadercache',
|
||||||
'cachestorage'
|
'websql',
|
||||||
]
|
'serviceworkers',
|
||||||
})
|
'cachestorage'
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
newWindow.on('closed', () => {
|
newWindow.on('closed', () => {
|
||||||
|
|
Loading…
Reference in New Issue