electron/spec/fixtures/pages/focus-web-contents.html
2017-02-15 08:28:55 -08:00

24 lines
565 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
const {ipcRenderer, remote} = require('electron')
remote.getCurrentWindow().focus()
const child = new remote.BrowserWindow({show: false})
child.loadURL('about:blank')
child.webContents.focus()
const currentFocused = remote.getCurrentWindow().isFocused()
const childFocused = child.isFocused()
child.close()
ipcRenderer.send('answer', currentFocused, childFocused)
</script>
</head>
<body>
</body>
</html>