From 38fd1f02bbdc5edda7daf8210a0d2b241bc9b412 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Thu, 27 Oct 2011 12:06:16 -0400 Subject: 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. --- README | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'README') 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 -- cgit v1.2.3