title: How to modify current url location in chrome via extensions
body: <p>I want to create an extension that redirects the user to another website if he clicks on the extension button. So far I have only seen extensions which create a new tab for each click.</p>
  
  <p>Is it possible to redirect the user to another website using the active tab?</p>
  
  <p>I tried something like this:</p>
  
  <pre><code>chrome.browserAction.onClicked.addListener(function(tab) {
      var url = "https://www.mipanga.com/Content/Submit?url="
          + encodeURIComponent(tab.url)
          + "&amp;title=" + encodeURIComponent(tab.title);
  
      document.location.href = url; // &lt;-- this does not work
  });
  </code></pre>