electron: [Bug]: chrome.scripting API not implemented for extensions using Manifest V3
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
24.0.0
What operating system are you using?
macOS
Operating System Version
Monterey
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
Extensions using the chrome.scripting
API should work properly. Manifest v3 should work properly. A React-specific bug is here https://github.com/electron/electron/issues/36545
Actual Behavior
With the following code:
import installExtension, { REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer';
const { app } = require('electron');
app.whenReady().then(() => {
installExtension(REACT_DEVELOPER_TOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));
});
You get the following errors/issues:
[44297:1203/150155.162121:ERROR:extensions_browser_client.cc(62)] Extension Error:
OTR: false
Level: 1
Source: manifest.json
Message: Service worker registration failed. Status code: 15
ID: fmkadmapgofadopljbjfkapdkoienihi
Type: ManifestError
[44297:1203/150155.162205:ERROR:extensions_browser_client.cc(62)] Extension Error:
OTR: false
Level: 2
Source: chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/background.js
Message: Uncaught TypeError: Cannot read properties of undefined (reading 'registerContentScripts')
ID: fmkadmapgofadopljbjfkapdkoienihi
Type: RuntimeError
Context: chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/background.js
Stack Trace:
{
Line: 107
Column: 1
URL: chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/background.js
Function: (anonymous function)
}
Testcase Gist URL
No response
Additional Information
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 23 (7 by maintainers)
hey all - i’m actively working on this and should have a flurry of PRs to improve Manifest v3 support up within 2-3 weeks at most.
On the agenda is:
chrome.i18n
Promise support: https://github.com/electron/electron/pull/39291chrome.scripting
support: https://github.com/electron/electron/pull/39395chrome.tabs
supportchrome.tabs.query
: https://github.com/electron/electron/pull/39330I published https://www.npmjs.com/package/electron-extension-installer as a temporary workaround for some common extensions, including React, but this really should be fixed on electrons end. (source code here)
@codebytere Is the support planned in the roadmap? React Dev tools are an important asset in the Dev’s toolbelt.
@nosferatu500 ah dang yes i know what that is - it’s not an issue with
chrome.scripting
but ratherchrome.action
. It’s on my short-term todo list to address!