Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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