Skip to content

Instantly share code, notes, and snippets.

@rhysd rhysd/index.html

Last active Apr 19, 2017
Embed
What would you like to do?
<!DOCTYPE html>
<html>
<body>
Hello, world.
</body>
</html>
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'));
});
{
"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
You can’t perform that action at this time.