From cabad0ad357cad6e23a42b37055572df26c14283 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Sat, 13 Feb 2010 00:07:43 +0100 Subject: resource-request-starting --- AUTHORS | 1 + src/callbacks.c | 12 ++++++++++++ src/callbacks.h | 4 ++++ src/events.c | 1 + src/events.h | 1 + src/uzbl-core.c | 1 + 6 files changed, 20 insertions(+) diff --git a/AUTHORS b/AUTHORS index b7b6e87..e66d399 100644 --- a/AUTHORS +++ b/AUTHORS @@ -22,6 +22,7 @@ In alphabetical order: Abel Camarillo (00z) - various portability fixes, such as BSD fixes for Makefile and posix shell scripts Aldrik Dunbar (n30n) - scroll % script Andraž 'ruskie' Levstik - font_family patch + Andrea Marchesini - resource-request-starting Andy Spencer - security fixes Barak A. Pearlmutter - typo fix Brendan Taylor (bct) - various bugfixes, making misc variables much better using expand(), refactoring some internal var stuff diff --git a/src/callbacks.c b/src/callbacks.c index 6ec48ea..9b90d3c 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -660,6 +660,18 @@ mime_policy_cb(WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequ return TRUE; } +void +request_starting_cb(WebKitWebView *web_view, WebKitWebFrame *frame, WebKitWebResource *resource, + WebKitNetworkRequest *request, WebKitNetworkResponse *response, gpointer user_data) { + (void) web_view; + (void) frame; + (void) resource; + (void) response; + (void) user_data; + + send_event(REQUEST_STARTING, webkit_network_request_get_uri(request), NULL); +} + /*@null@*/ WebKitWebView* create_web_view_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data) { (void) web_view; diff --git a/src/callbacks.h b/src/callbacks.h index 43a9192..6ed8986 100644 --- a/src/callbacks.h +++ b/src/callbacks.h @@ -186,6 +186,10 @@ gboolean mime_policy_cb(WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, gchar *mime_type, WebKitWebPolicyDecision *policy_decision, gpointer user_data); +void +request_starting_cb(WebKitWebView *web_view, WebKitWebFrame *frame, WebKitWebResource *resource, + WebKitNetworkRequest *request, WebKitNetworkResponse *response, gpointer user_data); + /*@null@*/ WebKitWebView* create_web_view_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data); diff --git a/src/events.c b/src/events.c index 371c8b8..1028c30 100644 --- a/src/events.c +++ b/src/events.c @@ -19,6 +19,7 @@ const char *event_table[LAST_EVENT] = { "LOAD_COMMIT" , "LOAD_FINISH" , "LOAD_ERROR" , + "REQUEST_STARTING" , "KEY_PRESS" , "KEY_RELEASE" , "DOWNLOAD_REQUEST" , diff --git a/src/events.h b/src/events.h index b02a43c..fe3ff3b 100644 --- a/src/events.h +++ b/src/events.h @@ -6,6 +6,7 @@ /* Event system */ enum event_type { LOAD_START, LOAD_COMMIT, LOAD_FINISH, LOAD_ERROR, + REQUEST_STARTING, KEY_PRESS, KEY_RELEASE, DOWNLOAD_REQ, COMMAND_EXECUTED, LINK_HOVER, TITLE_CHANGED, GEOMETRY_CHANGED, WEBINSPECTOR, NEW_WINDOW, SELECTION_CHANGED, diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 9168597..2b47380 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -2056,6 +2056,7 @@ create_browser () { "signal::download-requested", (GCallback)download_cb, NULL, "signal::create-web-view", (GCallback)create_web_view_cb, NULL, "signal::mime-type-policy-decision-requested", (GCallback)mime_policy_cb, NULL, + "signal::resource-request-starting", (GCallback)request_starting_cb, NULL, "signal::populate-popup", (GCallback)populate_popup_cb, NULL, "signal::focus-in-event", (GCallback)focus_cb, NULL, "signal::focus-out-event", (GCallback)focus_cb, NULL, -- cgit v1.2.3 From 4dfdace43ff698b1ce37e424ccb6d70d54918f2f Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 13 Feb 2010 00:09:50 +0100 Subject: readme update for REQUEST_STARTING event --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 7092508..d051118 100644 --- a/README +++ b/README @@ -638,6 +638,8 @@ Events have this format: could not be loaded for the reason described in `reason_of_error`. * `EVENT [uzbl_instance_name] LOAD_PROGRESS percentage` : While the page is loading, gives the `percentage` of the page that has finished loading. +* `EVENT [uzbl_instance_name] REQUEST_STARTING uri`: http resource gets + requested * `EVENT [uzbl_instance_name] TITLE_CHANGED title_name`: When the title of the page (and hence maybe, the window title) changed. `title_name` is the new title. -- cgit v1.2.3