Adjust to new world order with dedicated header-filter actions.
authorFabian Keil <fk@fabiankeil.de>
Tue, 20 Mar 2007 15:40:00 +0000 (15:40 +0000)
committerFabian Keil <fk@fabiankeil.de>
Tue, 20 Mar 2007 15:40:00 +0000 (15:40 +0000)
default.action.master
default.filter
standard.action
templates/edit-actions-for-url
templates/edit-actions-for-url-filter

index b9844ab..a4c94c8 100644 (file)
@@ -9,7 +9,7 @@
 # 
 #  File        :  $Source: /cvsroot/ijbswa/current/default.action.master,v $
 # 
-#  $Id: default.action.master,v 1.66 2007/03/16 16:04:18 fabiankeil Exp $
+#  $Id: default.action.master,v 1.67 2007/03/19 14:28:38 proactivesvcs Exp $
 #
 #  Requires    :  This version requires Privoxy v3.0.7 or later due to 
 #                 syntax changes.
 #    Block this URL. Privoxy will ignore this URL completely, and not request
 #    it.
 #
+# +client-header-filter{name}
+#    All client headers to which this action applies are filtered on-the-fly
+#    through the specified regular expression based substitutions.
+#
+#    Client-header filters predefined in the supplied default.filter include:
+#
+#     hide-tor-exit-notation: Removes the Tor exit node notation in Host and Referer headers
+#
 # +content-type-overwrite
 #    Replaces the "Content-Type:" HTTP server header, so that unwanted
 #    download menus will not pop up, or changes the browser's rendering mode.
 #    be seen with View Source), not the headers. Repeat for multiple filters.
 #    Use with caution: filters can be very intrusive.
 #   
-#    Filters predefined in the supplied default.action include:
+#    Filters predefined in the supplied default.filter include:
 #
 #     js-annoyances:         Get rid of particularly annoying JavaScript abuse
 #     js-events:             Kill all JS event bindings (Radically destructive! Use only on real suckers)
 #     yahoo:                 Removes text ads and other Yahoo specific improvements
 #     msn:                   Removes text ads and other MSN specific improvements
 #     blogspot:              Cleans up Blogspot blogs
-#     html-to-xml:           Header filter to change the Content-Type from html to xml
-#     xml-to-html:           Header filter to change the Content-Type from xml to html
 #     no-ping:               Removes non-standard ping attributes from anchor and area tags
-#     hide-tor-exit-notation: Header filter to remove the Tor exit node notation in Host and Referer headers
-#
-# +filter-client-headers
-#    By default, filters only apply to the document content itself. This will
-#    extend those filters to include the client's headers as well.
-#
-# +filter-server-headers
-#    By default, filters only apply to the document content itself. This will
-#    extend those filters to include the server's headers as well.
 #
 # +force-text-mode
 #    Declares a document as plain text, even if the "Content-Type:" isn't detected 
 # +inspect-jpegs
 #    Scan jpeg headers for malformed comment blocks and correct them.
 #
-# +set-image-blocker{blank}
-# +set-image-blocker{pattern}
-# +set-image-blocker{<URL>} with <url> being any valid image URL
-#    Decides what to do with URLs that end up tagged with {+block +handle-as-image}.
-#    There are 4 options:
-#      * "-set-image-blocker" will send a HTML "blocked" page, usually
-#         resulting in a "broken image" icon.
-#      * "+set-image-blocker{blank}" will send a 1x1 transparent image
-#      * "+set-image-blocker{pattern}" will send a 4x4 grey/white pattern
-#        which is less intrusive than the logo but easier to recognize
-#        than the transparent one.
-#      * "+set-image-blocker{<URL>}" will send a HTTP temporary redirect
-#        to the specified image URL.
-#
-#
 # +limit-connect{portlist}
 #   The CONNECT methods exists in HTTP to allow access to secure websites
 #   (https:// URLs) through proxies. It works very simply: The proxy
 #    and +gif-deanimate will not work on compressed data. Will slow down
 #    connections to those websites, though.
 #
-# +prevent-keeping-cookies
+# +server-header-filter{name}
+#    All server headers to which this action applies are filtered on-the-fly
+#    through the specified regular expression based substitutions.
+#
+#    Server-header filters predefined in the supplied default.filter include:
+#
+#     html-to-xml:           Changes the Content-Type header from html to xml
+#     xml-to-html:           Changes the Content-Type header from xml to html
+#
 # +session-cookies-only
 #    If the website sets cookies, make sure they are erased when you exit
 #    and restart your web browser.  This makes profiling cookies useless,
 #    but won't break sites which require cookies so that you can log in
 #    or for transactions.
 #
