diff options
-rw-r--r-- | embed/ephy-web-view.c | 8 | ||||
-rw-r--r-- | embed/web-extension/ephy-web-extension.c | 14 |
2 files changed, 13 insertions, 9 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 7bbd67439..98b29d27c 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -2648,9 +2648,7 @@ form_auth_data_save_requested (EphyEmbedShell *shell, } #endif -#ifdef HAVE_WEBKIT2 -/* TODO: WebKitWebResource::send-request */ -#else +#ifndef HAVE_WEBKIT2 static void add_do_not_track_header_cb (WebKitWebView *view, WebKitWebFrame *frame, WebKitWebResource *resource, WebKitNetworkRequest *request, @@ -2815,9 +2813,7 @@ ephy_web_view_init (EphyWebView *web_view) web_view); #endif -#ifdef HAVE_WEBKIT2 - /* TODO: WebKitWebResource::send-request */ -#else +#ifndef HAVE_WEBKIT2 if (g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_DO_NOT_TRACK)) priv->do_not_track_handler = g_signal_connect (web_view, "resource-request-starting", G_CALLBACK (add_do_not_track_header_cb), NULL); diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c index d47c7f860..47feedad1 100644 --- a/embed/web-extension/ephy-web-extension.c +++ b/embed/web-extension/ephy-web-extension.c @@ -80,9 +80,17 @@ web_page_send_request (WebKitWebPage *web_page, const char *request_uri; const char *page_uri; - /* FIXME: Instead of checking the setting here, connect to the signal - * or not depending on the setting. - */ + if (g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_DO_NOT_TRACK)) { + SoupMessageHeaders *headers; + + headers = webkit_uri_request_get_http_headers (request); + if (headers) { + /* Do Not Track header. '1' means 'opt-out'. See: + * http://tools.ietf.org/id/draft-mayer-do-not-track-00.txt */ + soup_message_headers_append (headers, "DNT", "1"); + } + } + if (!g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_ENABLE_ADBLOCK)) return FALSE; |