You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Chrome扩展Manifest中content_script排除匹配失效问题求助

Fixing Chrome Extension Content Script Exclusion for Pipedrive Subdomains

I’ve run into this exact matching rule quirk with Chrome extensions before, so let’s break down why your current setup isn’t working and how to fix it.

First, here’s your original configuration snippet for reference:

{ 
  "matches": [ "*://*.pipedrive.com/*" ], 
  "exclude_globs": [ "://www.pipedrive.com/*" ], 
  "css": [ "content/callbox.css", "content/pipedrive/pipedrive.css" ], 
  "js": [ "assets/js/jssip-2.0.6.min.js", "content/message.js", "content/callbox.js", "content/pipedrive/pipedrive.js" ] 
}

Why Your Exclusions Aren’t Taking Effect

  1. Invalid exclude_globs syntax: The pattern you used (://www.pipedrive.com/*) is missing a leading wildcard *, which Chrome requires to recognize it as a valid URL glob. Without that leading *, the browser can’t map the pattern to full URLs.
  2. exclude_matches is more reliable for domain exclusions: While exclude_globs works for string-based URL matching, exclude_matches uses the same pattern syntax as your matches field. This makes it more predictable and higher-priority for domain-specific exclusions like yours.

The Working Fixes

Option 1: Use exclude_matches (Recommended)

Replace your exclude_globs line with a properly formatted exclude_matches entry. This will explicitly exclude all paths on www.pipedrive.com while keeping your subdomain matches intact:

{ 
  "matches": [ "*://*.pipedrive.com/*" ], 
  "exclude_matches": [ "*://www.pipedrive.com/*" ], 
  "css": [ "content/callbox.css", "content/pipedrive/pipedrive.css" ], 
  "js": [ "assets/js/jssip-2.0.6.min.js", "content/message.js", "content/callbox.js", "content/pipedrive/pipedrive.js" ] 
}

Option 2: Fix the exclude_globs Syntax

If you prefer to stick with exclude_globs, just add the leading wildcard to your pattern:

{ 
  "matches": [ "*://*.pipedrive.com/*" ], 
  "exclude_globs": [ "*://www.pipedrive.com/*" ], 
  "css": [ "content/callbox.css", "content/pipedrive/pipedrive.css" ], 
  "js": [ "assets/js/jssip-2.0.6.min.js", "content/message.js", "content/callbox.js", "content/pipedrive/pipedrive.js" ] 
}

Quick Troubleshooting Tips

  • Reload your extension: After updating the manifest, head to chrome://extensions/, enable developer mode, and click the reload button for your extension to apply the new rules.
  • Clear site cache: Old cached content can sometimes interfere with new matching rules—clear your browser cache for Pipedrive sites to avoid conflicts.
  • Check for conflicting rules: Make sure there aren’t other content script blocks in your manifest that might be targeting www.pipedrive.com directly.

内容的提问来源于stack exchange,提问作者necroface

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:58:36