disable streaming download on mobile firefox

This commit is contained in:
Danny Coates 2019-08-26 10:49:19 -07:00
parent ff9be6a213
commit 924f5dc682
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB

View file

@ -76,8 +76,8 @@ async function polyfillStreams() {
} }
export default async function getCapabilities() { export default async function getCapabilities() {
const serviceWorker = const browser = browserName();
'serviceWorker' in navigator && browserName() !== 'edge'; const serviceWorker = 'serviceWorker' in navigator && browser !== 'edge';
let crypto = await checkCrypto(); let crypto = await checkCrypto();
const nativeStreams = checkStreams(); const nativeStreams = checkStreams();
let polyStreams = false; let polyStreams = false;
@ -97,13 +97,16 @@ export default async function getCapabilities() {
window.matchMedia('(display-mode: standalone)').matches || window.matchMedia('(display-mode: standalone)').matches ||
navigator.standalone; navigator.standalone;
const mobileFirefox =
browser === 'firefox' && /mobile/i.test(navigator.userAgent);
return { return {
account, account,
crypto, crypto,
serviceWorker, serviceWorker,
streamUpload: nativeStreams || polyStreams, streamUpload: nativeStreams || polyStreams,
streamDownload: streamDownload:
nativeStreams && serviceWorker && browserName() !== 'safari', nativeStreams && serviceWorker && browser !== 'safari' && !mobileFirefox,
multifile: nativeStreams || polyStreams, multifile: nativeStreams || polyStreams,
share, share,
standalone standalone