开发者

Is site first item in history?

开发者 https://www.devze.com 2022-12-25 05:03 出处:网络
How to find out if site is the first item in history? This doesn\'t work because of security reasons: if(window.history.item(0)==window.locatio开发者_C百科n.href)

How to find out if site is the first item in history? This doesn't work because of security reasons:

if(window.history.item(0)==window.locatio开发者_C百科n.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.

From: Mozilla Developer Center: window.history


You cannot.

The users' browser history is private information and cannot be read using Javascript.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号