iframe父级的document.referrer

| 我有一个页面-page1.html,其中包含带有url(src)iframepage.html的iframe。当我点击iframepage上的链接时,我会转到其他网站-page2.html。如果我在page2.html上调用document.referrer,则具有iframepage网址。根据document.reffer定义,这是正确的-这是打开当前文档的文档,但是: 有没有办法在page2.html和page1.html上作为document.referrer获得? 从page2.html,我必须知道从哪个浏览器URL打开了page2.html。 谢谢     
已邀请:
在page2.html中,您可以在JavaScript中选中“ 0”以返回包含“ 1”的父级的URL。     
在Google Chrome浏览器中,您可以使用:
window.location.ancestorOrigins;
这将返回iframe外部页面的父窗口URL。 但是,不幸的是,这在Firefox或IE中是不可能的,您可以获得的最好的结果 在这些中
document.referrer
。     

要回复问题请先登录注册