-
-
Save nornagon/b72948eafa5a2f61acf9f4718ff09259 to your computer and use it in GitHub Desktop.
Electron Fiddle Gist
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
| <script> | |
| setImmediate(async () => { | |
| if (!location.hash) { | |
| const p = new Promise(resolve => { | |
| window.addEventListener('message', resolve, { once: true }); | |
| }) | |
| window.open('#foo', '', 'nodeIntegration=no') | |
| const e = await p | |
| document.body.textContent = e.data | |
| } else { | |
| window.opener.postMessage('foo', '*') | |
| } | |
| }) | |
| </script> | |
| test |
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') | |
| function createWindow () { | |
| const mainWindow = new BrowserWindow({ | |
| webPreferences: { | |
| nodeIntegration: true, | |
| contextIsolation: false, | |
| nativeWindowOpen: true, | |
| } | |
| }) | |
| mainWindow.loadFile('index.html') | |
| } | |
| app.whenReady().then(() => { | |
| createWindow() | |
| }) |
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
| // Empty |
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
| // Empty |
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
| /* Empty */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment