StreamSaver.js icon indicating copy to clipboard operation
StreamSaver.js copied to clipboard

Chrome ios issue

Open ArtyomBobrovnik opened this issue 4 years ago • 6 comments

Find that this sample https://jimmywarting.github.io/StreamSaver.js/examples/fetch.html not working in Chrome on IOS. Can you, please suggest, how to fix it, cause it affect file download

ArtyomBobrovnik avatar Dec 04 '20 13:12 ArtyomBobrovnik

I have the same problem Only on Chrome IOS No popup, no new page, nothing :/

Achaak avatar Feb 17 '21 13:02 Achaak

This problem is also effecting my project. https://jimmywarting.github.io/StreamSaver.js/examples/saving-a-blob.html doesn't work on IOS Chrome (its fine in IOS Safari). You click the button and nothing happens and no errors are thrown. I don't have an IOS device to debug further :(.

kmaid avatar Oct 04 '21 11:10 kmaid

I don't have an IOS device to debug further

unfortunately, i don't have a iOS device either

jimmywarting avatar Oct 04 '21 12:10 jimmywarting

it may work in safari (iOS) cuz this flag gets set to true https://github.com/jimmywarting/StreamSaver.js/blob/cd8e32a84f951541c5be183b2b409bd17dbb16cd/StreamSaver.js#L23

maybe it isn't true in chrome (iOS)

jimmywarting avatar Oct 04 '21 12:10 jimmywarting

Is there any way to set this flag manually without patching the library? Should I try and find a way of detecting just IOS chrome and make a PR?

kmaid avatar Oct 04 '21 12:10 kmaid

you could try

 let useBlobFallback = /constructor/i.test(global.HTMLElement) || !!global.safari || !!global.WebKitPoint 
  try {
    // We can't look for service worker since it may still work on http
    new Response(new ReadableStream())
    if (isSecureContext && !('serviceWorker' in navigator)) {
      useBlobFallback = true
    }
  } catch (err) {
    useBlobFallback = true
  }

  alert(useBlobFallback)

and see what it says

jimmywarting avatar Oct 04 '21 12:10 jimmywarting