title: How to allow an extension for two domains only?
body: <p>I've written a google chrome extension. It's okay and works now but I want the extension to be usebale only on two domains because it's written for these two websites only and is useless for others. There is a <code>context menu</code> only. For now it hasn't even popup, or action button in the top right corner (hidden by default). How can achieve this? </p>
  
  <p>My current <strong>manifest.json</strong>:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
    "manifest_version": 2,
    "background": {
      "scripts": ["scripts/jquery.min.js", "scripts/background.js"]
    },
    "name": "Export Entries",
    "description": "some descriptions here",
    "version": "1.0",
  
    "icons": {
      "16": "images/logo.png",
      "48": "images/logo.png",
      "128": "images/logo.png"
    },
    "permissions": ["downloads", "tabs", "contextMenus", "http://my-own-domain-accessed-via-ajax-for-creating-some-files-there.com/*"],
    "content_scripts": [{
      "matches": ["*://allowed-domain1.com/*", "*://allowed-domain2.com/*"],
      "css": ["styles/style.css"],
      "js": ["scripts/jquery.min.js", "scripts/popup.js", "scripts/background.js"],
      "run_at": "document_end"
    }],
    "web_accessible_resources": [
      "images/logo.png"
    ]
  }
  </code></pre>
  
  <p>As I understand the extension cannot be disabled absolutely, its process will run in background again. But it's not a problem. I just want to not display the context menu item on other websites. </p>
  
  <p><strong>background.js</strong> creates the context menu item and handles its click event: </p>
  
  <pre class="lang-js prettyprint-override"><code>function exportEntries(info, tab) {
    if (info['linkUrl'].indexOf('domain1.com/user/') &gt; -1) {
      var user = info['linkUrl'].substr('27');
    } else {
      var user = null; // export all entries from this topic
    }
  
    $.ajax({
      url: 'http://my-own-domain-which-creates-the-file.eu/exportEntries/create.php',
      method: 'POST',
      data: {
        topic: tab.url,
        user: user
      }
    }).done(function(url) {
      forceDownload(url);
    });
  }
  
  function forceDownload(url) {
    var filename = url.replace(/^.*\/|\.[^.]*$/g, '');
  
    chrome.downloads.download({
        url: url,
        saveAs: true
      }, // options array
      function(id) {
        // callback function
      }
    );
  };
  
  document.addEventListener('DOMContentLoaded', function() {
    chrome.contextMenus.create({
      'title': 'Export Entries',
      'contexts': ['link'],
      'onclick': function(info, tab) {
        exportEntries(info, tab);
      }
    });
  });
  </code></pre>
  
  <p><strong>create.php</strong> is on my own domain. It just gets the current page's URL and the user's nickname. Then export all entries from the given topic (i.e. page URL) for the given user, creates a file (.txt, .pdf etc.) and sends back url for downloading the file. </p>
  
  <p><strong>popup.html</strong>, <strong>popup.js</strong>, <strong>css file</strong> and other stuff is not used for now. </p>