Add BrowserWindow.isDevToolsExtensionInstalled API
This commit is contained in:
parent
e824603f37
commit
0a26075699
2 changed files with 6 additions and 0 deletions
|
@ -339,4 +339,8 @@ app.once('ready', function () {
|
|||
delete manifestMap[manifest.extensionId]
|
||||
delete manifestNameMap[name]
|
||||
}
|
||||
|
||||
BrowserWindow.isDevToolsExtensionInstalled = function (name) {
|
||||
return manifestNameMap.hasOwnProperty(name)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -838,9 +838,11 @@ describe('browser-window module', function () {
|
|||
|
||||
beforeEach(function () {
|
||||
BrowserWindow.removeDevToolsExtension('foo')
|
||||
assert.equal(BrowserWindow.isDevToolsExtensionInstalled('foo'), false)
|
||||
|
||||
var extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo')
|
||||
BrowserWindow.addDevToolsExtension(extensionPath)
|
||||
assert.equal(BrowserWindow.isDevToolsExtensionInstalled('foo'), true)
|
||||
|
||||
w.webContents.on('devtools-opened', function () {
|
||||
var showPanelIntevalId = setInterval(function () {
|
||||
|
|
Loading…
Reference in a new issue