Last active
April 19, 2017 17:13
-
-
Save rhysd/68e3006d3c192faea22bb6e5106c81c5 to your computer and use it in GitHub Desktop.
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> | |
Hello, world. | |
</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 path = require('path'); | |
const electron = require('electron'); | |
const app = electron.app; | |
const BrowserWindow = electron.BrowserWindow; | |
app.on('ready', () => { | |
const win = new BrowserWindow({ | |
webPreferences: { | |
sandbox: true | |
} | |
}); | |
win.webContents.on('dom-ready', () => { | |
win.webContents.insertCSS('body { color: red !important; }'); | |
console.log('CSS was inserted'); | |
}); | |
win.loadURL('file://' + path.join(__dirname, 'index.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
{ | |
"name": "electron-bug", | |
"version": "0.0.0", | |
"main": "main.js", | |
"dependencies": { | |
"electron": "^1.6.7" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment