diff options
Diffstat (limited to 'src/callbacks.c')
-rw-r--r-- | src/callbacks.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/callbacks.c b/src/callbacks.c index 5c8a386..d2352b2 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -647,13 +647,19 @@ new_window_cb (WebKitWebView *web_view, WebKitWebFrame *frame, if (uzbl.state.verbose) printf("New window requested -> %s \n", webkit_network_request_get_uri (request)); - /* This seems to cause trouble and not to be needed anyways - * as create_web_view_cb will also be called whenever this - * callback is triggered thus resulting in doubled events - - send_event(NEW_WINDOW, webkit_network_request_get_uri (request), NULL); - - */ + /* This event function causes troubles with `target="_blank"` anchors. + * Either we: + * 1. Comment it out and target blank links are ignored. + * 2. Uncomment it and two windows are opened when you click on target + * blank links. + * + * This problem is caused by create_web_view_cb also being called whenever + * this callback is triggered thus resulting in the doubled events. + * + * We are leaving this uncommented as we would rather links open twice + * than not at all. + */ + send_event(NEW_WINDOW, webkit_network_request_get_uri (request), NULL); webkit_web_policy_decision_ignore(policy_decision); return TRUE; |