X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=doc%2Fwebserver%2Fuser-manual%2Fappendix.html;h=d706d0e96f96cb63daf15e1850f67406e18a3fb1;hp=8480b63562ce3b4ff6d1aa68970f86bb980d043c;hb=3eabce711503c99e93ad129326b4183e99dd254d;hpb=6f113c5cca4a173f76c1000a093fc4a8618e3668 diff --git a/doc/webserver/user-manual/appendix.html b/doc/webserver/user-manual/appendix.html index 8480b635..d706d0e9 100644 --- a/doc/webserver/user-manual/appendix.html +++ b/doc/webserver/user-manual/appendix.html @@ -1,19 +1,25 @@ +
Privoxy User Manual | Privoxy 3.0.9 User Manual||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Prev | PCRE and
- PCRSPCRS libraries. If you are reading this, you probably don't understand what /.*/banners/.* - A simple example
that uses the common combination of in the path
somewhere. A now something a little more complex: /.*/adv((er)?ts?|ertis(ing|ements?))?/ -
We have several literal forward slashes again (".*", so we are matching against any conceivable sub-path, just so
- it matches our expression. The only true literal that must
match our pattern is adv"ing"
- OR "ements?", which would then match
either spelling. /.*/advert[0-9]+\.(gif|jpe?g) - Again
another path statement with forward slashes. Anything in the square brackets
"[]""[ ]" can be matched. This is using "0-9" More reading on Perl Compatible Regular expressions:
http://www.perldoc.com/perl5.6/pod/perlre.htmlhttp://perldoc.perl.org/perlre.html For information on regular expression based substititions and their applications
+> For information on regular expression based substitutions and their applications
in filters, please see the filter file tutorial Since
- Toggle Privoxy on or off. In this case, config file. When toggled "off", "Privoxy" continues
- to run, but only as a pass-through proxy, with no actions taking place:
+>
+ continues to run, but only as a pass-through proxy, with no actions taking
+ place:
Privoxy - Submit Actions File FeedbackPrivoxy - Why?
Credit: The site which gave us the general idea for these bookmarklets is
www.bookmarklets.com. They
@@ -1033,11 +1084,12 @@ NAME="CHAIN"
>14.3. Chain of Events Let's take a quick look at the basic sequence of events when a web page is
- requested by your browser and Let's take a quick look at how some of Privoxy is on duty: Now the web server starts sending its response back (i.e. typically a web page and related
- data).
+> Now the web server starts sending its response back (i.e. typically a web
+ page).
First, the server headers are read and processed to determine, among other
things, the MIME type (document type) and encoding. The headers are then
- filtered as deterimed by the
+ filtered as determined by the
If a If any "+filter"
+> action
or default.filter) are processed against the buffered
- content. Filters are applied in the order they are specified in the
- default.filter file. Animated GIFs, if present, are
- reduced to either the first or last frame, depending on the action
+> and any other filter files) are
+ processed against the buffered content. Filters are applied in the order
+ they are specified in one of the filter files. Animated GIFs, if present,
+ are reduced to either the first or last frame, depending on the action
setting.The entire page, which is now filtered, is then sent by
back to your browser.
If neither If neither a "+filter"
+> action
or As the browser receives the now (probably filtered) page content, it
+> As the browser receives the now (possibly filtered) page content, it
reads and then requests any URLs that may be embedded within the page
source, e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g.
- frames), sounds, etc. For each of these objects, the browser issues a new
- request. And each such request is in turn processed as above. Note that a
- complex web page may have many such embedded URLs.
+ frames), sounds, etc. For each of these objects, the browser issues a
+ separate request (this is easily viewable in Privoxy's
+ logs). And each such request is in turn processed just as above. Note that a
+ complex web page will have many, many such embedded URLs. If these
+ secondary requests are to a different server, then quite possibly a very
+ differing set of actions is triggered.
NOTE: This is somewhat of a simplistic overview of what happens with each URL
+ request. For the sake of brevity and simplicity, we have focused on
+ Privoxy's core features only. The way
to any given URL can be complex, and not always so
easy to understand what is happening. And sometimes we need to be able to
- see just what Privoxythe Bookmarklets section on a quick
- and easy way to do this (be sure to flush caches afterward!). Another easy troubleshooting step to try is if you have done any
+ customization of your installation, revert back to the installed
+ defaults and see if that helps. There are times the developers get complaints
+ about one thing or another, and the problem is more related to a customized
+ configuration issue. "+filter" action) from
- the default.filter file since this is handled very
+ one of the filter files since this is handled very
differently and not so easy to trap! It also will not tell you about any other
URLs that may be embedded within the URL you are testing. For instance, images
such as ads are expressed as URLs within the raw page source of HTML pages. So
@@ -1351,7 +1442,8 @@ HREF="http://google.com"
TARGET="_top"
>google.com,
- and look at it one section at a time: This tells us how we have defined our
+> This is telling us how we have defined our
"actions", and
- which ones match for our example, "google.com". The first listing
- is any matches for the standard.action file. No hits at
- all here on .
+ Displayed is all the actions that are available to us. Remember,
+ the + sign denotes "standard". Then next is "on". -
+ denotes "default", or
- our "off". So some are "on" here, but many
+ are "off". Each example we try may provide a slightly different
+ end result, depending on our configuration directives. The first listing
+ is for our default.action file. The large, multi-line listing,
- is how the actions are set to match for all URLs, i.e. our default settings.
- If you look at your file. The large, multi-line
+ listing, is how the actions are set to match for all URLs, i.e. our default
+ settings. If you look at your "actions" file, this would be the section
- just below the file, this would be the
+ section just below the "aliases" section near the top. This will apply to
- all URLs as signified by the single forward slash at the end of the listing
- -- section near the top. This
+ will apply to all URLs as signified by the single forward slash at the end
+ of the listing -- "/"" / ". But we can define additional actions that would be exceptions to these general
- rules, and then list specific URLs (or patterns) that these exceptions would
- apply to. Last match wins. Just below this then are two explicit matches for
- But we have defined additional actions that would be exceptions to these general
+ rules, and then we list specific URLs (or patterns) that these exceptions
+ would apply to. Last match wins. Just below this then are two explicit
+ matches for ".google.com". The first is negating our previous cookie setting,
- which was for . The first is negating our previous
+ cookie setting, which was for "+session-cookies-only"
- (i.e. not persistent). So we will allow persistent cookies for google. The
- second turns off any
- any "www.google.com". So, apparently, we have these two actions
- defined somewhere in the lower part of our or "mail.google.com". But it would not
+ match "www.google.de"! So, apparently, we have these two actions
+ defined as exceptions to the general rules at the top somewhere in the lower
+ part of our default.action
- file, and file, and
+ "google.com" is referenced somewhere in these latter
- sections. Then, for our user.action file, we again have no hits. And finally we pull it all together in the bottom section and summarize how
|
Now another example,
{ +block +handle-as-image } - .ad.doubleclick.net - - { +block +handle-as-image } +> { +block } ad*. + { +block } + .ad. + { +block +handle-as-image } - .doubleclick.net
We'll just show the interesting part here, the explicit matches. It is - matched three different times. Each as an We'll just show the interesting part here - the explicit matches. It is + matched three different times. Two "+block" sections, + and a "+block +handle-as-image", which is the expanded form of one of our aliases that had been defined as: "+imageblock""+block-as-image". ("+block" - and an . The custom alias "+imageblock" just simplifies the process and make - it more readable.
"+block-as-image" just + simplifies the process and make it more readable.One last example. Let's try "http://www.rhapsodyk.net/adsl/HOWTO/""http://www.example.net/adsl/HOWTO/". - This one is giving us problems. We are getting a blank page. Hmmm...
Matches for http://www.rhapsodyk.net/adsl/HOWTO/: +> Matches for http://www.example.net/adsl/HOWTO/: - { -add-header -block +deanimate-gifs -downgrade-http-version +fast-redirects - +filter{html-annoyances} +filter{js-annoyances} +filter{kill-popups} - +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal} - +filter{fun} +hide-forwarded-for-headers +hide-from-header{block} - +hide-referer{forge} -hide-user-agent -handle-as-image +set-image-blocker{blank} - +prevent-compression +session-cookies-only -crunch-incoming-cookies - -crunch-outgoing-cookies +kill-popups -send-vanilla-wafer -send-wafer } + In file: default.action [ View ] [ Edit ] + + {-add-header + -block + -client-header-filter{hide-tor-exit-notation} + -content-type-overwrite + -crunch-client-header + -crunch-if-none-match + -crunch-incoming-cookies + -crunch-outgoing-cookies + -crunch-server-header + +deanimate-gifs + -downgrade-http-version + +fast-redirects {check-decoded-url} + -filter {js-events} + -filter {content-cookies} + -filter {all-popups} + -filter {banners-by-link} + -filter {tiny-textforms} + -filter {frameset-borders} + -filter {demoronizer} + -filter {shockwave-flash} + -filter {quicktime-kioskmode} + -filter {fun} + -filter {crude-parental} + -filter {site-specifics} + -filter {js-annoyances} + -filter {html-annoyances} + +filter {refresh-tags} + -filter {unsolicited-popups} + +filter {img-reorder} + +filter {banners-by-size} + +filter {webbugs} + +filter {jumping-windows} + +filter {ie-exploits} + -filter {google} + -filter {yahoo} + -filter {msn} + -filter {blogspot} + -filter {no-ping} + -force-text-mode + -handle-as-empty-document + -handle-as-image + -hide-accept-language + -hide-content-disposition + +hide-forwarded-for-headers + +hide-from-header{block} + +hide-referer{forge} + -hide-user-agent + -inspect-jpegs + -kill-popups + -overwrite-last-modified + +prevent-compression + -redirect + -send-vanilla-wafer + -send-wafer + -server-header-filter{xml-to-html} + -server-header-filter{html-to-xml} + +session-cookies-only + +set-image-blocker{blank} + -treat-forbidden-connects-like-blocks } / { +block +handle-as-image } @@ -1643,20 +1913,38 @@ CLASS="QUOTE" > is matching "/ads"! But - we did not want this at all! Now we see why we get the blank page. We could - now add a new action below this that explicitly does in our + configuration! But we did not want this at all! Now we see why we get the + blank page. It is actually triggering two different actions here, and + the effects are aggregated so that the URL is blocked, and Privoxy is told + to treat the block as if it were an image. But this is, of course, all wrong. + We could now add a new action below this (or better in our own + user.action file) that explicitly + not - block (un blocks ( + "{-block}") paths with ) paths with + "adsl". There are - various ways to handle such exceptions. Example: in them (remember, last match in the configuration + wins). There are various ways to handle such exceptions. Example: Now the page displays ;-) Be sure to flush your browser's caches when - making such changes. Or, try using Now the page displays ;-) + Remember to flush your browser's caches when making these kinds of changes to + your configuration to insure that you get a freshly delivered page! Or, try + using Shift+Reload. |
That actually was very telling and pointed us quickly to where the problem +> That actually was very helpful and pointed us quickly to where the problem was. If you don't get this kind of match, then it means one of the default - rules in the first section is causing the problem. This would require some - guesswork, and maybe a little trial and error to isolate the offending rule. - One likely cause would be one of the default.action is causing + the problem. This would require some guesswork, and maybe a little trial and + error to isolate the offending rule. One likely cause would be one of the + "{+filter}" actions. Try - adding the URL for the site to one of aliases that turn off "+filter" actions. + These tend to be harder to troubleshoot. + Try adding the URL for the site to one of aliases that turn off + "+filter":
{shop} +> { shop } .quietpc.com .worldpay.com # for quietpc.com .jungle.com @@ -1731,14 +2033,20 @@ CLASS="SCREEN" > |
This would probably be most appropriately put in This would turn off all filtering for these sites. This is best + put in user.action, - for local site exceptions.
, for local site + exceptions. Note that when a simple domain pattern is used by itself (without + the subsequent path portion), all sub-pages within that domain are included + automatically in the scope of the action.Images that are inexplicably being blocked, may well be hitting the +"+filter{banners-by-size}" + rule, which assumes + that images of certain sizes are ad banners (works well + most of the time since these tend to be standardized).
"{fragile}" is an alias that disables most actions. This can be - used as a last resort for problem sites. Remember to flush caches! If this - still does not work, you will have to go through the remaining actions one by - one to find which one(s) is causing the problem.
"{ fragile }" is an alias that disables most + actions that are the most likely to cause trouble. This can be used as a + last resort for problem sites.
{ fragile } + # Handle with care: easy to break + mail.google. + mybank.example.com |
Remember to flush caches! Note that the + mail.google reference lacks the TLD portion (e.g. + ".com"). This will effectively match any TLD with + google in it, such as mail.google.de., + just as an example.
+ If this still does not work, you will have to go through the remaining + actions one by one to find which one(s) is causing the problem.