BlockingResponse in Firefox extension

Tags: , ,

I’m attempting to redirect a user in a Firefox extension like so:

  ({ url }) => {
    const [fullMatch, type, identifier] =
      ) || [];

    return { redirectUrl: `spotify:${type}:${identifier}` };
    urls: ["*://*", "*://*",
  "*://*", "*://*",
  "*://*", "*://*",
  "*://*", "*://*"],
    types: ["xmlhttprequest"],

I’ve added webRequest and webRequestBlocking permissions in the manifest. In the debugger, I see that I am reaching the return statement with the redirectUrl correctly set, but the webpage does not redirect. I would assume this should redirect based upon the webRequest documentation, however the temporary extension does not seem to redirect. Any ideas on how to get the extension to redirect? Changing the url to, for example, doesn’t work either, so it seems the issue is not with the URL.


After some testing, I’ve determined the issue is with the types array. xmlhttprequest does not capture certain requests in Firefox, but does in Chrome. In order to still be able to redirect, the types should be as follows:

  types: [

Source: stackoverflow