检测我的网站的 iframe 位置
我知道 iframe 页面可以告诉他们是,但是可以告诉我在哪里吗?据我所知,当父级是不同的域时,parent.location
会遇到安全问题。有什么解决方法吗?
I know that iframed pages can tell that they are, but is it possible to tell where? parent.location
runs into security issues when parent is a different domain, as far as I can tell. Any work arounds?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我还没有测试过,但你应该能够做类似的事情:
I haven’t tested, but you should be able to do something like:
不,如果父窗口不在同一域中,则无法访问父窗口。
No you can't access the parent window if its not on the same domain.
它不会作为引荐来源网址显示在您的服务器日志中吗?我知道这不是一种编程方式,但我想知道您是否只是想追踪窃取您内容的人。
Wouldn't it show up in your server logs as the referrer? I know that's not a programmatic way, but i'm wondering if you're just trying to track down people stealing your content.
如果你想付出努力,你可以编写一个插件(适用于所有浏览器)或 active x(适用于 ie)来确定这一点,因为它们不会像 javascript 等那样被阻止访问客户端计算机。
If you wanted to put the effort in, you could write a plugin(for all browsers) or active x(for ie) to determine this as they are not blocked from accessing the clients computer as much as javascript ect.