Created
November 7, 2021 07:58
-
-
Save KazuyaHayashi/33372ae657dde602e68fdb50aabafa31 to your computer and use it in GitHub Desktop.
Minimum code to reproduce `setContentProtection` issue
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') | |
const path = require('path') | |
function createWindow () { | |
const win = new BrowserWindow({ | |
width: 800, | |
height: 600, | |
}) | |
win.loadURL("https://www.google.com"); | |
} | |
app.whenReady().then(() => { | |
createWindow() | |
app.on('activate', () => { | |
if (BrowserWindow.getAllWindows().length === 0) { | |
createWindow() | |
} | |
}) | |
}) | |
app.on('window-all-closed', () => { | |
if (process.platform !== 'darwin') { | |
app.quit() | |
} | |
}) | |
app.on("browser-window-created", (event, window) => { | |
window.setContentProtection(false); | |
}); |
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": "my-electron-app", | |
"version": "1.0.0", | |
"description": "Hello World!", | |
"main": "main.js", | |
"author": "Jane Doe", | |
"license": "MIT", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"devDependencies": { | |
"electron": "15.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment