-
Notifications
You must be signed in to change notification settings - Fork 435
Blocking scripts should display noscript tags #574
Comments
If you're talking about dynamic filtering, blocking all scripts that run on a certain hostname, then I think this extension might need to use the contentSettings API like uMatrix does; then if it uses that API to disable scripts on that hostname, Chrome will parse |
Yes, I am talking about dynamic filtering, but on Firefox not Chrome. I looked at a couple of Firefox extensions, NoScript and TabMixPlus, and the way they tell Firefox to parse a page's It appears that, on Firefox at least, there's no straightforward way to achieve this while maintaining the origin-specific granularity of blocking scripts, as the only way to get Firefox to parse |
No, uMatrix does not do that. The solution is simple: to transform |
@gorhill some thoughts on why this might not be optimal:
My own, humble suggestion would be to offer some visual indicator in the µBlock toolbar icon when one or more first-party scripts are blocked (an "asterisk" after the count, perhaps?). That gives the advantage of easier debugging/troubleshooting without the potential problems listed above. What do you think? |
@gorhill just another quick note (follow-up to comment above): if you do decide to show In other words: noscript {
display: block;
} Inserting that should be much cheaper than looking for/replacing |
I thought of that too, but Firefox appears to have the following rule hardcoded in noscript {
display: none !important;
} |
Is that a conclusion, or something special that Firefox does? You can have * > noscript {
display: block !important;
} |
Well, it either takes precedence through some trickery, or the CSS rules are being ignored altogether, and the |
@gorhill I thought uMatrix might use contentSettings for more than just setting, as a baseline, a couple whitelists (whitelisting all scripts on URLs starting with @anmarmansur Did you try injecting that style block with |
Yes, I did try injecting that style block with I immediately confirmed this in the browser by creating this simple HTML document: ...
<body>
<div>div 1</div>
<noscript>
<div>div 2</div>
<div>div 3</div>
</noscript>
</body>
... And this is what the resulting DOM looks like:
Notice how the latter two
|
Yes the DOM won't parse |
+1 I would like to see the |
Unfortunately that can't be done: Apparently there is no way to have the browser think that scripting is disabled altogether just because every single script is blocked, and |
More precisely, setting allowJavascript on a docshell will by default inherit that same setting into its descendant docshells (iframes). One can directly set allowJavascript on those other docshells if desired if their script-enabled state should not match the parent. |
Oh, and for this part: the preferences sheet is a user-level sheet. !important rules in it have hight precedence than any author-sheet rules. Having an extension add a user-level or ua-level sheet with a !important rule would allow overriding it. |
@bzbarsky The repo here is dead since years. I was made aware of your comment from https://bugzilla.mozilla.org/show_bug.cgi?id=1392090#c5. The issue for (not abandonware) uBlock Origin is here: gorhill/uBlock#308. I would like to understand what you are referring to with:
What WebExtensions API are you referring to? |
I'll follow up in gorhill/uBlock#308 |
There might well not be a webextensions API for this. That part of my comment was in response to the earlier discussion in this issue, which was not in a webextensions context. |
This might be specific to Firefox, as I don't use Chrome, but as it stands blocking scripts with uBlock will leave most websites unusable, while, for comparison, blocking scripts using the NoScript extension will not do so, because NoScript (I believe) tells the browser to parse and display the page's tags.
If this is intentional, and if there is a benefit to continue to hide the page's , perhaps a user selectable behavior could be added.
The text was updated successfully, but these errors were encountered: