[epiphany] Decide on which URI tests to use in web process
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Decide on which URI tests to use in web process
- Date: Wed, 23 Nov 2016 22:45:18 +0000 (UTC)
commit 824a1c0865abde8f015a705cf59208d6640d59af
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Nov 23 16:42:54 2016 -0600
Decide on which URI tests to use in web process
Since the HTTPS Everywhere decision has to be made here, let's do the
rest here as well.
https://bugzilla.gnome.org/show_bug.cgi?id=774925
embed/ephy-uri-tester.c | 4 +---
embed/web-extension/ephy-web-extension.c | 5 +++++
2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-uri-tester.c b/embed/ephy-uri-tester.c
index 5171681..007ff22 100644
--- a/embed/ephy-uri-tester.c
+++ b/embed/ephy-uri-tester.c
@@ -860,14 +860,12 @@ ephy_uri_tester_rewrite_uri (EphyUriTester *tester,
/* Should we block the URL outright? */
if ((flags & EPHY_URI_TEST_ADBLOCK) &&
- g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_ENABLE_ADBLOCK) &&
ephy_uri_tester_test_uri (tester, request_uri, page_uri)) {
g_debug ("Request '%s' blocked (page: '%s')", request_uri, page_uri);
return g_strdup ("");
}
- if ((flags & EPHY_URI_TEST_TRACKING_QUERIES) &&
- g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_DO_NOT_TRACK)) {
+ if ((flags & EPHY_URI_TEST_TRACKING_QUERIES)) {
/* Remove analytics from URL. Note that this function is a bit annoying to
* use: it returns NULL if it doesn't remove any query parameters. */
modified_uri = ephy_remove_tracking_from_uri (request_uri);
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index cad58dd..c89ebd8 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -143,6 +143,9 @@ web_page_send_request (WebKitWebPage *web_page,
char *modified_uri;
EphyUriTestFlags flags = EPHY_URI_TEST_ALL;
+ if (!g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_ENABLE_ADBLOCK))
+ flags &= ~EPHY_URI_TEST_ADBLOCK;
+
if (g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_DO_NOT_TRACK)) {
SoupMessageHeaders *headers = webkit_uri_request_get_http_headers (request);
if (headers) {
@@ -150,6 +153,8 @@ web_page_send_request (WebKitWebPage *web_page,
* http://tools.ietf.org/id/draft-mayer-do-not-track-00.txt */
soup_message_headers_append (headers, "DNT", "1");
}
+ } else {
+ flags &= ~EPHY_URI_TEST_TRACKING_QUERIES;
}
request_uri = webkit_uri_request_get_uri (request);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]