【发布时间】:2018-01-12 05:29:35
【问题描述】:
我正在尝试重新加载用户可能已从弹出窗口(特别是 popup.js)的其中一个选项卡中打开的页面。我正在查看这个答案,但它仅适用于当前标签 https://stackoverflow.com/a/25246060/8786209。
当它运行时我得到这个错误:
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"
],
在我的清单中,仍然没有运气。我如何能够为用户打开的特定选项卡执行此操作。我希望它在第一次加载扩展程序时重新加载网站,这样用户就不必手动重新加载网页以使内容脚本生效。谢谢!
【问题讨论】:
标签: javascript google-chrome-extension