我正在编写Chrome扩展程序,因此需要在主页上的iframe中运行devtools.inspectedWindow.eval()
。
我正在devtools_page
上运行此命令
清单中有以下内容,但评估仅在首页上执行。
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["dist/content/index.js"],
"all_frames": true
}
]
即使使用frameURL
属性的变体似乎也不起作用
chrome.devtools.inspectedWindow.eval(
'console.log(window.location.href)',
{ frameURL: '*' },
)
chrome.devtools.inspectedWindow.eval(
'console.log(window.location.href)',
{ frameURL: 'https://myiframe.com' },
)