Skip to content

Instantly share code, notes, and snippets.

@bnookala
Last active June 7, 2016 05:23
Show Gist options
  • Save bnookala/818785874346f7b6775df4fcc1d4cd5c to your computer and use it in GitHub Desktop.
Save bnookala/818785874346f7b6775df4fcc1d4cd5c to your computer and use it in GitHub Desktop.
Electron Focus
<html>
<head></head>
<body>
this is an input in index.html:<br/>
<input></input>
<br/>
<webview src="webview.html" disablewebsecurity allowpopups></webview>
</body>
</html>
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const appLocation = `file://${__dirname}/index.html`
let mainWindow = undefined;
app.on('ready', () => {
mainWindow = new BrowserWindow();
mainWindow.loadURL(appLocation);
});
<html>
<head></head>
<body>
This is an input box in webview.html:
<br/>
<input></input>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment