javascript-网站是历史上的第一项吗?
作者:互联网
如何确定站点是否是历史上的第一项?
由于安全原因,这不起作用:
if(window.history.item(0)==window.location.href)
解决方法:
For security reasons the History
object doesn’t allow the
non-privileged code to access the URLs
of other pages in the session history,
but it does allow it to navigate the
session history.
从:Mozilla Developer Center: window.history
标签:browser-history,javascript 来源: https://codeday.me/bug/20191024/1918281.html