[Webkit-unassigned] [Bug 182678] New: replaceState cause back/forward malfunction on html page with <base href="/"> tag

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 11 14:54:32 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=182678

            Bug ID: 182678
           Summary: replaceState cause back/forward malfunction on html
                    page with <base href="/"> tag
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: History
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: huocp at me.com

To reproduce the issue.

1. create an static index.html file with following content

<!doctype html>
<html>
<head>
<title>test</title>
<base href="/">
</head>
<body>
</body>

2. serve the file with same http server, for instance use nodejs http-server (npm install -g http-server)
3. use Safari to open the local site. (in Safari preference, turn on "Show full website address" in advanced tab)
4. in Safari dev console, do following line by line

history.pushState({}, "", "/one");     // browser shows url "/one", as expected.
history.replaceState({}, "");          // 3rd param is optional new url, we leave it out to not override it.
history.pushState({}, "", "/two");     // browser shows url "/two", as expected.
history.back();                        // browser shows url "" instead of "/one". This is the bug!

This bug only appears on webpage with `<base href="/some_base">` tag.
This bug appears on latest macOS Safari 11.0.3, latest iOS Safari 11, latest macOS Safari Technology Preview release 49.
I did not test on any older version of Safari.
As a reference, this bug doesn't affect Chrome or Firefox.

To bypass this bug, I need to feed current url back to replaceState.

history.replaceState({}, "", "/one");  // bypass the bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180211/ecf496b2/attachment.html>


More information about the webkit-unassigned mailing list