title: Detect if a Chrome extension is installed by users
body: <p>I tried all solutions in this question</p>
  
  <p><a href="https://stackoverflow.com/questions/6293498/check-whether-user-has-a-chrome-extension-installed">Check whether user has a Chrome extension installed
  </a></p>
  
  <p>what I  did:</p>
  
  <p>1-  I added background js file and in manifest  I added the following </p>
  
  <pre><code> "background": {
         "scripts": ["js/background.js"],
         "persistent": true
     },
  
     "permissions": [ "https://*.mydomain.com/*" ],
  </code></pre>
  
  <p>in background.js I added </p>
  
  <pre><code>chrome.runtime.onMessageExternal.addListener(function(msg, sender, sendResponse) {
      if ((msg.action == "id") &amp;&amp; (msg.value == id))
      {
          sendResponse({id : id});
      }
  });
  </code></pre>
  
  <p>and in my website I added this code</p>
  
  <pre><code>&lt;script&gt;
      var id = "madbfblbpcoiddlankhkdbagjeemnlof";
      chrome.runtime.sendMessage(id, {action: "id", value : id}, function(response) {
          if(response &amp;&amp; (response.id == id)) //extension installed
          {
              console.log(response);
          }
          else //extension not installed
          {
              console.log("Please consider installig extension");
          }
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>and I always get Please consider installig extension</p>
  
  <p>How can I fix this issue ??</p>