Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13288 from atom/as-fix-profile-startup
Browse files Browse the repository at this point in the history
Call `openDevTools` on `WebContents` rather than on `BrowserWindow`
  • Loading branch information
Antonio Scandurra committed Nov 22, 2016
1 parent 8e912cc commit 224057b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions static/index.js
Expand Up @@ -116,14 +116,12 @@
})
}

var currentWindow = require('electron').remote.getCurrentWindow()
if (currentWindow.devToolsWebContents) {
const webContents = require('electron').remote.getCurrentWindow().webContents
if (webContents.devToolsWebContents) {
profile()
} else {
currentWindow.openDevTools()
currentWindow.once('devtools-opened', function () {
setTimeout(profile, 1000)
})
webContents.once('devtools-opened', () => { setTimeout(profile, 1000) })
webContents.openDevTools()
}
}

Expand Down

0 comments on commit 224057b

Please sign in to comment.