electron: window.focus() not working in sandbox mode

  • Electron version: 1.6.1
  • Operating system: window 7 (64 bit)

Expected behavior

when i call window.focus() window getting focused.

Actual behavior

window not come to focus while focus event trigger.

window not come in focus.

How to reproduce

main.js mainWindow = new BrowserWindow({width: 100, height: 100, webPreferences: {nodeIntegration: true, sandbox: true}}); mainWindow.loadURL(http://localhost:9000);

index.html <button onclick="focusWin()">focus</button>

app.js var win = window.open(“child.html”, ‘’, ‘width=100,height=100,left=0;top=0’); function focusWin(){ setTimeout(function(){ win.focus(); }, 100); }

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 24 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I’m pretty sure this is still true in 3.0.x