title: chrome.webRequest.onBeforeRedirect not stopping redirect?
body: <p>I am developing a chrome extension, and in part of the extension I need to detect redirection and ask the user whether he/she wishes to proceed. I tried doing this using chrome's webRequest API, but it doesn't seem to work properly, even though I'm sure my syntax is right. Here is the relevant code:</p>
  
  <pre><code>chrome.webRequest.onBeforeRedirect.addListener(function (details) {
      if(details.frameId == 0){
          if (confirm("This link is a redirect. Do you want to continue?")){
              /* do nothing and let them redirect */
          }
          else {
              /* stop the redirect from happening */
              return {cancel: true};
          }
      }
  }, {urls: ["&lt;all_urls&gt;"], types: ["main_frame"]}, ["blocking"]);
  </code></pre>
  
  <p>Why isn't the method blocking properly?</p>