Google chrome extension Chrome扩展无法将内容脚本注入动态生成的iFrame
我想访问某个页面上所有iFrame中的performance.getEntries(我的目标是深入了解横幅标记中的内容)。但是,我无法在动态生成的iFrame中注入内容脚本 我在下面的例子中做错了什么吗 或者是否有其他可能的途径来获取这些动态生成的帧的performance.getEntries 考虑这样一个非常简单的html:Google chrome extension Chrome扩展无法将内容脚本注入动态生成的iFrame,google-chrome-extension,Google Chrome Extension,我想访问某个页面上所有iFrame中的performance.getEntries(我的目标是深入了解横幅标记中的内容)。但是,我无法在动态生成的iFrame中注入内容脚本 我在下面的例子中做错了什么吗 或者是否有其他可能的途径来获取这些动态生成的帧的performance.getEntries 考虑这样一个非常简单的html: <html> <body> <script> var iframe = document.createElement('if
<html>
<body>
<script>
var iframe = document.createElement('iframe');
var html = '<body><img src="http://dummyimage.com/100x200/333/fff&text=hey_2_1"><img src="http://dummyimage.com/100x200/555/fff&text=hey_2_2"></body>';
iframe.src = 'data:text/html;charset=utf-8,' + encodeURI(html);
document.body.appendChild(iframe);
</script>
<img src="http://dummyimage.com/100x200/333/fff&text=hey_1_1">
<img src="http://dummyimage.com/100x200/333/fff&text=hey_1_2">
</body>
</html>
运行此扩展只会显示首页的性能条目,而不会显示动态iframe。如果有错误日志,能否提供错误日志?@systemaddit:every解决了此问题?在这里遇到同样的事情
{
"manifest_version": 2,
"name": "Banner Spy 1",
"description": "Check all iframes",
"version": "1.0",
"background": {
"scripts": ["background.js"]
},
"content_scripts": [
{
"run_at": "document_end",
"all_frames" : true,
"match_about_blank": true,
"matches": ["<all_urls>"],
"js": ["content_frame.js"]
}
],
"permissions": [
"tabs",
"activeTab",
"<all_urls>"
]
}
setTimeout(function(){
var pe = performance.getEntries();
console.log(pe);
}, 1000);