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

查看:22
本文介绍了有没有办法让 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天全站免登陆