XMLHttpRequest does not contain cookies, when third party cookies are disabled in preferences

Hi.

I wanted to port a WebExtension to Firefox and have noticed, that sent
XMLHttpRequest fail with 401 error. Digging down a bit I have noticed,
it happens only when 3rd party cookies are disabled in my
about:preferences. Is it a bug, or intentional behaviour? If that’s
intentional, how can I login a get a cookie in the extension?

Do you have the corresponding host permission in your manifest?

also, setting this may help:

Hi Niklas.

Yes, I do both. But it seems, Firefox takes all cookies as third party, when the request is made from the add-on.

It sounds like a bug then. I don’t think extensions should be affected by the cookie settings. I’m a bit surprised though, that this hasn’t come up before. You should look for a bug reporting this on bugzilla and file one if there is none.

Thank you @NilkasG for your assistance. I haven’t found any similar bug, so reported here.