diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-19 16:45:40 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-19 16:45:40 -0400 |
| commit | f5c549df0adb14c880319d0e757698f0452ef58b (patch) | |
| tree | 1cf2a348484cb8e583768a9745b9323d1a1d216d /electron_js/main.js | |
| parent | a3162d150003153a00d0c4e871e2c2f795269d5b (diff) | |
you can add a proxy to the desktop build with --proxy
Diffstat (limited to 'electron_js/main.js')
| -rw-r--r-- | electron_js/main.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/electron_js/main.js b/electron_js/main.js index bac574d9..5856093c 100644 --- a/electron_js/main.js +++ b/electron_js/main.js @@ -6,6 +6,7 @@ const {dialog} = require('electron') // Module to create native browser window. const {BrowserWindow} = electron; var isFs = false; +var isProxy = false; var argv = require('minimist')(process.argv.slice(1)); console.log ("ARGV="+JSON.stringify(argv)); @@ -69,6 +70,9 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { 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']; @@ -86,7 +90,10 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { } - + if (argv.proxy) { + console.log ("PROXY SET: "+argv.proxy); + win.webContents.session.setProxy({proxyRules:argv.proxy}, function() {}); + } // and load the index.html of the app. win.loadURL(`file://${__dirname}/index.html`); |
