Blocking JS with Privoxy

For the more technical/geeky chat subjects!

Moderator: satrow

User avatar
Mesh Malachi
Newbie
Newbie
Posts: 4
Joined: Sat, 01 Sep 2018, 03:51

Blocking JS with Privoxy

Unread postby Mesh Malachi » Mon, 12 Nov 2018, 21:17

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.
Last edited by Mesh Malachi on Mon, 12 Nov 2018, 21:29, edited 2 times in total.

User avatar
Mesh Malachi
Newbie
Newbie
Posts: 4
Joined: Sat, 01 Sep 2018, 03:51

Re: Blocking JS with Privoxy

Unread postby Mesh Malachi » Mon, 12 Nov 2018, 22:07

Just found their mailing list, so I guess that's where I'll get my answer.

User avatar
Fedor2
Astronaut
Astronaut
Posts: 586
Joined: Mon, 11 Apr 2016, 01:26

Re: Blocking JS with Privoxy

Unread postby Fedor2 » Wed, 14 Nov 2018, 17:05

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} }
/

User avatar
nateliv
New to the forum
New to the forum
Posts: 1
Joined: Tue, 18 Dec 2018, 08:48

Re: Blocking JS with Privoxy

Unread postby nateliv » Tue, 18 Dec 2018, 08:49

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


Return to “Technical chat”

Who is online

Users browsing this forum: No registered users and 0 guests