title: Chrome Extension Onclick() with Popup
body: <p>I want to clean my notification (badge). When click onto the icon a popup should be opened at the same time, but it doesn't work. </p>
  
  <p>It works with tab but I don't want to show on tab it should be on popup.</p>
  
  <p>Here is the code;</p>
  
  <pre><code>var i = 1;
  
  function updateIcon() {
      i=1;
      chrome.browserAction.setBadgeText({text: ''});  
      chrome.browserAction.setPopup({popup:"popup.html"});
  }
  
  chrome.browserAction.onClicked.addListener(updateIcon);
  chrome.browserAction.setBadgeBackgroundColor({color:[200, 0, 0, 100]});
  
  window.setInterval(function() {
    chrome.browserAction.setBadgeText({text:String(i)});
    i++;
  }, 4000);
  </code></pre>