将Github和GHE与Webextensions匹配模式匹配

时间:2017-09-22 12:25:58

标签: google-chrome-extension firefox-webextensions

我尝试编写仅在*://github.com/notifications*://github.*.com/notifications上运行的扩展程序(以涵盖Github Enterprise URL)。不幸的是,第二种匹配模式是the firefox docsthe google docs中的无效匹配模式之一,请参见图片:

Invalid match patterns

这可能意味着我必须使用*://*/notifications代替,然后在应用中过滤它,这看起来很痛苦,因为这意味着我必须使用比我更广泛的范围。需要。

所以我的问题是,是否有一种简单的方法来匹配我错过的这些网址?是否有理由禁止这场比赛?

App有here以防万一。

1 个答案:

答案 0 :(得分:0)

好的,使用评论

中建议的include_globs选项修复它
  "content_scripts": [
    {
      "matches": [
        "*://*/*"
      ],
      "include_globs": [
        "*://*github*notifications*"
      ],
      "js": [
        "browser-polyfill.js",
        "button.js"
      ]
    }
]

你似乎很奇怪你被迫做这个更一般的比赛,然后用include_globs过滤掉,但也许这清楚表明你实际上匹配任何一个域。