diff options
author | Josh Rickmar <jrick@devio.us> | 2012-08-23 12:25:45 -0400 |
---|---|---|
committer | Josh Rickmar <jrick@devio.us> | 2012-08-23 12:25:45 -0400 |
commit | 1d88a7d8ce27c36a1866ec2ae0dddf176a327af0 (patch) | |
tree | e92d14c323e025d28a2a2401c21271138e3aee8c | |
parent | 9ba0037babb7024626c43895eb216fda72485960 (diff) | |
download | xombrero-1d88a7d8ce27c36a1866ec2ae0dddf176a327af0.tar.gz |
Fix the logic for following links and opening new tabs.
-rw-r--r-- | xombrero.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xombrero.c b/xombrero.c index f49db15..4ab0d65 100644 --- a/xombrero.c +++ b/xombrero.c @@ -4820,8 +4820,8 @@ webview_npd_cb(WebKitWebView *wv, WebKitWebFrame *wf, { WebKitWebNavigationReason reason; struct user_agent ua_find, *ua; - struct domain *d = NULL; char *uri; + const char *f; if (t == NULL) { show_oops(NULL, "webview_npd_cb invalid parameters"); @@ -4903,9 +4903,13 @@ webview_npd_cb(WebKitWebView *wv, WebKitWebFrame *wf, reason = webkit_web_navigation_action_get_reason(na); if (reason == WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) { set_normal_tab_meaning(t); - if (enable_scripts == 0 && enable_cookie_whitelist == 1) - if (uri && (d = wl_find_uri(uri, &js_wl)) == NULL) + if (enable_scripts == 0 && enable_cookie_whitelist == 1) { + f = webkit_web_navigation_action_get_target_frame(na); + if (!g_strcmp0(f, "_blank")) + create_new_tab(uri, NULL, 1, -1); + else load_uri(t, uri); + } webkit_web_policy_decision_use(pd); return (TRUE); /* we made the decision */ } |