{"action":"created","issue":{"url":"https://api.github.com/repos/atom/electron/issues/4764","repository_url":"https://api.github.com/repos/atom/electron","labels_url":"https://api.github.com/repos/atom/electron/issues/4764/labels{/name}","comments_url":"https://api.github.com/repos/atom/electron/issues/4764/comments","events_url":"https://api.github.com/repos/atom/electron/issues/4764/events","html_url":"https://github.com/atom/electron/issues/4764","id":140351602,"number":4764,"title":"Is there a way to focus on main window after calling openDevTools?","user":{"login":"k0kubun","id":3138447,"avatar_url":"https://avatars.githubusercontent.com/u/3138447?v=3","gravatar_id":"","url":"https://api.github.com/users/k0kubun","html_url":"https://github.com/k0kubun","followers_url":"https://api.github.com/users/k0kubun/followers","following_url":"https://api.github.com/users/k0kubun/following{/other_user}","gists_url":"https://api.github.com/users/k0kubun/gists{/gist_id}","starred_url":"https://api.github.com/users/k0kubun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k0kubun/subscriptions","organizations_url":"https://api.github.com/users/k0kubun/orgs","repos_url":"https://api.github.com/users/k0kubun/repos","events_url":"https://api.github.com/users/k0kubun/events{/privacy}","received_events_url":"https://api.github.com/users/k0kubun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-03-12T06:14:53Z","updated_at":"2016-03-14T04:31:03Z","closed_at":"2016-03-13T13:32:12Z","body":"I call `openDevTools` after opening BrowserWindow but I don't want to focus on not devTools but main browser window. Is there a way to toggle focus between devTools and browser window?"},"comment":{"url":"https://api.github.com/repos/atom/electron/issues/comments/196133150","html_url":"https://github.com/atom/electron/issues/4764#issuecomment-196133150","issue_url":"https://api.github.com/repos/atom/electron/issues/4764","id":196133150,"user":{"login":"zcbenz","id":639601,"avatar_url":"https://avatars.githubusercontent.com/u/639601?v=3","gravatar_id":"","url":"https://api.github.com/users/zcbenz","html_url":"https://github.com/zcbenz","followers_url":"https://api.github.com/users/zcbenz/followers","following_url":"https://api.github.com/users/zcbenz/following{/other_user}","gists_url":"https://api.github.com/users/zcbenz/gists{/gist_id}","starred_url":"https://api.github.com/users/zcbenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcbenz/subscriptions","organizations_url":"https://api.github.com/users/zcbenz/orgs","repos_url":"https://api.github.com/users/zcbenz/repos","events_url":"https://api.github.com/users/zcbenz/events{/privacy}","received_events_url":"https://api.github.com/users/zcbenz/received_events","type":"User","site_admin":true},"created_at":"2016-03-14T04:31:03Z","updated_at":"2016-03-14T04:31:03Z","body":"`mainWindow.webContents.focus` is for focusing on the page, while `mainWindow.focus` is for focusing the window. The former is meaningful for attached devtools and the latter can be used for detached devtools.\r\n\r\nYou have to call them in `devtools-opened` event since opening devtools is an async operation."}}