<?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>257849</bug_id>
          
          <creation_ts>2023-06-08 02:47:02 -0700</creation_ts>
          <short_desc>Inconsistent firing of onBeforeNavigate event in webNavigation API in Safari</short_desc>
          <delta_ts>2023-06-15 02:47:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Extensions</component>
          <version>Safari 16</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 13</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=249514</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mykola">mykola.batashov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bweinstein</cc>
    
    <cc>karlcow</cc>
    
    <cc>mykola.batashov</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1960519</commentid>
    <comment_count>0</comment_count>
    <who name="Mykola">mykola.batashov</who>
    <bug_when>2023-06-08 02:47:02 -0700</bug_when>
    <thetext>The webNavigation API in Safari exhibits inconsistent behavior in firing the onBeforeNavigate event compared to Chrome.

Steps to Reproduce:
1. Navigate from a website using a URL (the onBeforeNavigate event fires correctly).
2. Open a URL in a new tab (via context menu or command) (the onBeforeNavigate event fires correctly).
3. Open a URL in a new window (via context menu) (the onBeforeNavigate event fires correctly).
4. Manually enter a URL in the search field (it does not fire the onBeforeNavigate event, unlike Chrome).

Expected Behavior:
The onBeforeNavigate event should consistently fire in all navigation scenarios, including manually entering a URL in the search field.

Actual Behavior:
In Safari, the onBeforeNavigate event does not fire when manually entering a URL in the search field.

Additional Details:
Safari version: 16.5 (18615.2.9.11.4)
macOS version: 13.4 (22F66)

Please consider the provided information to address the inconsistency in the firing of the onBeforeNavigate event in Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1961173</commentid>
    <comment_count>1</comment_count>
    <who name="Brian Weinstein">bweinstein</who>
    <bug_when>2023-06-12 16:13:39 -0700</bug_when>
    <thetext>Do you have &quot;Preload Top Hit in Background&quot; checked in your Safari Search Settings?

If you have that checked, we defer firing those onBeforeNavigate events. Can you try turning that off and seeing if the bug still reproduces?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1961541</commentid>
    <comment_count>2</comment_count>
    <who name="Mykola">mykola.batashov</who>
    <bug_when>2023-06-14 05:08:28 -0700</bug_when>
    <thetext>(In reply to Brian Weinstein from comment #1)
&gt; Do you have &quot;Preload Top Hit in Background&quot; checked in your Safari Search
&gt; Settings?
&gt; 
&gt; If you have that checked, we defer firing those onBeforeNavigate events. Can
&gt; you try turning that off and seeing if the bug still reproduces?

Yes, &quot;Preload Top Hit in Background&quot; was enabled by default.
I turned it off, but unfortunately, the situation didn&apos;t change for me. 
I still have the issue that Safari does not fire the onBeforeNavigate event.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1961756</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-06-15 02:47:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/110828492&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>