ipcMain.on('navigate-with-pending-entry', (event, id) => {
const w = BrowserWindow.fromId(id)
- const source = `
- <body>
- <a href='http://host'>Link</a>
- </body>
- <script>
- setInterval(function () {
- document.getElementsByTagName('a')[0].click();
- }, 100)
- </script>
- `
-
- w.webContents.on('did-fail-load', () => {
+ w.webContents.on('did-start-loading', () => {
w.loadURL('about:blank')
})
})
w.webContents.session.clearHostResolverCache(() => {
- w.loadURL(`data:text/html,${source}`)
+ w.loadURL('http://host')
})
})