<?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>233420</bug_id>
          
          <creation_ts>2021-11-22 06:46:13 -0800</creation_ts>
          <short_desc>Window.location setter not adding new global history entry (session history works as expected)</short_desc>
          <delta_ts>2022-03-22 23:22:08 -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>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>https://lapcatsoftware.com/articles/history.html</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="Sam Sneddon [:gsnedders]">gsnedders</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>opendarwin</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1817280</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-11-22 06:46:13 -0800</bug_when>
    <thetext>&lt;div&gt;
&lt;button id=&quot;mybutton1&quot; type=&quot;button&quot;&gt;
Change location
&lt;/button&gt;
&lt;/div&gt;

&lt;script&gt;
function MyClick1(event) {
  location = &quot;https://underpassapp.com&quot;;
}
document.getElementById(&quot;mybutton1&quot;)
.addEventListener(&quot;click&quot;, MyClick1);
&lt;/script&gt;

In Firefox and Chrome this creates a a new history item, in Safari this doesn&apos;t.

Perhaps https://wpt.fyi/results/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load?label=master&amp;label=experimental&amp;product=chrome&amp;product=firefox&amp;product=safari&amp;aligned&amp;q=location-setter, but likely we have some WPT coverage for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1818195</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-11-29 06:47:26 -0800</bug_when>
    <thetext>&lt;rdar://problem/85814717&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1818474</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-11-29 14:21:48 -0800</bug_when>
    <thetext>I am unable to reproduce.

When I click the button, I see history.length increase by one and there is an option to go back in the Safari UI.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1818479</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-11-29 14:24:45 -0800</bug_when>
    <thetext>I see this was reported on macOS 10.13 High Sierra which is super old. I am on macOS 12.1 Monterey so this could be why I cannot reproduce.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1818687</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-11-30 04:23:14 -0800</bug_when>
    <thetext>(In reply to Chris Dumez from comment #3)
&gt; I see this was reported on macOS 10.13 High Sierra which is super old. I am
&gt; on macOS 12.1 Monterey so this could be why I cannot reproduce.

The post says &quot;This bug appears to be many years old: it occurs in the latest version 15.1, and it occurs in the oldest version that I could test, Safari 11 on macOS 10.13 High Sierra.&quot;

Certainly I can reproduce it on 12.0.1 (21A559), but I don&apos;t have 12.1 immediately to hand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1819234</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-12-01 07:48:40 -0800</bug_when>
    <thetext>*** Bug 233685 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1854061</commentid>
    <comment_count>6</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2022-03-22 23:19:35 -0700</bug_when>
    <thetext>Chris I think you were testing the wrong thing.

This is about browser global history, not session history.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1854062</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2022-03-22 23:20:22 -0700</bug_when>
    <thetext>This blog post that spawned the radar mentioned that, not sure why that wasn’t included in the report 

https://lapcatsoftware.com/articles/history.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1854063</commentid>
    <comment_count>8</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2022-03-22 23:22:08 -0700</bug_when>
    <thetext>And on that note, this may be WebKit not sending a sensible history delegate message to Safari, or it might be Safari mishandling it. Investigation will be needed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>