electron: [Bug]: Failed to load React Devtools
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
22.0.0
What operating system are you using?
macOS
Operating System Version
macOS Monterey 12.6
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
I want to load React Devtools whose manifest version is v3.
app.whenReady().then(async () => {
new BrowserWindow().loadFile("index.html");
const devtoolPath = path.join(
os.homedir(),
"/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.27.0_0"
);
await session.defaultSession.loadExtension(devtoolPath, {
allowFileAccess: true,
});
});

Actual Behavior
Received an error message “Permission ‘scripting’ is unknown or URL pattern is malformed”:
(node:44297) ExtensionLoadWarning: Warnings loading extension at $HOME/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.27.0_0:
Permission 'scripting' is unknown or URL pattern is malformed.
Stack Trace
[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
The problem has not occurred with Vue3 devtools, whose manifest version is v2.

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 12
- Comments: 57 (11 by maintainers)
@codebytere Can you please reopen this? I believe Electron should add
chrome.scripting
APIs (as well as other Manifest V3 support) to fix this issue. Here’s my argument https://github.com/facebook/react/issues/25843#issuecomment-1406766561I have same issue with electron 24.x
I wrote up some quick downgrade instructions for Electron apps (replace “Polypane” with your app name): https://polypane.app/docs/downgrading-react-devtools/
I also encountered this issue in Electron 24.x.
Does this mean that React developers on Electron have been unable to use development tools for half a year?
The PR was merged 4 hours ago and the last release is 5 days old so the fix has not been released yet.
Please fix this soon so we dont have to workaround with scripts and downgrade!
Here’s a script that might help: https://github.com/facebook/react/issues/25843#issuecomment-1368733054
Replace
/path/to/your/data/extensions
with either%AppData%/<YourApp>/extensions
(for Windows) or~/Library/Application Support/<YourApp>/extensions
(for macOS).Alternatively, if you prefer not to run the script, you can manually download https://polypane.app/fmkadmapgofadopljbjfkapdkoienihi.zip and replace the
fmkadmapgofadopljbjfkapdkoienihi
folder.Still same with Electron v24.x.
Closing as an upstream bug: https://github.com/facebook/react/issues/25843
Ran into this too. 4.27 switched over to manifest v3 which could be the cause, but according to https://github.com/facebook/react/pull/25145 they also now use
chrome.scripting.registerContentScripts
which is an API electron might not support yet.edit: yes,
chrome.scripting
isn’t implemented: https://github.com/MarshallOfSound/electron-devtools-installer/issues/232yeah
the latest version electron also have same error
This is not WORKING!
Still doesn’t work for me, I get the same errors, does not work with double loading as well.
Could you please reopen this issue? The problem still remains.
The following is a reproduced code based on electron-quick-start:
I wonder if anyone else could run the above code as is and still have React Devtools load correctly.
It seems based on my testing using the default Electron Fiddle (adding in a simple react app) on 25.9.0, 26.3.0 and 27.0.0 the latest React Dev Tools will not load when using
mainWindow.loadFile()
even if you haveallowFileAccess: true
unless you are using a url likehttps://react.dev
as has been used in examples above.From
v26.3.0
on macOS Sonoma 14 on my machine, just now, with code identical to above:I’ll check to make sure my version of devtools is latest tho and will update.
Edit: Still works and shows up with
4.28.4 (10/3/2023)
@codebytere Hmmm, I tried your code (minus the version number) and it was still the same.
Versions node:18.16.1 acorn:8.8.2 ada:1.0.4 ares:1.19.1 brotli:1.0.9 cldr:43.0 icu:73.1 llhttp:6.0.11 modules:116 napi:8 nghttp2:1.52.0 openssl:1.1.1 simdutf:3.2.2 tz:2023c undici:5.21.0 unicode:15.0 uv:1.44.2 uvwasi:0.0.15 v8:11.6.189.20-electron.0 zlib:1.2.13.1-motley electron:26.2.4 chrome:116.0.5845.190
React Devtools 4.28.0_0
[2137:1001/130308.425155:ERROR:extensions_browser_client.cc(69)] Extension Error: OTR: false Level: 2 Source: chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/background.js Message: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘ExecutionWorld’) ID: fmkadmapgofadopljbjfkapdkoienihi Type: RuntimeError Context: chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/background.js Stack Trace: { Line: 59 Column: 1 URL: chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/background.js Function: (anonymous function) }
i am getting the same error
Because I experience the same issue and more others with electrons and have a plan to abandon Electron in favor of Tauri, your reply triggered me to check out does Tauri has it. I found out that Tauri does not have it, and a workaround to use standalone React DevTool. I checked it out quickly, and it works without issues with the Electron.
A lot longer than that in production builds if you’re following good security practices; which are where it’s recommended to use tools like React’s Profiling. I haven’t had access to profiling in YEARS and can’t even imagine how much low-hanging fruit I have overlooked as a result.
Yes, to use React Devtools, you should downgrade its version.
Errror is in this line $HOME/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.27.0_0.
The warning specifically mentions that the permission “scripting” is unknown or the URL pattern is malformed. This could indicate that the extension is using a deprecated or outdated permission, or that the URL patterns specified in the extension manifest are incorrect.
To address this issue, you could try disabling or removing the extension causing the warning and see if the problem persists. Alternatively, you could contact the developer of the extension for further assistance in resolving the issue.