title: Toggling chrome extension by clicking browser action
body: <p>I've read similar posts (<a href="https://stackoverflow.com/questions/18528009/how-to-toggle-actions-of-a-browser-action">This one seems to be what every similar topic links to</a>) and I'm not entirely sure how to implement the functionality where a second click on a browser action will close the popup rather than just re-load it. I attempted to implement similar to what the linked stackoverflow post introduced without success. </p>
  
  <p>From my understanding, we need to be using browseraction.onClicked listeners. Can this be achieved by using conditionals and window.close(), perhaps?</p>
  
  <p>Any assistance would be greatly appreciated. </p>