权限“”未知或 URL 模式格式错误

2024-03-09

我是扩展开发的新手
我尝试过使用权限 url 作为"<all_urls> "*" "http://*/*", "https://*/*"没有一个模式有效

完整清单:

{
  "name": "Info",
  "description": "BS System Info",
  "version": "1.0",
  "manifest_version": 3,
  "background": {
    "service_worker": "background.js"
  },
  "content_scripts": [{
    "js": ["script.js"],
    "matches": ["http://*/*","https://*/*","<all_urls>"],
    "css" : []
}],
  "permissions": [
    "storage",
    "activeTab",
    "system.cpu",
    "system.memory",
    "system.storage",
    "system.display",
    "tabs",
    "scripting",
    "http://*/*", "https://*/*", "chrome-devtools://*/*"
],
  "action": {
    "default_popup": "index.html",
    "default_icon": {
        "16": "/images/icon_16.png",
        "32": "/images/icon_32.png",
        "48": "/images/icon_48.png",
        "128":"/images/icon_128.png"
      }
  }
}

ManifestV3 中的站点/URL 权限使用单独的密钥:host_permissions

  "host_permissions": [
    "*://*.example.org/"
  ],
  "permissions": [
    "storage"
  ],

更多信息在官方迁移指南 https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration,一定要研究一下。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

权限“”未知或 URL 模式格式错误 的相关文章

随机推荐