Removed the filtering for favicons.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 21 Oct 2013 17:23:52 +0000 (19:23 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 21 Oct 2013 17:23:52 +0000 (19:23 +0200)
This should be solved in webkit itself or in a generic way with soup session.
But at the moment it looks like this costs more cpu cycles instead of having a
noticeable benefit.

src/main.c

index 499cc62..d835899 100644 (file)
@@ -65,9 +65,6 @@ static gboolean mimetype_decision_cb(WebKitWebView *webview,
     WebKitWebFrame *frame, WebKitNetworkRequest *request, char*
     mime_type, WebKitWebPolicyDecision *decision);
 static void download_progress_cp(WebKitDownload *download, GParamSpec *pspec);
-static void request_start_cb(WebKitWebView *webview, WebKitWebFrame *frame,
-    WebKitWebResource *resource, WebKitNetworkRequest *request,
-    WebKitNetworkResponse *response);
 
 /* functions */
 static void run_user_script(WebKitWebFrame *frame);
@@ -727,7 +724,6 @@ static void setup_signals()
         "signal::title-changed", G_CALLBACK(title_changed_cb), NULL,
         "signal::mime-type-policy-decision-requested", G_CALLBACK(mimetype_decision_cb), NULL,
         "signal::download-requested", G_CALLBACK(vb_download), NULL,
-        "signal::resource-request-starting", G_CALLBACK(request_start_cb), NULL,
         "signal::should-show-delete-interface-for-element", G_CALLBACK(gtk_false), NULL,
         NULL
     );
@@ -944,19 +940,6 @@ gboolean vb_download(WebKitWebView *view, WebKitDownload *download, const char *
     return true;
 }
 
-/**
- * Callback to filter started resource request.
- */
-static void request_start_cb(WebKitWebView *webview, WebKitWebFrame *frame,
-    WebKitWebResource *resource, WebKitNetworkRequest *request,
-    WebKitNetworkResponse *response)
-{
-    const char *uri = webkit_network_request_get_uri(request);
-    if (g_str_has_suffix(uri, "/favicon.ico")) {
-        webkit_network_request_set_uri(request, "about:blank");
-    }
-}
-
 static void download_progress_cp(WebKitDownload *download, GParamSpec *pspec)
 {
     WebKitDownloadStatus status = webkit_download_get_status(download);