[REQUIRED] Describe your environment
- Operating System version: Ubuntu 19.04
- Browser version: Chrome Version 81.0.4044.92 (Official Build) (64-bit)
- Firebase SDK version: 7.12.0
- Firebase Product: auth
[REQUIRED] Describe the problem
Steps to reproduce:
While using firebase auth within a web worker, with persistence set to firebase.auth.Auth.Persistence.LOCAL, console is logging the UNSUPPORTED_PERSISTENCE error: The current environment does not support the specified persistence type.
Relevant Code:
Debugging the firebase code, the problem seems to be caused by isWebStorageSupported method, because it checks for localStorage before running the try/catch block but, as the Worker doesn't have localStorage, it goes directly into the return statement:

// worker.js
const auth = firebase.app().auth();
auth.setPersistence(firebase.auth.Auth.Persistence.LOCAL)
.then(() => auth.signInWithCustomToken(token));