title: chrome extension script is loading twice even more on some pages
body: <p>this is my background.js file </p>
  
  <pre><code> chrome.tabs.onUpdated.addListener(function(tabId,info, tab) {
      var sites =new Array('site2','site1');
      var url=tab.url;
      var siteFlag=0;
      for(var i in sites) {
         var regexp = new RegExp('.*' + sites[i] + '.*','i');
         if (regexp.test(url)) {siteFlag=1;}
      };
      if(siteFlag==1){
        chrome.tabs.executeScript(tabId, {file:"contentscript.js"});
        chrome.tabs.executeScript(tabId, {file:"jquery.js"});
        chrome.tabs.insertCSS(tabId,{file:"box.css"});
      }
   });
  </code></pre>
  
  <p>In the contentscript.js I simply run a popup box.</p>
  
  <pre><code>$(document).ready(function () {
      function popup() {...}
      if (window.addEventListener)
      {
          window.addEventListener('load', popup(), false); 
      } 
      else if (window.attachEvent)
      {
          window.attachEvent('onload', popup());
      }
  });
  </code></pre>
  
  <p>There are some pages that there are one popup-box and there are pages that two or even more </p>
  
  <p>what is the problem? </p>
  
  <p>=============EDIT==================</p>
  
  <p>those pages contain Iframes</p>