New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensions don't work with file:// protocol since 9.0.0 #24011
Comments
Yep, "store not found" with Redux DevTools. |
I'd like to take a shot at this. Is there somewhere in the code where there's a decision being made on whether a particular content script should get injected or not? |
@RangerMauve I'd probably start by searching for From here it looks like maybe if the extension requests access to Hopefully that's enough to get you started! |
Sweet. Also, do you think this would be at all related to the issue I saw with extensions not loading for custom protocol handlers? #23616 (comment) |
Seems plausible! |
ExtensionPrefs::SetAllowFileAccess is likely related. In Electron: https://github.com/electron/electron/search?q=ExtensionPrefs |
@nornagon do you think that should be enabled unconditionally or via an opt-in when an extension is added? |
Got to debugging this.
Flipping 4 (Extension::ALLOW_FILE_ACCESS) on creation_flags makes this work. |
#25151 seems to be a fix, but I'm unsure if this should be the path forward. |
IMO opt-in makes sense. |
Some more context: Chrome allows file access to all unpacked extensions by default (ref). There's a preference that controls file access for specific extensions. Since we only ever load unpacked extensions currently, I think it makes sense for us to expose this to the app. |
+1 thank you for working on this fix ! |
@ChALkeR - any chance this fix might be finished before the next 10.X. series release? It's a blocker for us. Thank you! |
Great that this is being worked on! What's the current status? By looking at the historical duration between major releases I get the impression that Electron 11 isn't too far away, which will result in Electron 8, the last version with this working, becoming unsupported. This is a blocker for me and it would be nice to not have to use an unsupported version after Electron 11 has been released. |
There's currently more work to be done regarding persisting the option in the event that an extension is reloaded. Also, just going to mention that posting a bounty to BountySource is another option for folks eager to see this get fixed. |
I would be happy to sponsor this work, if someone thinks they can fix it. |
I can also back this bug with some cash. Can someone speak to the level of effort required here? Given that Electron apps are really meant to run from the file system, this is a pretty severe limitation. |
Looking forward to a fix. Currently writing an unfair amount of scripts to compensate for this issue. Glad It's being worked on. |
Thank you @nornagon!! |
in 2021 the same issue. it's strange, does someone use react, mobx extensions in electron 11, 12 ? |
@btzsoft works fine with Vue devtools. |
Works fine with Ember Inspector as well. |
Migrate the watch script to use webpack dev server to serve assets from http:// instead of file:// - Electron has an issue where Chrome Extensions are not loading properly using file:// since Electron 9 (source: electron/electron#24011) Serving assets from http:// may also be useful in the future when we serve assets from CloudFront->S3 (caching locally for offline use) With webpack we can load css with import syntax - migrate the code from html and ported the css file to scss. Also fixed 2 issues causing console log errors: 1) li nested in li; and 2) missing mode in AceEditor.
Extracted from #23662, #23662 (comment), per #23662 (comment) (cc @nornagon).
Extensions get loaded for
http://
andhttps://
protocols, but don't work forfile://
protocol, which is commonly used.This also affects devtools extensions.
Appears to be an undocumented regression from 8.x.
Chrome by default behaves the same, but it has an
Allow access to file URLs
switch (thefileAccess
flag) on extension page atchrome://extensions/
, which enables the extension to run onfile://
urls (which can be verified onContent scripts
tab).Any hint how to do that in Electron?
React-devtools works on
file://
protocol in Chrome with that flag enabled, but does not work in Electron since 9.0.0, as there are no ways to toggle that setting.Preflight Checklist
Issue Details
Linux xps 5.6.14-arch1-1 #1 SMP PREEMPT Wed, 20 May 2020 20:43:19 +0000 x86_64 GNU/Linux
Expected Behavior
Installed extensions should load for
file://
protocol automatically, or/and there should be an opt-in/out-out for that (like opt-in in Chrome).Extension content script present in
Content scripts
tab.Actual Behavior
Extensions are not loaded if the for pages requested over
file://
protocol.No extension content script present in
Content scripts
tab.To Reproduce
index.js
:Put anything in
simple.html
.Example extension (but you can use any other, e.g. https://github.com/electron/electron/tree/master/spec-main/fixtures/extensions/chrome-api or
react-devtools
)extensions/test/main.js
extensions/test/manifest.json
Screenshots
https://
:file://
:Additional Information
This breaks devtools extension and is a part (if not the main reason) behind #23662.
The text was updated successfully, but these errors were encountered: