<?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>142151</bug_id>
          
          <creation_ts>2015-03-01 10:57:34 -0800</creation_ts>
          <short_desc>history.replaceState/location.replace incorrectly adds new entries to global history in Safari</short_desc>
          <delta_ts>2017-01-18 23:39:14 -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>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Jason Davies">jason.davies</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>beidson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1073171</commentid>
    <comment_count>0</comment_count>
    <who name="Jason Davies">jason.davies</who>
    <bug_when>2015-03-01 10:57:34 -0800</bug_when>
    <thetext>The purpose of history.replaceState is to *modify* the current history entry.  This works in the context of using the back button.

However, it always seems to add *new* history entries, in the context of the History menu item (and &quot;Show History&quot; page).

This causes a huge number of history entries for pages that update the URL frequently, e.g. zoom/pan of maps where the current zoom and position are encoded in the URL.

A good example of this in the wild is http://polymaps.org/ - e.g. http://polymaps.org/ex/midnight-commander.html - note that Polymaps actually uses location.replace internally with the same problem, though using history.replaceState doesn&apos;t fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1073175</commentid>
    <comment_count>1</comment_count>
    <who name="Jason Davies">jason.davies</who>
    <bug_when>2015-03-01 11:11:06 -0800</bug_when>
    <thetext>Interestingly, Chrome appears to have the same behaviour for history.replaceState (adding new entries to the history page) - but not for location.replace.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1073983</commentid>
    <comment_count>2</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2015-03-03 22:03:30 -0800</bug_when>
    <thetext>The specs declare when the browser engine has to do with the session history, which is what is represented by the back button. And WebKit handles that correctly.

I don&apos;t believe any spec defines what browsers have to do with their global history collections, as that&apos;s outside the scope of the engine.

So I think you&apos;re reporting a Safari bug, as Safari decides what entires to show in its history menu. And Safari is not WebKit.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>