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.
Blocking JS with Privoxy
Blocking JS with Privoxy
Last edited by Mesh Malachi on 2018-11-12, 21:29, edited 2 times in total.
Re: Blocking JS with Privoxy
Just found their mailing list, so I guess that's where I'll get my answer.
Re: Blocking JS with Privoxy
When i want to save clean html page
in the filter file:
then in the action file:
{ +filter{clean-of-script} }
/
in the filter file:
Code: Select all
FILTER: clean-of-script Remove all script tag
s-<script.*</script>--sigU
s-</?(noscript).*>--sigU
{ +filter{clean-of-script} }
/
Re: Blocking JS with Privoxy
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
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