diff --git a/config/defaults.js b/config/defaults.js index b94ae18f..31d11f3b 100644 --- a/config/defaults.js +++ b/config/defaults.js @@ -13,6 +13,7 @@ const defaultConfig = { disableHardwareAcceleration: false, restartOnConfigChanges: false, trayClickPlayPause: false, + autoResetAppCache: false, }, plugins: { // Enabled plugins diff --git a/index.js b/index.js index 39d077bc..7c452a06 100644 --- a/index.js +++ b/index.js @@ -196,6 +196,11 @@ app.on("activate", () => { }); app.on("ready", () => { + if (config.get("options.autoResetAppCache")) { + // Clear cache + electron.session.defaultSession.clearCache(); + } + mainWindow = createMainWindow(); setApplicationMenu(mainWindow); if (config.get("options.restartOnConfigChanges")) { diff --git a/menu.js b/menu.js index 09540c09..508b6b0a 100644 --- a/menu.js +++ b/menu.js @@ -58,6 +58,14 @@ const mainMenuTemplate = (win) => [ config.set("options.restartOnConfigChanges", item.checked); }, }, + { + label: "Reset App cache when app starts", + type: "checkbox", + checked: config.get("options.autoResetAppCache"), + click: (item) => { + config.set("options.autoResetAppCache", item.checked); + }, + }, ...(is.windows() || is.linux() ? [ {