[Webkit-unassigned] [Bug 248303] REGRESSION (iOS 16): popstate events are not fired for swipe-back gesture

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 3 09:38:21 PST 2023


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

--- Comment #6 from Chris Dumez <cdumez at apple.com> ---
Oh, I just looked at the test case more closely and I understand what is happening now.

Similarly to Chrome, WebKit recently did some security hardening to prevent bad JavaScript from hijacking the back/forward list. This means that history entries added by JS (e.g. via history.pushState()) get skipped on user navigation unless they were added with a user interaction.

In your test case, test2.html calls history.pushState() without a user interaction. As a result, the created history item gets marked with a special flag. If the user swipes back or presses the back button, we will skip this "dummy" history item, and thus not fire a popstate event. This is new intentional behavior, which should be consistent with Blink.

If you do not want your history item to get skipped, then you need a user gesture / activation when calling history.pushState() (e.g. calling history.pushState() as a result of a button getting clicked by the user).

-- 
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/20230103/3d0eeac2/attachment-0001.htm>


More information about the webkit-unassigned mailing list