aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mason Larobina <mason.larobina@gmail.com>2010-04-03 00:49:02 +0800
committerGravatar Mason Larobina <mason.larobina@gmail.com>2010-04-03 11:49:25 +0800
commit680a05d16054ec4ca4bee0ea9da98155ad708dfc (patch)
tree2d6b679674e8a8be6b46eaf60018350d1fdd91e8 /src
parent81ed7b91e9a274c551ac7f1c460b573eb926c5bc (diff)
Uncomment the second new window send_event function.
This allows target blank anchors to work (and works so well that it opens two windows).
Diffstat (limited to 'src')
-rw-r--r--src/callbacks.c20
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;