aboutsummaryrefslogtreecommitdiffhomepage
path: root/README
diff options
context:
space:
mode:
authorGravatar Devin J. Pohly <djpohly@gmail.com>2011-10-27 12:06:16 -0400
committerGravatar Devin J. Pohly <djpohly@gmail.com>2011-10-27 13:24:45 -0400
commit38fd1f02bbdc5edda7daf8210a0d2b241bc9b412 (patch)
treee3c39acd94349ac78d982d7fc290a48ddde7435c /README
parent4e9672c31ee7790cb4a0453b7d45d3e89613c035 (diff)
add request_handler hook
This creates a handler `request_handler' in the same vein as scheme_handler, download_handler, etc., which is called whenever the page requests a URI. (Possible applications include Adblock and SSL enforcement.) The handler should get the URI from $1 and print the URI of the resource that should be loaded instead, or print nothing to allow the request unmodified.
Diffstat (limited to 'README')
-rw-r--r--README12
1 files changed, 10 insertions, 2 deletions
diff --git a/README b/README
index 925392c..ab58ab2 100644
--- a/README
+++ b/README
@@ -313,6 +313,9 @@ file).
- `data`: The cookie data. Only included for "PUT" requests.
* `scheme_handler`: handler to execute for each URI navigated to - the
navigation request will be ignored if handler prints "USED\n"
+* `request_handler`: Executed whenever any request is made. The handler can
+ print a URI to redirect the request (or `about:blank` to effectively cancel it).
+ If the handler does nothing, the request will continue unchanged.
* `download_handler`: executed when a download is started. the handler script
should print a path that the download should be saved to, or print nothing
to cancel the download.
@@ -507,8 +510,9 @@ access to the following environment variables:
* `$UZBL_URI`: The URI of the current page.
* `$UZBL_TITLE`: The current page title.
-Handler scripts (`download_handler`, `cookie_handler`, `scheme_handler` and
-`authentication_handler`) are called with special arguments:
+Handler scripts (`download_handler`, `cookie_handler`, `scheme_handler`,
+`request_handler`, and `authentication_handler`) are called with special
+arguments:
* download handler
@@ -537,6 +541,10 @@ Handler scripts (`download_handler`, `cookie_handler`, `scheme_handler` and
- `$1 URI` of the page to be navigated to
+* request handler
+
+ - `$1 URI` of the resource which is being requested
+
* authentication handler:
- `$1`: authentication zone unique identifier