Created
November 10, 2021 18:43
-
-
Save theArina/aed561dbe680ea3b62de1a23f1f7ed55 to your computer and use it in GitHub Desktop.
electron-14-webview-warning
This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<webview | |
style="height:97vh" | |
src="https://example.com" | |
webpreferences="nativeWindowOpen=no" | |
/> | |
</body> | |
</html> |
This file contains 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'); | |
process.traceProcessWarnings = true; | |
app.on('ready', () => { | |
let mainWindow = new BrowserWindow({ | |
show: true, | |
webPreferences: { | |
contextIsolation: false, | |
webviewTag: true, | |
nodeIntegration: true, | |
nodeIntegrationInSubFrames: true, | |
plugins: true, | |
javascript: true, | |
nativeWindowOpen: false | |
} | |
}); | |
mainWindow.loadFile(`${__dirname}/index.html`); | |
mainWindow.on('closed', () => mainWindow = null); | |
}); |
This file contains 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
{ | |
"name": "webivew-example", | |
"version": "1.0.0", | |
"main": "main.js", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"keywords": [], | |
"dependencies": { | |
"electron": "14.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment