Discussion:
[privoxy-devel] Action syntax/semantics
Gregory Seidman
2015-04-11 21:05:44 UTC
Permalink
I'm working on a Firefox addon to reimplement Privoxy functionality. Yes, I
know there are various addons that do various things Privoxy does, but my
goal is to be able to import/export valid Privoxy .action and .filter files
(though, of course, external filters and a few actions can't be supported).
To do so, I need to be sure I understand the syntax and semantics. So, some
questions:

- Does any action OPTIONALLY take a parameter? In particular, is the
parameter to the block action required?

- Can action aliases take a parameter? I think the answer is no...

- The filter (also external-filter, but I can't support that),
crunch-client-header, client-header-filter, client-header-tagger,
crunch-server-header, server-header-filter, and server-header-tagger
actions all claim to be "Parameterized" in the documentation
<http://www.privoxy.org/user-manual/actions-file.html>, but aren't they
actually "Multi-value" in that more than one filter or tagger of the same
type (but with different parameters) can be applied to a matched
connection?

Thanks,
--Greg
Gregory Seidman
2015-04-12 14:04:54 UTC
Permalink
Post by Gregory Seidman
I'm working on a Firefox addon to reimplement Privoxy functionality.
Yes, I know there are various addons that do various things Privoxy
does, but my goal is to be able to import/export valid Privoxy .action
and .filter files (though, of course, external filters and a few actions
can't be supported). To do so, I need to be sure I understand the syntax
- Does any action OPTIONALLY take a parameter? In particular, is the
parameter to the block action required?
In general, parameters are documented to be required but for some
actions missing parameters will merely result in an error message
but are otherwise accepted for backwards compatibility.
The block action is (currently) one of them, but this may change
in the future (as the block reason was introduced years ago).
Are there any others? I'm trying to follow Postel's Law and be liberal in
what I accept, so I don't want to reject files the real Privoxy accepts.

[...]
Post by Gregory Seidman
actions all claim to be "Parameterized" in the documentation
<http://www.privoxy.org/user-manual/actions-file.html>, but aren't they
actually "Multi-value" in that more than one filter or tagger of the
same type (but with different parameters) can be applied to a matched
connection?
Indeed. Thanks for pointing this out, I'll look into fixing this.
Excellent, thank you for the clarifications.

Also, while I'm at it, thanks for the hard work. I've been using Privoxy
since it was JunkBuster, and it's been great. I'm only working on a browser
implementation because I'm browsing more and more HTTPS sites that Privoxy
can't (and shouldn't) proxy and clean up.
Fabian
--Greg
Fabian Keil
2015-04-13 12:27:33 UTC
Permalink
Post by Gregory Seidman
Post by Gregory Seidman
I'm working on a Firefox addon to reimplement Privoxy functionality.
Yes, I know there are various addons that do various things Privoxy
does, but my goal is to be able to import/export valid Privoxy .action
and .filter files (though, of course, external filters and a few actions
can't be supported). To do so, I need to be sure I understand the syntax
- Does any action OPTIONALLY take a parameter? In particular, is the
parameter to the block action required?
In general, parameters are documented to be required but for some
actions missing parameters will merely result in an error message
but are otherwise accepted for backwards compatibility.
The block action is (currently) one of them, but this may change
in the future (as the block reason was introduced years ago).
Are there any others?
The block action is the only formally parameterized action that
is currently accepted without parameter, however Privoxy currently
doesn't properly sanity-check parameter content in general and thus
does not reject other kinds of invalid parameters right away.

For details see parsers.c and actions.c.
Post by Gregory Seidman
I'm trying to follow Postel's Law and be liberal in
what I accept, so I don't want to reject files the real Privoxy accepts.
In my opinion Privoxy is actually too liberal and should reject
more input than it currently does. Properly rejecting invalid input
makes it less likely that Privoxy operates differently than the user
intended.

Changing this is on the TODO list and work in progress:
http://ijbswa.cvs.sourceforge.net/viewvc/ijbswa/current/TODO?view=markup#l70
Post by Gregory Seidman
Post by Gregory Seidman
actions all claim to be "Parameterized" in the documentation
<http://www.privoxy.org/user-manual/actions-file.html>, but aren't they
actually "Multi-value" in that more than one filter or tagger of the
same type (but with different parameters) can be applied to a matched
connection?
Indeed. Thanks for pointing this out, I'll look into fixing this.
Excellent, thank you for the clarifications.
You're welcome.

Fabian
Fabian Keil
2015-12-30 12:07:09 UTC
Permalink
Post by Gregory Seidman
- The filter (also external-filter, but I can't support that),
crunch-client-header, client-header-filter, client-header-tagger,
crunch-server-header, server-header-filter, and server-header-tagger
actions all claim to be "Parameterized" in the documentation
<http://www.privoxy.org/user-manual/actions-file.html>, but aren't they
actually "Multi-value" in that more than one filter or tagger of the
same type (but with different parameters) can be applied to a matched
connection?
Indeed. Thanks for pointing this out, I'll look into fixing this.
This should be fixed in CVS now.

Fabian

Continue reading on narkive:
Loading...