dpacassi / disable-javascript

Adds the ability to disable JavaScript on specific sites.
MIT License
275 stars 35 forks source link

[Feature Request] Option to allow/disallow 3rd-party linked scripts for given rule entry #26

Open 1337ingDisorder opened 6 years ago

1337ingDisorder commented 6 years ago

This is another feature from the now-defunct SriptBlock addon, which I'd like to see implemented in a currently maintained Javascript blocker like Disable-Javascript.

In ScriptBlock, it would show you in the toolbar icon's drop-down menu when a website links to scripts on 3rd party domains, and would let you enable/disable individual 3rd party domains for this page.

An example case:

Let's say DomainA.com has javascript on it. One of the scripts it links to is at www.DomainA.com/scripts/first-script.js

But the website also links to a script at www.DomainB.com/some_url/second-script.js

With ScriptBlock, you could enable javascript for DomainA.com, and the core elements of the page would load, but it would keep DomainB.com blocked unless you went back into the icon's drop-down menu and clicked on "Enable DomainB.com" or "Enable all for this page".

That "enable all for this page" is also useful, as some sites link to scripts on five or six different domains and it can be a hassle manually enabling each one (but you also don't want to automatically enable all of them when you enable DomainA.com since some of the 3rd party actors might have malicious code in their scripts, so even if you trust the scripts on DomainA it's still best to have separate authorization for 3rd party scripts DomainA might link to).

This is also a functionality concern. For example, I've had PayPal transactions fail in the past because I keep Javascript disabled by default and only enable by whitelist. I had enabled PayPal, but it also links to 3rd party scripts on other domains Paypal owns, and when it couldn't load those scripts it caused problems with the payment gateway.

Without a way to authorize the 3rd party scripts it was trying to link to, my only option would have been to completely disable the script blocking addon, and then re-enable it after the purchase. I presume that's what I'll have to do with Disable-Javascript in its current form. Either way, would be nice to have that level of control to enable/disable 3rd party scripts linked to on a given page.