Static filter syntax to only match when inline scripts are disabled #3427
Replies: 2 comments 5 replies
-
uBO should show the content of Can you give an example link where it doesn't work? |
Beta Was this translation helpful? Give feedback.
5 replies
-
Declined. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I came to UBO from NSS+ABP a number of months ago.
One of the significant differences I noticed after this transition was that UBO would not show the content of HTML
<noscript>
elements when it was blocking inline scripts. NSS elects to show the contents of<noscript>
tags where JS has been disabled, and hides these when it is enabled.I believe I saw a closed issue at the time, stating that getting UBO to show
<noscript>
contents was either impossible or undesirable, but I can't find it now.To compensate, I wrote myself a custom scriptlet which locates all the
<noscript>
elements in a page, writes theirinnerText
to that of a newHTMLTemplateElement
and replaces the<noscript>
with the content of the template. It has been more useful for me than not (e.g. for showing reminders or helper buttons when JS is disabled); in case it is at all useful for you, I have included it below.I currently apply this scriptlet with a very broad-brush custom
*##+js(reinject-noscript)
static filter, which works as expected on every page I visit.This, of course, now has the opposite effect – when inline scripts are enabled in UBO, the contents of any
<noscript>
are still shown. There are some websites whose<noscripts>
entirely cover the page content, or some other such annoyance, so I've taken to excluding them from my static filter, e.g.*,~youtube.com,~youtube-nocookie.com,~accounts.google.com,~paypal.com##+js(reinject-noscript)
I would much rather change the targeting so that UBO only applies the scriptlet when inline scripts are blocked.
Is there / could there be any syntax which could be used in a static filter, which limits the targeting to only when UBO is blocking inline scripts?
Perhaps
*,$no-inline-scripts##+js(reinject-noscript)
? (not sure of exact form; static syntax is not my strong suit!)!#if
, because I think those occur too early in the sequence (but happy to be proved wrong)Expand for custom scriptlet, as discussed...
Beta Was this translation helpful? Give feedback.
All reactions