Sorry, the previous one doesn't work, this one is tested. Still some sites might *not* work without referer field in between of HTTP redirections. I couldn't find a way to modify HTTP headers only for those requests that're actually sent by users. --- surf.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/surf.c b/surf.c index d48fbc9..28f236a 100644 --- a/surf.c +++ b/surf.c @@ -1618,6 +1618,8 @@ decidenavigation(WebKitPolicyDecision *d, Client *c) WebKitNavigationAction *a = webkit_navigation_policy_decision_get_navigation_action( WEBKIT_NAVIGATION_POLICY_DECISION(d)); + WebKitURIRequest *r; + SoupMessageHeaders *h; switch (webkit_navigation_action_get_navigation_type(a)) { case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ @@ -1632,6 +1634,14 @@ decidenavigation(WebKitPolicyDecision *d, Client *c) WEBKIT_NAVIGATION_POLICY_DECISION(d))) { webkit_policy_decision_ignore(d); } else { + r = webkit_navigation_action_get_request(a); + h = webkit_uri_request_get_http_headers(r); + if (h && soup_message_headers_get_one(h, "Referer")) { + soup_message_headers_remove(h, "Referer"); + webkit_web_view_load_request(c->view, r); + webkit_policy_decision_ignore(d); + break; + } /* Filter out navigation to different domain ? */ /* get action→urirequest, copy and load in new window+view * on Ctrl+Click ? */ -- 2.19.1