Chrome扩展程序,在iframe中运行“ devtools.inspectedWindow.eval”吗?

时间:2020-04-11 14:09:39

标签: google-chrome-extension

我正在编写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' },
)

0 个答案:

没有答案