作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
list .json
{
"manifest_version": 2,
"name": "Test iframe",
"version": "1.0",
"content_scripts": [ {
"all_frames": true,
"js": [ "script.js" ],
"match_about_blank": true,
"matches": [ "\u003Call_urls>" ],
"run_at": "document_start"
} ],
"permissions": ["\u003Call_urls>"]
}
脚本.js
var s = document.createElement("script");
var str='console.log(1);';
s.type = "text/javascript";
s.text = str, document.documentElement.insertBefore(s, null);
测试:jsbin.com
错误:阻止“about:blank”中的脚本执行,因为文档的框架已沙箱化且未设置“allow-scripts”权限。
如何访问沙箱 iframe?
chrome.exe --disable-web-security -不工作。
最佳答案
您必须在 iframe 的沙箱属性中添加“允许脚本”
关于javascript - iframe 中的 chrome 扩展允许同源被阻止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34107118/
我的 coinbase 支付按钮不会显示。我从 coinbase 收到此错误消息: 拒绝显示' https://coinbase.com/transactions ' 在框架中,因为它将 'X-Fra
我有一个 Web 应用程序,它作为托管在单个父窗口中的多个 iframe 运行(基本上是修改后的 GWT)http://en.wikipedia.org/wiki/Google_Web_Toolkit
CORS 表示: A web application executes a cross-origin HTTP request when it requests a resource that has
假设我有一个 CPU 密集型 iframe。 它与父页面在同一个域中,因此不适用跨域,因此它共享父页面的事件循环。 是否可以为 iframe 提供一个单独的 JS 上下文(包括一个单独的事件循环),这
我是一名优秀的程序员,十分优秀!