title: my chrome extension popup opens after a few seconds, it's slow compared to other extensions
body: <p>When we click on the <code>extension button</code>, listed beside the address bar (where the URL appears), <code>popup.html</code> of the corresponding extension shows up. (of course, according to <code>manifest.json</code>)</p>
  
  <p>When I click on lastPass, the popup appears instantly, but when I click on my custom-extension (contains nothing but popup.html), the mouse icon changes to loading for 1-2 seconds &amp; then the popup opens up.</p>
  
  <p>Did some digging on why my popup is so slow, the google-groups had something like </p>
  
  <pre><code>window.load=setTimeout(activate,0);
  </code></pre>
  
  <p>Unable to find any related documentation, or working sample.</p>
  
  <p>Please help in figuring out why my extension popup is so slow, though the code contains nothing just the popup (beginner in chrome-extensions development).</p>
  
  <h2><strong>Update</strong></h2>
  
  <p><strong>manifest.json</strong></p>
  
  <pre><code>{
    "manifest_version": 2,
  
    "name": "Sample Name",
    "description": "Sample Descriptoin",
    "version": "1.0",
  
    "browser_action": {
      "default_icon": "icon.png",
      "default_popup": "popup.html"
    },
    "permissions": [
      "&lt;all_urls&gt;"
    ]
  }
  </code></pre>
  
  <p><strong>popup.html</strong></p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
      &lt;head&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div&gt;
              &lt;label&gt;Enter HR Password&lt;/label&gt;
              &lt;input type='password' id='passwd'/&gt;
              &lt;button id='evaluateResults'&gt;Evaluate&lt;/button&gt;
              &lt;ul id='results' style='width:100px;'&gt;
  
              &lt;/ul&gt;
          &lt;/div&gt;
          &lt;script src='popup.js'&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>popup.js</strong></p>
  
  <pre><code>var totalCorrect=0, totalWrong=0;
  
  document.getElementById('evaluateResults').addEventListener('click',function(){
      var passwd=document.getElementById('passwd').value;
      if(passwd==='123'){     
          var strCode="var scriptOptions = {role:'blank'};";
          chrome.tabs.executeScript(null, {code: strCode,allFrames:true}, function(){
              chrome.tabs.executeScript(null, {file: "content_script_evaluate.js",allFrames:true});       
          });
      }else{
          alert("Incorrect Password");
      }
  });
  
  chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
      console.log(request);
      var ul=document.getElementById('results');
      var li=document.createElement('li');
      li.innerHTML=request.testName+" - "+(request.testResult?"Correct":"Wrong");
      ul.appendChild(li);
  });
  </code></pre>