When updating our browser extension from Manifest v2 to Manifest v3, I ran into an issue with the implementation of the Headers interface suddenly being broken in Firefox when running the web extension with Manifest v3.
The entries() method was suddenly returning undefined. I'm using the ky package and the following error occurred within the package's code:
The code works perfectly fine when I polyfill the Headers class with this package or when I run the web extension with Manifest v2.
So it seems like a regression bug here.
What did you expect to happen?
The Headers class works perfectly fine with Manifest v2 or when I polyfill it.
For instance turning the headers into an array works fine:
const source = new globalThis.Headers({
accept: "application/json",
"content-type": "application/json; charset=utf-8"
});
Array.from(source.entries())
// -> [[ "accept", "application/json" ], [ "content-type", "application/json; charset=utf-8" ]]
```
### Is there an existing issue for this?
- [X] I have searched the existing issues
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/AMOENG-1188)
What happened?
When updating our browser extension from Manifest v2 to Manifest v3, I ran into an issue with the implementation of the
Headers
interface suddenly being broken in Firefox when running the web extension with Manifest v3.The
entries()
method was suddenly returningundefined
. I'm using the ky package and the following error occurred within the package's code:The code I run is roughly like this:
The code works perfectly fine when I polyfill the
Headers
class with this package or when I run the web extension with Manifest v2.So it seems like a regression bug here.
What did you expect to happen?
The
Headers
class works perfectly fine with Manifest v2 or when I polyfill it.For instance turning the headers into an array works fine: