【问题标题】:Why can I not put a certain URL in a Chrome Extension JSON?为什么我不能将某个 URL 放入 Chrome 扩展 JSON 中?
【发布时间】:2021-04-11 21:23:43
【问题描述】:

我正在尝试编写 Chrome 扩展程序,但我收到与 URL 相关的错误。

代码:

{
  "name": "Axqua's Themes for V3rmillion",
  "version": "1.0",
  "manifest_version": 2,
  "content_scripts": [
    {
      "matches": ["https://v3rmillion.net]",
      "js":  ["content.js"]
    }
  ]
}

错误:

Required value 'content_scripts[0].matches' is missing or invalid.

但是,当我输入<all_urls> 时,它可以完美运行。

【问题讨论】:

    标签: javascript json google-chrome google-chrome-extension


    【解决方案1】:

    我认为您必须使用https://*.v3rmillion.net/* 而不仅仅是链接。

    Chrome Dev Docs for Ref

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-05
      • 1970-01-01
      • 2019-03-07
      • 2021-05-06
      • 2011-01-11
      相关资源
      最近更新 更多