Change URI of webframe instead of webview (#146).
authorDaniel Carl <danielcarl@gmx.de>
Fri, 28 Nov 2014 08:18:59 +0000 (09:18 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 28 Nov 2014 08:18:59 +0000 (09:18 +0100)
To change to URI of the webview does not work if the page contains a frame
with a URI to a host that will be changed to https for the HSTS. In this case
the frame URI is used as page URL, so that the user does not see the page he
requested.
Instead the URI of the webframe should be changed. Thanks to Sébastien Marie
for pointing this out.

src/main.c

index 6c9d90e..7a4d5d4 100644 (file)
@@ -1216,7 +1216,7 @@ static gboolean navigation_decision_requested_cb(WebKitWebView *view,
     /* change uri for known and valid hsts hosts */
     uri = hsts_get_changed_uri(vb.session, msg);
     if (uri) {
-        webkit_web_view_load_uri(view, uri);
+        webkit_web_frame_load_uri(frame, uri);
         webkit_web_policy_decision_ignore(policy);
 
         g_free(uri);