[Privoxy-users] Cascading Rules

Fabian Keil fk at fabiankeil.de
Thu Jan 30 14:45:01 CET 2025


Thibault Bartolone via Privoxy-users <privoxy-users at lists.privoxy.org> wrote on 2025-01-30 at 10:48:54:

> I didn't find an explicit answer in  the documentation or online, that's
> why I'm asking. Maybe it's because I don't know what string to search.
> What I want is allow ONE specific Google Drive and nothing else
> 
> The problem is that you cannot do just that:
> allow drive.google.com/drive/folders/XYZ1234
> Because for some reason, accessing this drive requires access to some other
> drive.google.com URIs, like for example drive.google.com/_/
> 
> So my question is: is it possible to do the following?
> block /
> allow drive.google.com/*
> block drive.google.com/drive/*
> allow drive.google.com/drive/folders/XYZ1234
> I would call that cascading rules, hierarchy rules or nested rules.

Quoting the documentation:
| To determine which actions apply to a request, the URL of the request
| is compared to all URL patterns in each "action file". Every time it
| matches, the list of applicable actions for the request is incrementally
| updated, using the heading of the section in which the pattern is located.
| The same is done again for tags and tag patterns later on.
| 
| If multiple applying sections set the same action differently, the last
| match wins. If not, the effects are aggregated.
<https://www.privoxy.org/user-manual/actions-file.html#ACTIONS-APPLY>

Try something like:

{+block{Only Google drive XYZ is permitted}}
/

{-block}
drive.google.com/

{+block{Forbidden Google drive}}
drive.google.com/drive/

{-block}
drive.google.com/drive/folders/XYZ1234

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-users/attachments/20250130/59d9e37d/attachment.bin>


More information about the Privoxy-users mailing list