Load extensions for all web contents
This commit is contained in:
parent
4f7bde38a9
commit
219d177731
2 changed files with 5 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
const {app, ipcMain, protocol, webContents, BrowserWindow} = require('electron')
|
||||
const WebContents = process.atomBinding('web_contents')
|
||||
const renderProcessPreferences = process.atomBinding('render_process_preferences').forAllBrowserWindow()
|
||||
|
||||
const fs = require('fs')
|
||||
|
@ -295,8 +296,8 @@ app.once('ready', function () {
|
|||
BrowserWindow.addDevToolsExtension = function (srcDirectory) {
|
||||
const manifest = getManifestFromPath(srcDirectory)
|
||||
if (manifest) {
|
||||
for (const win of BrowserWindow.getAllWindows()) {
|
||||
loadDevToolsExtensions(win, [manifest])
|
||||
for (const webContents of WebContents.getAllWebContents()) {
|
||||
loadDevToolsExtensions(webContents, [manifest])
|
||||
}
|
||||
return manifest.name
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue