title: How do I disable a chrome extension for certain sites?
body: <p>I have a chrome extension that uses browser actions, as I want it to run on all sites, bar 1 (matching ".pannus." which is an internal dev site).</p>
  
  <p>I can't work out how to achieve this, I have tried using the manifest and regex in PageStateMatcher.</p>
  
  <p>manifest.json</p>
  
  <pre><code>{
      "name": "...",
      "description": "...",
      "version": "0.0.2",
      "permissions": ["contextMenus", "declarativeContent"],
      "background": {
          "persistent": false,
          "scripts": ["background.js"]
      },
      "content_scripts": [{
          "matches": ["&lt;all_urls&gt;"],
          "js": ["content.js"],
          "css": [ "style.css" ]
      }],
      "browser_action": {
          "default_icon": {
              ...
          }
      }, 
      "icons": {
        ...
      },
      "manifest_version": 2
  }
  </code></pre>
  
  <p>If I add <code>"exclude_matches": ["*://*.pannus.*"],</code> here, I get an error:</p>
  
  <p><code>Invalid value for 'content_scripts[0].exclude_matches[0]': Empty path.</code></p>
  
  <p>I have also tried:</p>
  
  <pre><code>chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
          chrome.declarativeContent.onPageChanged.addRules([{
              conditions: [
                  new chrome.declarativeContent.PageStateMatcher({
                      pageUrl: { 
                          schemes: ['https', 'http'],
                          urlMatches: '^((?!.pannus.).)*$'
                      },
                  })
              ],
              actions: [new chrome.declarativeContent.ShowPageAction()]
          }]);
      });
  </code></pre>
  
  <p>But I get the error:</p>
  
  <p><code>Could not parse regular expression '^((?!.pannus.).)*$': invalid perl operator: (?!</code></p>
  
  <p>What is the best way to disable my chrome extension on certain sites? Or, failing that, not inject the extensions content script into the excluded hosts?</p>