mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add BrowserWindow.isDevToolsExtensionInstalled API
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user