I have a Chrome Extension (page action). The extension is loaded in developer mode (not from the store).
The extension is used in two sites, both of which URLs are in the manifest.
When I go to one of the sites, the page icon is enabled and when I click it, it runs fine.
When I go to the other site, the extension icon is also enabled but when I click on the extension, instead of running the action, the extension menu appears (as if I had right-clicked the icon instead of clicked it).
When I hover the page action icon, in both sites I get the text "Has access to this site".
Which are possible causes for this behavior?
答案 0 :(得分:0)
使用最新的Chrome更新的manifest.json处理肯定会发生某些变化。 (在我的情况下,为Windows上的“版本72.0.3626.96(正式版本)(64位)”。)我的扩展程序停止运行的方式与您所描述的类似。
我的问题的解决方案是删除我在“权限”部分中指定的特定url权限,然后将其替换为<all_urls>
。我尝试再次收紧它们,但是对我来说唯一有用的是https://*/*
。
我在多台装有旧版Chrome的计算机上对此进行了测试,它们具有相同的行为...在Chrome更新之前成功运行,之后没有响应。该图标显示正确,并显示“可以访问该站点”,但是我的背景页面拒绝运行。
祝你好运!希望这会有所帮助!