Electron.JS + devtoolsinstaller: 'BrowserWindow.addDevToolsExtension' is deprecated and will be removed. Please use 'session.loadExtension' instead
Regarding the log error:
[1] Added Extension: [object Object]
I ran into the same problem. installExtension
actually returns the extension object and you can get the extension name with:
const installedExt = await installExtension(extension);console.log(`Added Extension: ${installedExt.name}`);
Regarding the deprecation warning:
[1] (electron) 'BrowserWindow.addDevToolsExtension' is deprecated and will be removed. Please use 'session.loadExtension' instead.
The package electron-devtools-installer should be updated to support the new way of registering the devtools as explained in: Electron API docs for devtools extension
Example:
const { app, BrowserWindow, session } = require('electron')const mainWindow = new BrowserWindow({...})const ext = await session.defaultSession.loadExtension('/path/to/unpacked/chrome-ext')
I will try to make a PR for this package to fix the deprecation warning.
Please let me know if this helps.