diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-03-20 11:11:11 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-03-20 11:11:11 -0400 |
| commit | 26dc9c5bcd2ed556472976208148ce4b51cd8b63 (patch) | |
| tree | 89ad3f773c353ef8ef36399b32b8fad6327c6bff | |
| parent | 9f29b549fcbc2794de1b44d746f9917a4998deb2 (diff) | |
#601 ignore x-frame-options (DESKTOP ONLY)
| -rw-r--r-- | electron_js/main.js | 11 |
1 files changed, 11 insertions, 0 deletions
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; }); } |
