我正在为使用Page Action模型的Chrome和Firefox编写一个webextension。在manifest.json
我提供了网址匹配规则,以便它只显示在特定网址上。这在Firefox中运行良好,但图标在Chrome中始终处于非活动状态。这是我的Chrome manifest.json
,它与Firefox相同但没有firefox特定的aplications
属性。加载时网页的网址在Chrome中与在Firefox中完全相同。
{
"manifest_version": 2,
"name": "MyExtension",
"version": "0.1.1",
"description": "A description",
"permissions": [
"activeTab",
"storage"
],
"page_action": {
"default_title": "MyExtension",
"default_popup": "popup.html",
"default_icon": {
"16": "images/icon16.png",
"32": "images/icon32.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"show_matches": ["https://example.com/@*"],
"hide_matches": ["https://example.com/@*/*"]
}
}