firebase / firebase/firebase-js-sdk

FR: Use fetch in firebase/storage instead of XMLHttpRequest

Open
#6,595 20 comments 14 reactions 1 assignee Claimed by @maneesht View on GitHub
api: storage feature request
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [REQUIRED] Describe your environment

* Operating System version: macOS 12.5.1
* Browser version: Chrome 105.0.5195.102
* Firebase SDK version: 9.9.4
* Firebase Product: storage

### [REQUIRED] Describe the problem

I'm trying to use v9 SDK exported `firebase/storage` methods like `uploadString`, `uploadByte` within the context of a manifest v3 Chrome extension's Service Worker. Service workers lack the XMLHttpRequest web API, which is used to implement the network request part of these methods.
See the following line in the source code for where the XMLHttpRequest API is used:
https://github.com/firebase/firebase-js-sdk/blob/master/packages/storage/src/platform/browser/connection.ts#L42

I saw similar issues about other parts of the FB web SDK, which resulted in the the move to use fetch API for this implementation, and was wondering if it could be done for this storage logic too, to afford service worker/MV3 extension support?

I haven't included any reproducible example, as I think it is fairly clear from the above linked line in the source code and the fact that Service Workers don't support XMLHttpRequest. Though please let me know if you need any further info

Related issues:
- #6124
- #4912
- #6483

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.