Page 1 of 1

Blocking JS with Privoxy

Posted: 2018-11-12, 21:17
by Mesh Malachi
How can I block Javascript with Privoxy? I'm pretty sure I need to use a filter, but +filter{*.js} and +filter{*javascript*} didn't work.

I'm trying to block JS by default and then whitelist scripts. I don't want to use add-ons.

Edit: +filter{whatever} is just the filter label; I see now that I have to define the filtering rule separately (using regular expressions) from the label. My problem is that I'm not sure what the rule should be. The *.js and *javascript* were guesses about the rule.

Re: Blocking JS with Privoxy

Posted: 2018-11-12, 22:07
by Mesh Malachi
Just found their mailing list, so I guess that's where I'll get my answer.

Re: Blocking JS with Privoxy

Posted: 2018-11-14, 17:05
by Fedor2
When i want to save clean html page

in the filter file:

Code: Select all

FILTER: clean-of-script Remove all script tag
s-<script.*</script>--sigU
s-</?(noscript).*>--sigU
then in the action file:
{ +filter{clean-of-script} }
/

Re: Blocking JS with Privoxy

Posted: 2018-12-18, 08:49
by nateliv
To add an additional site to the block list easily, first open the user.action file.
Code:
$ sudo gedit /etc/privoxy/user.action
You're going to make a backup, aren't you! Yes, good idea! Do that! Give yourself a pat on the back.
Read the readme.
Scroll to the very bottom of the file
Add

Code:
{+block}
.xyxlol.com
to the bottom of the file.
In future, you can add others like so

Code:
{+block}
.xyxlol.com
.anotherannoyingsite.net
.so-many-adverts-argh.org