我正在尝试从弹出窗口(特别是popup.js)重新加载用户可能在其中一个标签页中打开的页面。我看了这个答案,但它只适用于当前选项卡 https://dev59.com/Qmsy5IYBdhLWcg3wvgr7#25246060。
此外,当它运行时,我会收到以下错误:
此外,当它运行时,我会收到以下错误:
popup.html:1 Unchecked runtime.lastError while running tabs.executeScript: Cannot access contents of url "thewebpageiamtryingtoaccess.com".
Extension manifest must request permission to access this host at Object.callback (chrome-extension://mjckbfpnokoplldjpijdfhffbbbfflah/popup.js:3:17)
我已经添加了
"permissions": [
"tabs"
],
在我的清单中,仍然没有运气。我如何能够为用户打开的特定选项卡执行此操作。我希望在第一次加载扩展程序时重新加载网站,以便用户无需手动重新加载网页即可使内容脚本生效。谢谢!