有没有办法让内容从IFRAME溢出到父框架? [英] Is there a way to have content from an IFRAME overflow onto the parent frame?

查看:305
本文介绍了有没有办法让内容从IFRAME溢出到父框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于性能原因,我有一个UI小部件需要放在IFRAME中,因此我们可以轻松地将其整合到联属网站。小部件的UI包括显示在其他页面内容顶部的工具提示。请参阅下面的屏幕截图或 访问网站 以查看其实际效果。是否有任何方法可以让IFRAME中的内容与父框架的内容重叠?

I have a UI widget that needs to be put in an IFRAME both for performance reasons and so we can syndicate it out to affiliate sites easily. The UI for the widget includes tool-tips that display over the top of other page content. See screenshot below or go to the site to see it in action. Is there any way to make content from within the IFRAME overlap the parent frame's content?

推荐答案

忽略任何历史原因,现在它将被认为是一个安全漏洞 - 例如。许多网站将不受信任的内容放入iframe中(iframe来源是不同的来源,因此不能根据相同的来源政策修改父框架)。

No it's not possible. Ignoring any historical reasons, nowadays it would be considered a security vulnerability -- eg. many sites put untrusted content into iframes (the iframe source being a different origin so cannot modify the parent frame, per the same origin policy).

机制将内容放置在iframe的边界之外,它可以(例如)在父框架的真实登录字段上放置相同的登录div(或其他),并且因此可能窃取用户名/密码信息。这会吸。

If such untrusted content had a mechanism to place content outside of the bounds of the iframe it could (for example) place an "identical" login div (or whatever) over a parent frame's real login fields, and could thus steal username/password information. Which would suck.

这篇关于有没有办法让内容从IFRAME溢出到父框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