Option for running extension on restricted URLs
See original GitHub issueWith Dark Reader, restricted sites like addons.mozilla.org can’t be themed with the restriction in about:config turned off in: ‘privacy.resistFingerprinting.block_mozAddonManager’. For such sites to be themed please edit the file, ‘background/index.js’. Then publish the addon on firefox’s addon site.
Change the following in background/index.js from:
function canInjectScript(url) {
if (isFirefox()) {
return (url
&& url.indexOf('about:') !== 0
&& url.indexOf('moz') !== 0
&& url.indexOf('view-source:') !== 0
&& url.indexOf('https://addons.mozilla.org') !== 0);
}
return (url
&& url.indexOf('chrome') !== 0
&& url.indexOf('https://chrome.google.com/webstore') !== 0);
}
…and change it to:
function canInjectScript(url) {
if (isFirefox()) {
return (url
&& url.indexOf('about:') !== 0
&& url.indexOf('moz') !== 0
&& url.indexOf('view-source:') !== 0);
}
return (url
&& url.indexOf('chrome') !== 0
&& url.indexOf('https://chrome.google.com/webstore') !== 0);
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to restrict extensions to select websites in ... - AddictiveTips
Open it and select the 'On specific sites' option. A pop-up will open asking you to enter the URL for the websites you...
Read more >How to restrict extensions to select websites in Chrome
When you install an extension in Chrome, it shows you a comprehensive list of the permissions it needs to run. You can accept...
Read more >Restrictions on File Urls - text/plain
By default, extensions are forbidden to run on file:// URIs. To allow the user to run extensions on file: -sourced content, the user...
Read more >Allow or block access to websites - Google Support
Define exceptions to very restrictive blocklists—Use the blocklist to block access to all URLs. Then, use the allowlist to let users access certain...
Read more >Chrome Extensions: declare permissions and warn users
An extension's ability to access websites and most Chrome APIs is determined by its declared permissions. Permissions should be restricted ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi!
I’ve made a PR(#3426) that let’s you disable the check if a site is protected(Extension wise, browser still can say it’s protected).
Also
Added as option*
I’m not quite sure if you can disable the protected pages in Fenix still.
Properly? I don’t think your understanding the issue. Browsers have hard coded values for protected pages. We have implemented this system so it would:
We are just adjusting to the browser and is working properly.
That’s being added by #3426
Regards, Gusted
I don’t understand why you actually disable your extension on
addons.mozilla.org
especially, as Firefox itself prevents extensions from running on that page either way. It’s like protecting your extension from itself which is meaningless.If you remove
addons.mozilla.org
from the about:configextensions.webextensions.restrictedDomains
on Firefox then your extension should run. Just like how when you remove other restricted domains such asaccounts.firefox.com
the same about:config it runs fine there. So I don’t see this as a “causing errors issue” if you don’t have issues with all the other restricted domains currently.As for Chrome they only actually restrict access to
chrome.google.com
alone unlike Firefox so you can actually run extensions such as uBlock Origin on the page see here, it just won’t be able to block anything coming fromchrome.google.com
, unlike in Firefox it just won’t see anything. Though I’m guessing without enabling theExtensions on chrome:// URLs
flag as mentioned above, it won’t allow you to inject anything into the page, but I could be wrong.Lastly, any ETA on this? Doesn’t seem like a hard fix.