From 26dc9c5bcd2ed556472976208148ce4b51cd8b63 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Tue, 20 Mar 2018 11:11:11 -0400 Subject: #601 ignore x-frame-options (DESKTOP ONLY) --- electron_js/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/electron_js/main.js b/electron_js/main.js index 3f56b332..bac574d9 100644 --- a/electron_js/main.js +++ b/electron_js/main.js @@ -68,6 +68,15 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { height: mainWindowState.height, webPreferences:{nodeIntegration:false}}); + + win.webContents.session.webRequest.onHeadersReceived({}, (d, c) => { + if(d.responseHeaders['x-frame-options'] || d.responseHeaders['X-Frame-Options']){ + delete d.responseHeaders['x-frame-options']; + delete d.responseHeaders['X-Frame-Options']; + } + c({cancel: false, responseHeaders: d.responseHeaders}); + }); + mainWindowState.manage(win); // fs will be arg 1 if its not run in electron debug mode if (argv.fs) @@ -76,6 +85,7 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { isFs = true; } + // and load the index.html of the app. @@ -89,6 +99,7 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { // Dereference the window object, usually you would store windows // in an array if your app supports multi windows, this is the time // when you should delete the corresponding element. + win.removeAllListeners(); win = null; }); } -- cgit v1.2.3