MarshallOfSound / electron-devtools-installer

An easy way to ensure Chrome DevTools extensions into Electron
MIT License
1.11k stars 136 forks source link

Failed to load REACT_DEVELOPER_TOOLS with "allowFileAccess: true". #232

Closed sprout2000 closed 1 year ago

sprout2000 commented 1 year ago

Overview

Since the React Devtools manifest version has moved to v3, I have been receiving the following error message:

(node:38604) ExtensionLoadWarning: Warnings loading extension at ${appdata}/extensions/fmkadmapgofadopljbjfkapdkoienihi:
  Permission 'scripting' is unknown or URL pattern is malformed.

Electron version

How to reproduce

app.whenReady().then(() => {
  new BrowserWindow().loadFile("index.html");

  installExtension(REACT_DEVELOPER_TOOLS, {
    loadExtensionOptions: { allowFileAccess: true },
  });
});

Stack Trace

[38604:1203/115447.221152:ERROR:extensions_browser_client.cc(62)] Extension Error:
  OTR:     false
  Level:   2
  Source:  chrome-extension://hnjgfidgdgoiodokkbgncdflbdhoakdc/build/background.js
  Message: Uncaught TypeError: Cannot read properties of undefined (reading 'registerContentScripts')
  ID:      hnjgfidgdgoiodokkbgncdflbdhoakdc
  Type:    RuntimeError
  Context: chrome-extension://hnjgfidgdgoiodokkbgncdflbdhoakdc/build/background.js
  Stack Trace: 
    {
      Line:     107
      Column:   1
      URL:      chrome-extension://hnjgfidgdgoiodokkbgncdflbdhoakdc/build/background.js
      Function: (anonymous function)
    }
[38604:1203/115447.221420:ERROR:extensions_browser_client.cc(62)] Extension Error:
  OTR:     false
  Level:   1
  Source:  manifest.json
  Message: Service worker registration failed. Status code: 15
  ID:      hnjgfidgdgoiodokkbgncdflbdhoakdc
  Type:    ManifestError
[38604:1203/115449.489984:ERROR:CONSOLE(2)] "Electron sandboxed_renderer.bundle.js script failed to run", source: node:electron/js2c/sandbox_bundle (2)
[38604:1203/115449.490014:ERROR:CONSOLE(2)] "TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))", source: node:electron/js2c/sandbox_bundle (2)
[38604:1203/115451.060246:ERROR:CONSOLE(2)] "Electron sandboxed_renderer.bundle.js script failed to run", source: node:electron/js2c/sandbox_bundle (2)
[38604:1203/115451.060281:ERROR:CONSOLE(2)] "TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))", source: node:electron/js2c/sandbox_bundle (2)
bitbw commented 1 year ago

me too

Added Extension:  React Developer Tools
[73656:1205/150837.429:ERROR:extensions_browser_client.cc(62)] Extension Error:
  OTR:     false
  Level:   2
  Source:  chrome-extension://naeifaohdbmggipodapgplcbnifmiaaa/build/background.js
  Message: Uncaught TypeError: Cannot read properties of undefined (reading 'registerContentScripts')
  ID:      naeifaohdbmggipodapgplcbnifmiaaa
  Type:    RuntimeError
  Context: chrome-extension://naeifaohdbmggipodapgplcbnifmiaaa/build/background.js
  Stack Trace:
    {
      Line:     107
      Column:   1
      URL:      chrome-extension://naeifaohdbmggipodapgplcbnifmiaaa/build/background.js
      Function: (anonymous function)
    }
[73656:1205/150837.430:ERROR:extensions_browser_client.cc(62)] Extension Error:
  OTR:     false
  Level:   1
  Source:  manifest.json
  Message: Service worker registration failed. Status code: 15
  ID:      naeifaohdbmggipodapgplcbnifmiaaa
  Type:    ManifestError
[73656:1205/150838.014:ERROR:CONSOLE(2)] "Electron sandboxed_renderer.bundle.js script failed to run", source: node:electron/js2c/sandbox_bundle (2)
[73656:1205/150838.014:ERROR:CONSOLE(2)] "TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))", source: node:electron/js2c/sandbox_bundle (2)
Ajayff4 commented 1 year ago

Any word on this issue please?

sprout2000 commented 1 year ago

This needs fixing upstream: facebook/react#25843

simonbuchan commented 1 year ago

Upstream punted and said Electron should implement manifest v3. There's a few people that put workarounds in there, though, perhaps one could be added as a stop-gap.