]> spindle.queued.net Git - midori/commitdiff
Skip window_object_cleared in non-http-frames
authorAlexander Butenko <a.butenka@gmail.com>
Fri, 2 Dec 2011 23:53:30 +0000 (19:53 -0400)
committerChristian Dywan <christian@twotoasts.de>
Wed, 7 Dec 2011 19:30:42 +0000 (20:30 +0100)
extensions/adblock.c
extensions/addons.c
extensions/formhistory.c
midori/midori-view.c

index 21481e5cb5c39a19b6be3b9844b21f674e009e20..3248f6681945b55d461d533a08d96322395e0621 100644 (file)
@@ -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));
index b98899b9881ff4711504b224d0d69a3b111dca97..8aa60e3922269d3eaa4ad4beba762f9ec331eaeb 100644 (file)
@@ -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))
index 8b20aa13a8ad253c778810fff374a303670b0214..d7a0c6e92d970274822e967398bce080d9f16ea8 100644 (file)
@@ -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);
index 1d4d628a90bb5c09f47fc9922db794a0ef21afb4..000a4dadbd0410053bdd003893158f727619043f 100644 (file)
@@ -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 */