Closed zipper closed 8 years ago
+1 I have same issue and it can be pretty frustrating sometimes since i use safari as my main browser, sometimes it is hard to debug because i usually forget about this issue and wonder what is wrong etc. when dynamic elements are used inside of snippets and those are removed instantly, because snippets redraws instantly after page refresh.
As known, Safari triggers
popstate
event onwindow
after page has been loaded. Current detection ofinitialPop
(popstate not caused by history manipulation - back/forward button) works fine only for the first page load and traversing using links. But when the current page is refreshed, theinitialPop
is not recognized and its value here is false.Because of that,
updateSnippets
function is called (viahandleUI
from history extension) after refresh and some JS could break as the DOM changes (attached events are lost for instance). This happens only in Safari (specifically tested Safari 8.0.4 on OS X Yosemite, but the bug could be reproduced on El Capitan aswell) as no other browser triggerspopstate
on page load.