MarshallOfSound / electron-devtools-installer

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

electron: Failed to load URL: chrome-extension://idfgllamndddgpeogaeoaiekkiafajcb/main.html with error: ERR_BLOCKED_BY_CLIENT, "Ignoring unauthorized client request from null" #196

Closed LoganDark closed 2 years ago

LoganDark commented 3 years ago
(node:29044) electron: Failed to load URL: chrome-extension://idfgllamndddgpeogaeoaiekkiafajcb/main.html with error: ERR_BLOCKED_BY_CLIENT
(Use `electron --trace-warnings ...` to show where the warning was created)
[29044:0818/105032.720:ERROR:CONSOLE(1)] "Ignoring unauthorized client request from null", source: devtools://devtools/bundled/models/extensions/extensions.js (1)

I'm not really sure what the issue is here, and since I'm using Electron Forge I can't pass trace-warnings to electron. :(

Is this an incorrect usage of electron-devtools-installer?

app.on('ready', async () => {
    if (process.env.NODE_ENV === 'development') {
        await install(REACT_DEVELOPER_TOOLS)
    }

    createWindow()
})

Removing the await install(...) line causes the error to go away, and logging the output of it just prints React Developer Tools, as if the install was successful.

pcharisius commented 2 years ago

Hi @LoganDark, did you find a workaround for the problem yet? I'm running into the same error.

LoganDark commented 2 years ago

Hi @LoganDark, did you find a workaround for the problem yet? I'm running into the same error.

I wish

julianmesa-gitkraken commented 2 years ago

@pcharisius @LoganDark Try with something like this:

await install(REACT_DEVELOPER_TOOLS, {
            loadExtensionOptions: {
              allowFileAccess: true
            },
            forceDownload: true
          });
LoganDark commented 2 years ago

@pcharisius @LoganDark Try with something like this:

await install(REACT_DEVELOPER_TOOLS, {
            loadExtensionOptions: {
              allowFileAccess: true
            },
            forceDownload: true
          });

At least it gets this far now:

(node:14856) ExtensionLoadWarning: Warnings loading extension at C:\Users\LoganDark\AppData\Roaming\<censored>\extensions\fmkadmapgofadopljbjfkapdkoienihi:
  Unrecognized manifest key 'browser_action'.
  Unrecognized manifest key 'minimum_chrome_version'.
  Unrecognized manifest key 'update_url'.
  Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.

(Use `electron --trace-warnings ...` to show where the warning was created)
julianmesa-gitkraken commented 2 years ago

@LoganDark These mesages are normal, are warnings. Now you can use react dev tool, if you open dev tools you will see the component tab

LoganDark commented 2 years ago

@LoganDark These mesages are normal, are warnings.
Now you can use react dev tool, if you open dev tools you will see the component tab

Nope. Every time I open devtools, I get this:

(node:21480) electron: Failed to load URL: chrome-extension://idfgllamndddgpeogaeoaiekkiafajcb/main.html with error: ERR_BLOCKED_BY_CLIENT
[21480:0121/074655.475:ERROR:CONSOLE(1)] "Ignoring unauthorized client request from null", source: devtools://devtools/bundled/models/extensions/extensions.js (1)

and react devtools doesn't load.

julianmesa-gitkraken commented 2 years ago

I had that error and it was related to allowFileAccess property. Are you sure you have updated your code properly?

LoganDark commented 2 years ago

I had that error and it was related to allowFileAccess property.
Are you sure you have updated your code properly?

Yes, here's the code

        const {default: install, REACT_DEVELOPER_TOOLS} = require('electron-devtools-installer')
        await install(REACT_DEVELOPER_TOOLS, {
            loadExtensionOptions: {
                allowFileAccess: true
            },
            forceDownload: true
        })
julianmesa-gitkraken commented 2 years ago

why are you using require instead import?

julianmesa-gitkraken commented 2 years ago

Your problem is documented here: loadExtension

LoganDark commented 2 years ago

The problem was that I was using a custom session. Since react-devtools-installer doesn't let you choose the session, the custom session wasn't getting the devtools.

Solution was to unset session and partition in webpreferences