From 312d321ff993fbe0c705c87aa713f4bbb716a5ed Mon Sep 17 00:00:00 2001 From: Alexander Butenko Date: Fri, 2 Dec 2011 19:53:30 -0400 Subject: [PATCH] Skip window_object_cleared in non-http-frames --- extensions/adblock.c | 4 ++-- extensions/addons.c | 5 +++++ extensions/formhistory.c | 6 ++++++ midori/midori-view.c | 6 ++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index 21481e5c..3248f668 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -926,9 +926,9 @@ adblock_window_object_cleared_cb (WebKitWebView* web_view, { const char *page_uri; - page_uri = webkit_web_view_get_uri (web_view); + page_uri = webkit_web_frame_get_uri (web_frame); /* Don't add adblock css into speeddial and about: pages */ - if (midori_uri_is_blank (page_uri)) + if (!midori_uri_is_http (page_uri)) return; g_free (sokoke_js_script_eval (js_context, blockscript, NULL)); diff --git a/extensions/addons.c b/extensions/addons.c index b98899b9..8aa60e39 100644 --- a/extensions/addons.c +++ b/extensions/addons.c @@ -1471,6 +1471,11 @@ addons_context_ready_cb (WebKitWebView* web_view, GSList* scripts, *styles; struct AddonElement* script, *style; struct AddonsList* scripts_list, *styles_list; + const gchar* page_uri; + + page_uri = webkit_web_frame_get_uri (web_frame); + if (!midori_uri_is_http (page_uri)) + return; /* Not a main frame! Abort */ if (web_frame != webkit_web_view_get_main_frame (web_view)) diff --git a/extensions/formhistory.c b/extensions/formhistory.c index 8b20aa13..d7a0c6e9 100644 --- a/extensions/formhistory.c +++ b/extensions/formhistory.c @@ -255,6 +255,12 @@ formhistory_window_object_cleared_cb (WebKitWebView* web_view, JSObjectRef js_window) { gchar* script; + const gchar* page_uri; + + page_uri = webkit_web_frame_get_uri (web_frame); + if (!midori_uri_is_http (page_uri)) + return; + script = formhistory_build_js (); sokoke_js_script_eval (js_context, script, NULL); g_free (script); diff --git a/midori/midori-view.c b/midori/midori-view.c index 1d4d628a..000a4dad 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -2944,6 +2944,12 @@ webkit_web_view_window_object_cleared_cb (GtkWidget* web_view, JSObjectRef js_window, MidoriView* view) { + const gchar* page_uri; + + page_uri = webkit_web_frame_get_uri (web_frame); + if (!midori_uri_is_http (page_uri)) + return; + if (katze_object_get_boolean (view->settings, "enable-private-browsing")) { /* Mask language, architecture, no plugin list */ -- 2.39.5