How can I ignore [removed] on page load?

前端 未结 4 1066
一个人的身影
一个人的身影 2020-12-04 23:52

I\'m playing with window.onpopstate, and there is a thing that annoys me a little bit:

Browsers tend to handle the popstate event differe

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 00:40

    It seems none of the browsers are emitting the event on page load any more as of today:

    Browsers used to handle the popstate event differently on page load, but now they behave the same. Firefox never emitted a popstate event on page load. Chrome did until version 34, while Safari did until version 10.0.

    Source: https://developer.mozilla.org/en-US/docs/Web/API/PopStateEvent

提交回复
热议问题