bsm*_*bsm 13 html iframe firefox
以下是我的代码:
<div style="border: solid 1px #000000; margin: 5px;">
<iframe src="http://www.w3schools.com" width="100%" height="300px" scrolling="yes"><p>Your browser does not support iframe.</p></iframe>
</div>
Run Code Online (Sandbox Code Playgroud)
iframe的内容在chrome中运行良好,但在firefox中运行不正常.我已禁用加载项,但我的iframe仍为空.谁能帮帮我吗?
小智 15
如果您尝试在SSL加密的网站(https://)上添加此Iframe,则自Firefox 23以来它将不再起作用,因为Mozilla已决定阻止加密网站上的所有未加密内容(例如http-iframes on HTTPS的网站).您可以通过about:config在地址栏中输入并设置security.mixed_content.block_active_content为,在您自己的Firefox安装中更改此行为false.但这对您网站上所有其他FF23访问者没有帮助.
自05/2018起,由于X-Frame-Options标头设置为“ sameorigin”,iframe线索被浏览器拒绝。
使用Firefox测试了该页面,并获得了空白的iframe。控制台说的是:
Load denied by X-Frame-Options: https://www.w3schools.com/ does not permit cross-origin framing.
Run Code Online (Sandbox Code Playgroud)
为什么?我会给Chrome控制台一个机会,它的意思是:
Refused to display 'https://www.w3schools.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Run Code Online (Sandbox Code Playgroud)
基本上,将X-Frame-Options标头(不要与CORS混淆)设置为“ sameorigin”,这意味着仅当嵌入相同域和相同协议(https://时,才允许浏览器显示iframe内容。www.w3schools.com/与http://www.w3schools.com/的来源不同。
这是一些关于x-frame-options的文档:https : //developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
我不知道它是否相关,但是当我尝试通过 c# 请求 w3schools 时,它响应 503 禁止错误。因此,他们可能会使用某些东西来阻止出现在 iframe 等上。Facebook 也有类似的限制,除非您登录,否则您无法显示他们的 Likebox iframe。
| 归档时间: |
|
| 查看次数: |
49298 次 |
| 最近记录: |