Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Selectively Allowing JS (without addons) (with Privoxy?)

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
bentHnau
Posts: 148
Joined: 2014-01-07 01:43
Been thanked: 1 time

Selectively Allowing JS (without addons) (with Privoxy?)

#1 Post by bentHnau »

I want to write some sort of program(s) to selectively allow Javascript (rather than allowing/disallowing all scripts on every site I visit), but I don't know where to start. I know how to program and identify scripts on sites, I just don't know what sort of things to write and how to get my code interacting with a browser. Can somebody point me to some sort of tutorial or similar resource? My internet searches haven't been fruitful.

I'm very bad at learning by example (especially if the example is undocumented code) so looking at the source for someone's addon is not really an option.

Since I'm already filtering web content with Privoxy, I was thinking I could simply use the external filters feature:
8.5.14. external-filter

Typical use:
Modify content using a programming language of your choice.

Effect:
All instances of text-based type, most notably HTML and JavaScript, to which this action applies, can be filtered on-the-fly through the specified external filter. By default plain text documents are exempted from filtering, because web servers often use the text/plain MIME type for all files whose type they don't know.)
But again, I have no idea how to start.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Selectively Allowing JS (without addons) (with Privoxy?)

#2 Post by debiman »

why don't you just use noscript?

PS: which browser?

bentHnau
Posts: 148
Joined: 2014-01-07 01:43
Been thanked: 1 time

Re: Selectively Allowing JS (without addons) (with Privoxy?)

#3 Post by bentHnau »

debiman wrote:why don't you just use noscript?

PS: which browser?
Ever since I got a warning in Iceweasel about addons having access to data I send through the browser, I stopped trusting addons. I don't know how they work (NoScript's source was undocumented), and I may as well create my own tool if I'm going to try to figure out how they work.

Anyways, qupzilla is my main browser, although I do use icecat for things that absolutely require JS. If I can use Privoxy, it will work with any browser.

User avatar
Uptorn
Posts: 228
Joined: 2022-01-22 01:07
Has thanked: 200 times
Been thanked: 52 times

Re: Selectively Allowing JS (without addons) (with Privoxy?)

#4 Post by Uptorn »

It might even be possible without going through an external language.

Code: Select all

{+block{Blocked JavaScript} +handle-as-empty-document}
  /.*\.js$
Using only the "/" with no domain should match for all sites. I believe that user action files override the defaults and could be used to make your exception-allow rules.

Post Reply