While holding Ctrl or Shift key while a page is created via create signal, the navigation action modifiers are not set.
This code always print "0":
def on_create(related, navigation_action):
The C API works perfectly fine for me, in trunk.
An introspection issue seems unlikely, since this is just a simple unsigned int.
No the C API does not work, here a patch for epiphany tags/18.104.22.168:
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 195ec9814..a9d71f7c5 100644
@@ -1842,6 +1842,7 @@ create_web_view_cb (WebKitWebView *web_view,
+ printf("create_web_view_cb(): %d\n", webkit_navigation_action_get_modifiers(navigation_action));
if ((ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION) &&
Go to https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open, click on try it with Shift pressed, it will always print "0"
Can you test above patch with trunk to confirm it's fixed?
(In reply to Cédric Bellegarde from comment #3)
> Can you test above patch with trunk to confirm it's fixed?
Ah, you're thinking like me... that's almost exactly what I did to test yesterday. I used g_warning instead of printf (it's a bit more visible, and you don't need to write the \n), and I used __FUNCTION__ instead of writing out the function name in the printf... and I used w3school's tab opening example https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_tabs instead of their window opening example. Eerie.
That particular page is actually broken in trunk: none of the JS there seems to run. But you can test on https://www.w3schools.com/jsref/met_win_open.asp instead, by clicking on the Try it Yourself button. Shift+click is not going to work, because that triggers a download from navigation policy; it'll never rearch create_web_view_cb. But when I Alt+click I see it print 8.
Ok, thanks, I would have tested my self but webkit 2.19 make gcc to segfault on ArchLinux :/
Not fixed by 2.19.92
>when I Alt+click I see it print 8.
Now do the same with the "Try it" button, I see 0.
It is working with WebKitGTK 2.23.91!