-
Notifications
You must be signed in to change notification settings - Fork 988
Open
Description
[REQUIRED] Describe your environment
- Operating System version: MacOS 10.12.6, Chrome 66.0.3359.181
- Firebase SDK version: 5.0.4
- Firebase Product: Storage
[REQUIRED] Describe the problem
Storage upload functionality uses XhrIo, which uses XHR. XHR is not available in Service Workers, so it's not possible to upload files to storage in Service Workers with the current JS SDK.
I propose replacing the use of XHR with Fetch (or Websockets?) or at least support both and provide a way to switch to Fetch.
Use case: resumable upload of large files over slow networks which will not break when the user navigates away or closes the browser window.
Steps to reproduce:
In a Service Worker, attempt to upload something
Relevant Code:
self.importScripts('https://unpkg.com/firebase@5.0.4/firebase.js')
...
self.firebase.storage().ref().child(filename).put(file)throws Uncaught ReferenceError: XMLHttpRequest is not defined
lokkilok, jimmywarting, warting, umi-tyaahan, LEW21 and 1 more