title: Chrome extension webrequest redirect after executing code that takes 4/5 seconds
body: <p>I'm trying to create a Chrome extension that executes some code (takes about 4 seconds) and afterwards does a callback that redirects the user to a page. However, no redirect takes place with the following code:</p>
  
  <pre><code> chrome.webRequest.onBeforeRequest.addListener(function(details) {
      functionThatTakes4Seconds(function(){
              return {
                  redirectUrl: redirect
              };
      );
  }, {
      urls: ["url.com"]
  }, ["blocking"]);
  </code></pre>
  
  <p>When I don't run the function that takes 4 seconds the redirect works:</p>
  
  <pre><code> chrome.webRequest.onBeforeRequest.addListener(function(details) {
              return {
                  redirectUrl: redirect
              };
  }, {
      urls: ["url.com"]
  }, ["blocking"]);
  </code></pre>
  
  <p>Does it timeout? Is there a workaround for this?</p>