<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>181041</bug_id>
          
          <creation_ts>2017-12-20 09:28:51 -0800</creation_ts>
          <short_desc>[GTK] WebView create signal: navigation action modifiers not set</short_desc>
          <delta_ts>2019-03-07 09:09:28 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Cédric Bellegarde">cedric.bellegarde</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1383683</commentid>
    <comment_count>0</comment_count>
    <who name="Cédric Bellegarde">cedric.bellegarde</who>
    <bug_when>2017-12-20 09:28:51 -0800</bug_when>
    <thetext>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 &quot;0&quot;:

def on_create(related, navigation_action):
   print(navigation_action.get_modifiers())

webview.connect(&quot;create&quot;, on_create)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1384264</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-12-21 14:21:33 -0800</bug_when>
    <thetext>The C API works perfectly fine for me, in trunk.

An introspection issue seems unlikely, since this is just a simple unsigned int.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1384408</commentid>
    <comment_count>2</comment_count>
    <who name="Cédric Bellegarde">cedric.bellegarde</who>
    <bug_when>2017-12-21 23:49:41 -0800</bug_when>
    <thetext>No the C API does not work, here a patch for epiphany tags/3.26.5.1:

diff --git a/src/ephy-window.c b/src/ephy-window.c
index 195ec9814..a9d71f7c5 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1842,6 +1842,7 @@ create_web_view_cb (WebKitWebView          *web_view,
   EphyNewTabFlags flags;
   EphyWindow *target_window;
 
+  printf(&quot;create_web_view_cb(): %d\n&quot;, webkit_navigation_action_get_modifiers(navigation_action));
   if ((ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION) &amp;&amp;
       (g_settings_get_boolean (EPHY_SETTINGS_MAIN,
                                EPHY_PREFS_NEW_WINDOWS_IN_TABS) ||


Go to https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open, click on try it with Shift pressed, it will always print &quot;0&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1384409</commentid>
    <comment_count>3</comment_count>
    <who name="Cédric Bellegarde">cedric.bellegarde</who>
    <bug_when>2017-12-21 23:51:00 -0800</bug_when>
    <thetext>Can you test above patch with trunk to confirm it&apos;s fixed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1384505</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-12-22 11:47:15 -0800</bug_when>
    <thetext>(In reply to Cédric Bellegarde from comment #3)
&gt; Can you test above patch with trunk to confirm it&apos;s fixed?

Ah, you&apos;re thinking like me... that&apos;s almost exactly what I did to test yesterday. I used g_warning instead of printf (it&apos;s a bit more visible, and you don&apos;t need to write the \n), and I used __FUNCTION__ instead of writing out the function name in the printf... and I used w3school&apos;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&apos;ll never rearch create_web_view_cb. But when I Alt+click I see it print 8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1384514</commentid>
    <comment_count>5</comment_count>
    <who name="Cédric Bellegarde">cedric.bellegarde</who>
    <bug_when>2017-12-22 12:10:51 -0800</bug_when>
    <thetext>Ok, thanks, I would have tested my self but webkit 2.19 make gcc to segfault on ArchLinux :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1405150</commentid>
    <comment_count>6</comment_count>
    <who name="Cédric Bellegarde">cedric.bellegarde</who>
    <bug_when>2018-03-09 05:07:54 -0800</bug_when>
    <thetext>Not fixed by 2.19.92

&gt;when I Alt+click I see it print 8.

Mee too

Now do the same with the &quot;Try it&quot; button, I see 0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1513522</commentid>
    <comment_count>7</comment_count>
    <who name="Cédric Bellegarde">cedric.bellegarde</who>
    <bug_when>2019-03-07 09:09:28 -0800</bug_when>
    <thetext>It is working with WebKitGTK 2.23.91!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>