Closed zipper closed 3 weeks ago
Huh, TIL WebKit/Safari still uses the title argument in pushState and will continue to do so until the next version (https://bugs.webkit.org/show_bug.cgi?id=223190), so yep, it's broken in Safari as well, although differently 😅
When title element is used as a snippet, the history in the browser (long click on back button) doesn't work properly in Chrome and Firefox (and probably in Safari as well).
I believe this is caused by changing the title (as any other snippet) before the
pushState
is called. WhenpushState
is called, the browser uses the current title value in the history.This was also an issue in
history.nette.ajax.js
andnette.ajax.js
libraries (see https://github.com/vojtech-dobes/nette.ajax.js/issues/151). I have forked this library and solved the issue by changing the title only after thepushState
call. Below are links to respective commmits into those repositories for possible inspiration:There are also some related questions on SO: