显示其他网站的内容并跟踪 URL
在我的 JSF 页面上,我尝试在 iframe 中显示其他一些网站并显示其 URL。我现在明白,出于安全原因,我只能访问显示我域的某些站点的 iframe 的 URL。所以,我在互联网上多次发现这个问题,但找不到任何解决方案。我不想读取 iframe 的内容,而只想读取 URL。
对于这个需求有什么解决方案吗?使用 iframe 的替代品?框架集,浏览器中的浏览器?弹出窗口?
On my JSF page I am trying to show some other website in an iframe and show its URL. I understand now that for security reasons I can only access the URL of the iframe if it is showing some site of my domain. So, I've found that problem a lot of times in the internet, but I couldn't find any solution. I don't want to read the content of the iframe, but only the URL.
Is there any solution for this requirement? Using an alternative to iframes? Frameset, browser in browser? Popup?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想坚持使用 iframe 选项,我会测试一下 iframe 的 insidehtml 是否与它们要访问的网站相匹配。 webkit 中的 insidehtml 似乎确实随着用户浏览而改变。
我能想到的唯一替代方案是 http 代理网站,更改链接以引用您的代理,然后告诉他们当请求的代理 URL 与目标 URL 匹配时他们获胜。
If you want to stick to the iframe option, I would test to see if the innerhtml of the iframe matches that of the website they are meant to reach. The innerhtml in webkit does seem to change as the user browses.
The only alternative I can think of is http proxying the web sites, changing the links to refer to your proxy, then telling them they win when the requested proxy URL matches that of the destination.