+# +set-image-blocker{blank}
+# +set-image-blocker{pattern}
+# +set-image-blocker{<URL>} with <url> being any valid image URL
+#    Decides what to do with URLs that end up tagged with {+block +handle-as-image}.
+#    There are 4 options:
+#      * "-set-image-blocker" will send a HTML "blocked" page, usually
+#         resulting in a "broken image" icon.
+#      * "+set-image-blocker{blank}" will send a 1x1 transparent image
+#      * "+set-image-blocker{pattern}" will send a 4x4 grey/white pattern
+#        which is less intrusive than the logo but easier to recognize
+#        than the transparent one.
+#      * "+set-image-blocker{<URL>}" will send a HTTP temporary redirect
+#        to the specified image URL.
+#
+#
 # +crunch-outgoing-cookies
 #    Prevent the website from reading cookies
 #
 #    equivalent.
 #
 # +redirect{<URL>}
+# +redirect{<pcrs command>}
 #    Convinces the browser that the requested document has been moved to
 #    another location and the browser should get it from the specified
 #    URL.
@@ -536,6 +542,7 @@ allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
 { \
 -add-header \
 -block \
+-client-header-filter{hide-tor-exit-notation} \
 -content-type-overwrite \
 -crunch-client-header \
 -crunch-if-none-match \
@@ -570,12 +577,7 @@ allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
 -filter{yahoo} \
 -filter{msn} \
 -filter{blogspot} \
--filter{xml-to-html} \
--filter{html-to-xml} \
 -filter{no-ping} \
--filter{hide-tor-exit-notation} \
--filter-client-headers \
--filter-server-headers \
 -force-text-mode \
 -handle-as-empty-document \
 -handle-as-image \
@@ -594,6 +596,8 @@ allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
 -redirect \
 -send-vanilla-wafer \
 -send-wafer \
+-server-header-filter{xml-to-html} \
+-server-header-filter{html-to-xml} \
 -session-cookies-only \
 +set-image-blocker{pattern} \
 -treat-forbidden-connects-like-blocks \
index 90ae640..4a2857a 100644 (file)
@@ -2,7 +2,7 @@
 # 
 #  File        :  $Source: /cvsroot/ijbswa/current/default.filter,v $
 # 
-#  $Id: default.filter,v 1.38 2007/02/19 11:22:48 hal9 Exp $
+#  $Id: default.filter,v 1.39 2007/02/21 14:10:23 fabiankeil Exp $
 #
 #  Purpose     :  Rules to process the content of web pages
 # 
@@ -638,36 +638,35 @@ s@(background:\#[a-f\d]{3})( url\(\"http://www.blogblog.com/rounders[^\"]*\"\).*
 
 #################################################################################
 #
-# x-httpd-php-to-html: Header filter to change the Content-Type from
+# x-httpd-php-to-html: Changes the Content-Type header from
 #                      x-httpd-php to html. "Content-Type: x-httpd-php"
 #                      is set by clueless PHP users and causes many
 #                      browsers do open a download menu instead of
 #                      rendering the page.
 #
 #################################################################################
-FILTER: x-httpd-php-to-html Header filter to change the Content-Type from x-httpd-php to html.
+SERVER-HEADER-FILTER: x-httpd-php-to-html Changes the Content-Type header from x-httpd-php to html.
 s@^(Content-Type:) application/x-httpd-php@$1 text/html@
 
 #################################################################################
 #
-# html-to-xml: Header filter to change the Content-Type from html to xml.
+# html-to-xml: Changes the Content-Type header from html to xml.
 #
 #################################################################################
-FILTER: html-to-xml Header filter to change the Content-Type from html to xml.
+SERVER-HEADER-FILTER: html-to-xml Changes the Content-Type header from html to xml.
 s@^(Content-Type:) text/html(;.*)?$@$1 application/xhtml+xml$2@
 
 #################################################################################
 #
-# xml-to-html: Header filter to change the Content-Type from xml to html.
+# xml-to-html: Changes the Content-Type header from xml to html.
 #
 #################################################################################
-FILTER: xml-to-html Header filter to change the Content-Type from xml to html.
+SERVER-HEADER-FILTER: xml-to-html Changes the Content-Type header from xml to html.
 s@^(Content-Type:) (?:application|text)/(?:xhtml\+)?xml(;.*)?$@$1 text/html$2@
 
 #################################################################################
 #
-# hide-tor-exit-notation: Header filter to remove the Tor exit node notation
-#                         in Host and Referer headers.
+# hide-tor-exit-notation: Remove the Tor exit node notation in Host and Referer headers.
 #
 #   Note: If Privoxy and Tor are chained and Privoxy is configured to
 #         use socks4a, one can use http://www.example.org.foobar.exit/
@@ -689,7 +688,7 @@ s@^(Content-Type:) (?:application|text)/(?:xhtml\+)?xml(;.*)?$@$1 text/html$2@
 #         coming from.
 #
 #################################################################################
-FILTER: hide-tor-exit-notation Header filter to remove the Tor exit node notation in Host and Referer headers.
+CLIENT-HEADER-FILTER: hide-tor-exit-notation Removes the Tor exit node notation in Host and Referer headers.
 s@^((?:Referer|Host):\s*(?:https?://)?[^/]*)\.[^\./]*?\.exit@$1@i
 
 
@@ -697,6 +696,12 @@ s@^((?:Referer|Host):\s*(?:https?://)?[^/]*)\.[^\./]*?\.exit@$1@i
 #
 #  Revisions   :
 #     $Log: default.filter,v $
+#     Revision 1.39  2007/02/21 14:10:23  fabiankeil
+#     - Fix a js-annoyances pcrs command that broke
+#       evaluated code. (BR #1124071, thanks to Bor Gergely)
+#     - Have unsolicited-popups and all-popups catch the
+#       wheather.com popup reported in in AF #1640173.
+#
 #     Revision 1.38  2007/02/19 11:22:48  hal9
 #     Adding back the orginal filter content to offset problems found by Fabian.
 #
index f40506e..7e574bc 100644 (file)
@@ -2,7 +2,7 @@
 # 
 #  File        :  $Source: /cvsroot/ijbswa/current/standard.action,v $
 # 
-#  $Id: standard.action,v 1.17 2006/10/24 10:53:55 hal9 Exp $
+#  $Id: standard.action,v 1.18 2007/01/22 16:06:28 fabiankeil Exp $
 #
 #  Purpose     :  Provide prefedined sets of actions, see
 #                 http://www.privoxy.org/user-manual/actions-file.html
@@ -30,6 +30,7 @@
 { \
 -add-header \
 -block \
+-client-header-filter{hide-tor-exit-notation} \
 -content-type-overwrite \
 -crunch-client-header \
 -crunch-if-none-match \
 -filter{yahoo} \
 -filter{msn} \
 -filter{blogspot} \
--filter{xml-to-html} \
--filter{html-to-xml} \
 -filter{no-ping} \
--filter{hide-tor-exit-notation} \
--filter-client-headers \
--filter-server-headers \
 -force-text-mode \
 -handle-as-empty-document \
 -handle-as-image \
@@ -88,6 +84,8 @@
 -redirect \
 -send-vanilla-wafer \
 -send-wafer \
+-server-header-filter{xml-to-html} \
+-server-header-filter{html-to-xml} \
 -session-cookies-only \
 +set-image-blocker{pattern} \
 -treat-forbidden-connects-like-blocks \
@@ -101,6 +99,7 @@ standard.Cautious
 { \
 -add-header \
 -block \
+-client-header-filter{hide-tor-exit-notation} \
 -content-type-overwrite \
 -crunch-client-header \
 -crunch-if-none-match \
@@ -135,12 +134,7 @@ standard.Cautious
 -filter{yahoo} \
 -filter{msn} \
 -filter{blogspot} \
--filter{xml-to-html} \
--filter{html-to-xml} \
 -filter{no-ping} \
--filter{hide-tor-exit-notation} \
--filter-client-headers \
--filter-server-headers \
 -force-text-mode \
 -handle-as-empty-document \
 -handle-as-image \
@@ -159,6 +153,8 @@ standard.Cautious
 -redirect \
 -send-vanilla-wafer \
 -send-wafer \
+-server-header-filter{xml-to-html} \
+-server-header-filter{html-to-xml} \
 +session-cookies-only \
 +set-image-blocker{pattern} \
 -treat-forbidden-connects-like-blocks \
@@ -179,6 +175,7 @@ standard.Medium
 { \
 -add-header \
 -block \
+-client-header-filter{hide-tor-exit-notation} \
 -content-type-overwrite \
 -crunch-client-header \
 +crunch-if-none-match \
@@ -213,12 +210,7 @@ standard.Medium
 -filter{yahoo} \
 -filter{msn} \
 -filter{blogspot} \
--filter{xml-to-html} \
--filter{html-to-xml} \
 -filter{no-ping} \
--filter{hide-tor-exit-notation} \
--filter-client-headers \
--filter-server-headers \
 -force-text-mode \
 -handle-as-empty-document \
 -handle-as-image \
@@ -237,6 +229,8 @@ standard.Medium
 -redirect \
 -send-vanilla-wafer \
 -send-wafer \
+-server-header-filter{xml-to-html} \
+-server-header-filter{html-to-xml} \
 -session-cookies-only \
 +set-image-blocker{pattern} \
 +treat-forbidden-connects-like-blocks \
index c96e313..d8cd669 100644 (file)
 #
 # Revisions   :
 #    $Log: edit-actions-for-url,v $
+#    Revision 1.41  2007/01/23 16:03:16  fabiankeil
+#    - Add favicon links.
+#    - Remove useless W3C validator links.
+#
 #    Revision 1.40  2006/12/21 13:01:03  fabiankeil
 #    Prepare for "split-large-forms".
 #
@@ -737,33 +741,6 @@ function show_send_wafer_opts(tf)
       <th>Description</th>
     </tr>
 <!-- if-multiple-forms-end@ -->
-    <tr class="bg1" align="left" valign="top">
-      <td class="en1" align="center" valign="middle"><input type="radio"
-        name="filter_client_headers" value="Y" @filter-client-headers-y@
-        ></td>
-      <td class="dis1" align="center" valign="middle"><input type="radio"
-        name="filter_client_headers" value="N" @filter-client-headers-n@
-        ></td>
-      <td class="noc1" align="center" valign="middle"><input type="radio"
-        name="filter_client_headers" value="X" @filter-client-headers-x@
-        ></td>
-      <td class="action"><a href="@user-manual@@actions-help-prefix@FILTER-CLIENT-HEADERS">filter-client-headers</a></td>
-      <td>Apply filters to the client headers as well. Only enable this if you know what you're doing.</td>
-    </tr>
-    <tr class="bg1" align="left" valign="top">
-      <td class="en1" align="center" valign="middle"><input type="radio"
-        name="filter_server_headers" value="Y" @filter-server-headers-y@
-        ></td>
-      <td class="dis1" align="center" valign="middle"><input type="radio"
-        name="filter_server_headers" value="N" @filter-server-headers-n@
-        ></td>
-      <td class="noc1" align="center" valign="middle"><input type="radio"
-        name="filter_server_headers" value="X" @filter-server-headers-x@
-        ></td>
-      <td class="action"><a href="@user-manual@@actions-help-prefix@FILTER-SERVER-HEADERS">filter-server-headers</a></td>
-      <td>Apply filters to the server headers as well. Only enable this if you know what you're doing.</td>
-    </tr>
-
    <tr class="bg1" align="left" valign="top">
       <td class="en1" align="center" valign="middle"><input type="radio"
         name="force_text_mode" value="Y" @force-text-mode-y@
index 67fdff7..ea95997 100644 (file)
@@ -1,7 +1,33 @@
+##############################################################################
+#
+# File        :  $Source: /cvsroot/ijbswa/current/templates/edit-actions-for-url-filter,v $
+#
+# Purpose     :  Template that is included from most of Privoxy's CGI pages
+#                to show the user how to get help or report problems.
+# 
+#
+# Copyright   :  Written by and Copyright (C) 2002-2007 members of
+#                the SourceForge Privoxy team. http://www.privoxy.org/
+#
+#                This template is free software; you can redistribute it 
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+# Revisions   :
+#    $Log: edit-actions-for-url-filter,v $
+#
+##############################################################################
+
 <tr class="bg1" align="left" valign="top">
   <td class="en1" align="center" valign="middle"><input type="radio" name="filter_r@index@" value="Y" @this-filter-y@></td>
   <td class="dis1" align="center" valign="middle"><input type="radio" name="filter_r@index@" value="N" @this-filter-n@></td>
   <td class="noc1" align="center" valign="middle"><input type="radio" name="filter_r@index@" value="X" @this-filter-x@></td>
-  <td class="action"><a href="@user-manual@@actions-help-prefix@FILTER">filter</a> @name@<input type="hidden" name="filter_n@index@" value="@name@"></td>
+  <td class="action">
+    <input type="hidden" name="filter_t@index@" value="@abbr-filter-type@">
+    <input type="hidden" name="filter_n@index@" value="@name@">
+    <a href="@user-manual@@actions-help-prefix@FILTER">@filter-type@</a> @name@
+  </td>
   <td>@description@</td>
 </tr>