Created
October 25, 2019 21:09
-
-
Save binux/3c2023793e1bf1ff03a8fcb24b026162 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {app, BrowserWindow} = require('electron') | |
app.once('ready', async () => { | |
win = new BrowserWindow() | |
win.webContents.session.webRequest.onBeforeSendHeaders((details, callback) => callback({})); | |
win.webContents.once('did-finish-load', async () => { | |
const html = await win.webContents.executeJavaScript('document.documentElement.innerHTML'); | |
console.log(html); | |
app.quit() | |
}) | |
await win.webContents.loadURL('https://httpbin.org/headers', {"extraHeaders":"Addition-Header: hello world"}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment