[epiphany/gnome-3-22] web-extension: adblocker should never block the main resource



commit 1f84c3bd8636ce8514584e709c1a1f1736a451b6
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue Oct 25 08:35:02 2016 -0500

    web-extension: adblocker should never block the main resource
    
    We had a check for this, but it got broken in do not track mode.

 embed/web-extension/ephy-web-extension.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index 343a40d..5b1a085 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -111,11 +111,13 @@ web_page_send_request (WebKitWebPage     *web_page,
                        WebKitURIResponse *redirected_response,
                        EphyWebExtension  *extension)
 {
+  const char *original_request_uri;
   const char *request_uri;
   const char *page_uri;
   gboolean ret;
 
   request_uri = webkit_uri_request_get_uri (request);
+  original_request_uri = request_uri;
 
   if (g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_DO_NOT_TRACK)) {
     SoupMessageHeaders *headers;
@@ -143,7 +145,7 @@ web_page_send_request (WebKitWebPage     *web_page,
   page_uri = webkit_web_page_get_uri (web_page);
 
   /* Always load the main resource. */
-  if (g_strcmp0 (request_uri, page_uri) == 0)
+  if (g_strcmp0 (original_request_uri, page_uri) == 0)
     return FALSE;
 
   /* Always load data requests, as uri_tester won't do any good here. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]