diff options
-rw-r--r-- | xxxterm.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/xxxterm.c b/xxxterm.c index 53b34e0..1dd0a47 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -940,20 +940,6 @@ notify_load_status_cb(WebKitWebView* wview, GParamSpec* pspec, struct tab *t) } int -webview_nw_cb(WebKitWebView *wv, WebKitWebFrame *wf, - WebKitNetworkRequest *request, WebKitWebNavigationAction *na, - WebKitWebPolicyDecision *pd, struct tab *t) -{ - if (t == NULL) - errx(1, "webview_nw_cb"); - - DNPRINTF(XT_D_NAV, "webview_nw_cb: %s\n", - webkit_network_request_get_uri(request)); - - return (FALSE); /* open in current tab */ -} - -int webview_npd_cb(WebKitWebView *wv, WebKitWebFrame *wf, WebKitNetworkRequest *request, WebKitWebNavigationAction *na, WebKitWebPolicyDecision *pd, struct tab *t) @@ -966,16 +952,16 @@ webview_npd_cb(WebKitWebView *wv, WebKitWebFrame *wf, DNPRINTF(XT_D_NAV, "webview_npd_cb: %s\n", webkit_network_request_get_uri(request)); + uri = (char *)webkit_network_request_get_uri(request); if (t->ctrl_click) { - uri = (char *)webkit_network_request_get_uri(request); - create_new_tab(uri, ctrl_click_focus); t->ctrl_click = 0; + create_new_tab(uri, ctrl_click_focus); webkit_web_policy_decision_ignore(pd); - return (TRUE); /* we made the decission */ } - return (FALSE); + webkit_web_policy_decision_use(pd); + return (TRUE); /* we made the decission */ } int @@ -1507,7 +1493,7 @@ create_new_tab(char *title, int focus) "signal::download-requested", (GCallback)webview_download_cb, t, "signal::mime-type-policy-decision-requested", (GCallback)webview_mimetype_cb, t, "signal::navigation-policy-decision-requested", (GCallback)webview_npd_cb, t, - "signal::new-window-policy-decision-requested", (GCallback)webview_nw_cb, t, + "signal::new-window-policy-decision-requested", (GCallback)webview_npd_cb, t, "signal::event", (GCallback)webview_event_cb, t, NULL); |