0

I'm getting this in Firefox while in Chrome the same works

Error: Type error for parameter filter (Error processing urls.0: Expected string instead of undefined) for webRequest.onBeforeSendHeaders.

    import browser from "webextension-polyfill";
    
    browser.webRequest.onBeforeSendHeaders.addListener(
      listener,
      {
        urls: [url],
      },
      ["requestHeaders", "blocking", "extraHeaders"]
    );

I verified the url is a string, any idea where this is from?

K41F4r
  • 1,443
  • 1
  • 16
  • 36
  • 1
    Firefox uses its own WebExtensions API which is different from Chrome's so it doesn't support `extraHeaders`. See [this answer](https://stackoverflow.com/a/59589723) for a universal approach. – wOxxOm Nov 21 '20 at 15:38
  • Still seem to be getting this after fixing like you suggested, can't determine where this is coming from – K41F4r Nov 21 '20 at 20:18
  • 1
    The only other possibility is `url` being undefined. – wOxxOm Nov 21 '20 at 20:41
  • Firefox was just being weird, no code changes but and now it works, thanks – K41F4r Nov 23 '20 at 18:12

0 Answers0