aboutsummaryrefslogtreecommitdiffstats
path: root/surf.c
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-10-01 16:18:38 +0200
committerjoe <rbo@gmx.us>2025-10-01 16:18:38 +0200
commit63b79d3a45046025308bf4eee705f1f356cdd2af (patch)
tree8d118ea929889f6bd7ac8db630f46981312f7b26 /surf.c
parentup (diff)
downloadsurf-master.tar.gz
surf-master.tar.bz2
surf-master.tar.xz
surf-master.tar.zst
surf-master.zip
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/surf.c b/surf.c
index 7a0f624..241b8f6 100644
--- a/surf.c
+++ b/surf.c
@@ -1242,12 +1242,13 @@ createview(WebKitWebView *v, WebKitNavigationAction *a, Client *c)
switch (webkit_navigation_action_get_navigation_type(a)) {
case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */
/*
- * popup windows of type “other” are almost always triggered
- * by user gesture, so inverse the logic here
+ * allow same-window popup triggered by user gesture
*/
-/* instead of this, compare destination uri to mouse-over uri for validating window */
- if (webkit_navigation_action_is_user_gesture(a))
+ if (webkit_navigation_action_is_user_gesture(a)) {
+ Arg aa = {.v = webkit_uri_request_get_uri(webkit_navigation_action_get_request(a))};
+ newwindow(c, &aa, 1);
return NULL;
+ }
case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */
case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */
case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */