可能阻止我们的网站在另一个域的框架集或IFrame中运行? [英] Possible to prevent our website from running inside another domain's frameset or IFrame?
问题描述
是否有通用的方式(通过每个页面上出现的JavaScript?),以防止发生这种情况?请注意,将目标添加到所有链接是不可行的,但是将JS代码片段添加到所有页面都是,因为页眉和页脚部分是从单个源共享的。
另一个可能性是在Apache级别(如果有什么我们可以做服务器端),因为我们通过mod-rewrite传递所有请求。
请注意,如果父页面来自我们的域,则允许页面加载到IFrame内,因为我们有效使用IFrames
您可以使用javascript进行拼写检查。我相信这仍然适用于iFrame。
http://www.quirksmode.org/js/framebust.html
We've been having an problem recently where other sites are running our e-commerce site inside a frameset where our site (with the offenders affiliate id tacked on) is the only content in a single full width frame. So essentially it looks and feels like our site with their URL at the top. We can cut off their affiliate id, which would make it pointless for them to do, but this doesn't prevent future offenders from doing the same thing until we find out about it.
Is there a generic way (through JavaScript that appears on every page perhaps?) to prevent this from happening? Note that adding targets to to all links is not feasible, but adding a snippet of JS to all pages is, since the header and footer portions are shared sitewide from a single source.
Another possibility would be at the Apache level (if there is anything we could do server side) as we do pass all requests through mod-rewrite.
Note that it would be essential to sill allow pages to load inside an IFrame if the parent page originates from our domain, as we make valid use of IFrames
You can use javascript to do framebusting. I believe this still works for an iFrame.
http://www.quirksmode.org/js/framebust.html
这篇关于可能阻止我们的网站在另一个域的框架集或IFrame中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!