<?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>151610</bug_id>
          
          <creation_ts>2015-11-25 13:07:30 -0800</creation_ts>
          <short_desc>pagehide doesn&apos;t fire when tab is closed</short_desc>
          <delta_ts>2022-07-05 14:10:35 -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>Page Loading</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=116769</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=151234</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=194897</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ilya Grigorik">igrigorik</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>hello</cc>
    
    <cc>mike</cc>
    
    <cc>philip</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1144447</commentid>
    <comment_count>0</comment_count>
    <who name="Ilya Grigorik">igrigorik</who>
    <bug_when>2015-11-25 13:07:30 -0800</bug_when>
    <thetext>pagehide event appears to fire when tab is navigated to a different URL, but does not fire when the tab is closed (regardless of whether the tab was in foreground or background state). I believe the pagehide event should fire in all cases and Safari appears to be the only browser with this behavior.

Test page: http://output.jsbin.com/zubiyid/latest/quiet</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1144529</commentid>
    <comment_count>1</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2015-11-26 09:21:01 -0800</bug_when>
    <thetext>I believe this is a known *Safari* bug, and is not a bug in WebKit.

Can you please try in Minibrowser using WK2 mode?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1144817</commentid>
    <comment_count>2</comment_count>
    <who name="Ilya Grigorik">igrigorik</who>
    <bug_when>2015-11-30 10:34:30 -0800</bug_when>
    <thetext>Do I need to build it on this end? Can&apos;t seem to find any easily accessible binaries for OSX.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1144837</commentid>
    <comment_count>3</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2015-11-30 11:03:34 -0800</bug_when>
    <thetext>Hmmmmm totally wrong about this being a Safari bug - It&apos;s just closely related to one.

We have this in Radar already: rdar://problem/16477268</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1598564</commentid>
    <comment_count>4</comment_count>
    <who name="Philip Walton">philip</who>
    <bug_when>2019-12-13 17:14:35 -0800</bug_when>
    <thetext>This bug appears to be fixed now. Can anyone confirm? Does anyone know what version it was fixed in?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1598566</commentid>
    <comment_count>5</comment_count>
    <who name="Philip Walton">philip</who>
    <bug_when>2019-12-13 17:24:06 -0800</bug_when>
    <thetext>For anyone else interested, based on the two versions of Safari I&apos;m able to test here:
- Version 12.1 (13607.1.40.1.5): Broken
- Version 13.0.4 (14608.4.9.1.4): Fixed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1691832</commentid>
    <comment_count>6</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2020-09-25 03:26:59 -0700</bug_when>
    <thetext>(In reply to Philip Walton from comment #4)
&gt; This bug appears to be fixed now. Can anyone confirm? Does anyone know what
&gt; version it was fixed in?
(In reply to Philip Walton from comment #5)
&gt; For anyone else interested, based on the two versions of Safari I&apos;m able to
&gt; test here:
&gt; - Version 12.1 (13607.1.40.1.5): Broken
&gt; - Version 13.0.4 (14608.4.9.1.4): Fixed

Can you clarify how you’re testing? Do we have a test for this in WPT? I tried http://wpt.live/page-visibility/unload.html in Safari Tech Preview 113 and Safari 14 and I get a TIMEOUT/NOTRUN failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1692202</commentid>
    <comment_count>7</comment_count>
    <who name="Philip Walton">philip</who>
    <bug_when>2020-09-26 11:53:25 -0700</bug_when>
    <thetext>You can test this manually using an event-logger page like this: https://event-logger.glitch.me</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>