How to open Blob in Chrome on iOS

10063 views
Skip to first unread message

Tomáš Masník

unread,
Jul 1, 2014, 2:31:04 AM7/1/14
to chromiu...@chromium.org
I want to open Blob object from javascript and the only thing I can see is a blank page.

Description:
I want to open Blob object from javascript and the only thing I can see is a blank page. Code:

      var blob = new window.Blob(['Hello, world!'], {type: 'text/plain;charset=utf-8'});
      window.URL = window.URL || window.webkitURL;
      var url = window.URL.createObjectURL(blob);
      window.location.href = url;

This does nothing. If i change it to:

      var blob = new window.Blob(['Hello, world!'], {type: 'text/plain;charset=utf-8'});
      window.URL = window.URL || window.webkitURL;
      var url = window.URL.createObjectURL(blob);
      window.open(url);

it opens a new tab with correct URL (blob:http%3A//10.128.52.86%3A8080/8d84447a-bdf1-4ee4-9b55-72f8159a687c) but with no content. 

This features are working on any other platform/browser (except for IE of course...).

Expected behavior:
I would expect the browser to show plaintext file with text "Hello, world!".

Version: 35.0.1916.41 Chrome on iOS 7.1.1

Is there any known workaround? Thank you

Tomas

PhistucK

unread,
Jul 1, 2014, 2:38:36 AM7/1/14
to Tomáš Masník, Chromium HTML5
Chrome for iOS is not really Chrome (in terms of the rendering engine and JavaScript engine), it is a Chrome skinned Mobile Safari (with a lower JavaScript performance due to platform limitations up to and not including iOS 8).
So if it works in Mobile Safari, it should work in Chrome for iOS. Have you tried Mobile Safari?


PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html...@chromium.org.
To post to this group, send email to chromiu...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Tomáš Masník

unread,
Jul 1, 2014, 2:54:29 AM7/1/14
to chromiu...@chromium.org, tomas....@gmail.com
Yes, Mobile Safari works (if that's the browser that is installed by default on iPad). 

Dne úterý, 1. července 2014 8:38:36 UTC+2 PhistucK napsal(a):

alit56

unread,
Dec 17, 2014, 9:02:44 AM12/17/14
to chromiu...@chromium.org, tomas....@gmail.com
Hi Tomas-

I am encountering the same issue using a blob generated by filesaver.js.  Were you able to get the blob to load in a new page?  Any insight would help.

Best,
Alek

Tomáš Masník

unread,
Dec 17, 2014, 9:06:01 AM12/17/14
to chromiu...@chromium.org, tomas....@gmail.com

Hi,

I've solved it only by a workaround. See my stackoverflow question (and answer) here.

I hope it helps you. Good luck :)

Tomas

Dne středa, 17. prosince 2014 15:02:44 UTC+1 alit56 napsal(a):

Anshul Surana

unread,
Jan 13, 2020, 11:18:37 AM1/13/20
to Chromium HTML5, tomas....@gmail.com
Hi, i cannot download my files, on ios, tried Tomas's stackoverflow solution as well. 
Reply all
Reply to author
Forward
0 new messages