代码之家  ›  专栏  ›  技术社区  ›  vwos

匹配意外模式的内容脚本

  •  0
  • vwos  · 技术社区  · 7 年前

    我有一个内容脚本,我只希望它匹配 https://fantasy.premierleague.com/a/team/my 所以我在我的 manifest.json

    "content_scripts": [
      {
        "matches": ["*://fantasy.premierleague.com/a/team/my"],
        "js": ["myTeam.bundle.js"],
        "run_at": "document_idle"
      }
    ],
    

    然而,它仍然是匹配的页面 https://fantasy.premierleague.com/a/home 和 https://fantasy.premierleague.com/a/team/123456/event/12 . 为什么会这样?

    即使添加了以下内容

    "exclude_matches": ["https://fantasy.premierleague.com/a/home"],
    

    它仍然在那个页面上执行!

    0 回复  |  直到 7 年前