From 561a779449eff2064b21b6f3434db9a79ba8c993 Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Wed, 5 Oct 2022 10:07:05 +0200 Subject: [PATCH] added api to clear browser cache --- contextAPI.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contextAPI.js b/contextAPI.js index 3d0ceeb..1b09d85 100644 --- a/contextAPI.js +++ b/contextAPI.js @@ -1,6 +1,6 @@ "use strict"; -const {contextBridge, ipcRenderer} = require("electron"); +const {contextBridge, ipcRenderer, webFrame} = require("electron"); let fileOpenListener = null; @@ -14,5 +14,7 @@ contextBridge.exposeInMainWorld("api", { }, openFile : filePath => ipcRenderer.send("WindowManager::openFile", filePath), - removeOnFileOpenListener : callback => ipcRenderer.off("Ation::openFile", callback) + removeOnFileOpenListener : callback => ipcRenderer.off("Ation::openFile", callback), + + clearCache : () => webFrame.clearCache() }); \ No newline at end of file