dataURI downloads on (internal) download page lead to browser freezing/crash

356 views
Skip to first unread message

Wolf War

unread,
May 1, 2015, 7:07:31 PM5/1/15
to chromium-...@chromium.org
On internal downloads page, in from field usually is URL of downloaded file. 
But in the case of dataURI downloads (for instance, saving extension data), info presented is actual raw saved data, and in the case of larger files this could lead to browser crash.
To avoid that, I'm cleaning download history after my extension saved data. First question is, is that the proper way of dealing with this problem?
And second, shouldn't Chrome filter those downloads, and in the case of data:.. just write some info how file was downloaded (maybe ext. name if from extension)?

Daniel F

unread,
May 2, 2015, 11:18:40 AM5/2/15
to chromium-...@chromium.org
A data URL will open the file in a new tab, instead of downloading it.

Instead, try FileSaver.js

https://github.com/eligrey/FileSaver.js

PhistucK

unread,
May 2, 2015, 11:34:59 AM5/2/15
to Daniel F, Chromium-extensions
1. If you add the "download" attribute to the anchor, it will download instead of view -
<a href="data:..." download="file-name-for-the-downloaded-file.ext">foo</a>

2. If you change the MIME type (data:text/html;... to data:application/octet-stream;...), it will download instead of view as well.

3. Would you file an issue (if you cannot a similar one there) at crbug.com about the crash? The browser should not crash.
Does it crash with "He's dead, Jim!" or with "Aw, snap!"? The former is an out of memory error (which is kind of fine, but perhaps not really) and the latter is an unknown crash (which is not fine and should be fixed).

Thank you!


PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/51c06aaa-6b63-40be-8fe7-5ec062b77a4d%40chromium.org.

Daniel F

unread,
May 2, 2015, 11:37:07 AM5/2/15
to chromium-...@chromium.org, dan...@openmailbox.org
You are right. I forgot about the download attribute. 
However, if you ever want to make this into a website, the download attribute does not have cross-browser support.

PhistucK

unread,
May 2, 2015, 11:40:54 AM5/2/15
to Daniel F, Chromium-extensions
Right, but the context here is a Chrome extension, so cross browser compatibility is pretty much irrelevant in this context, I think (especially an extension that replaces the downloads page).


PhistucK

On Sat, May 2, 2015 at 6:37 PM, Daniel F <dan...@openmailbox.org> wrote:
You are right. I forgot about the download attribute. 
However, if you ever want to make this into a website, the download attribute does not have cross-browser support.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Wolf War

unread,
May 2, 2015, 11:53:33 AM5/2/15
to Daniel F, Chromium-extensions
it's not about downloading the file (that part works fine)
it's about Chrome internal downloads page (chrome://downloads)
Chrome is listing all downloads, and in the case of files downloaded as dataURL it is actual presenting that raw downloaded data. If the file is larger (or if there are many of those files) internal Chrome's download page  is stuck or leads to crash.
I'm not sure how filesaver.js library works, but if using same methods I don't think it will change something on chrome internal page.
Like I said, I'm cleaning those downloads from my extension after they done, but....
here is ss (it's from Opera, but the same situation) 
it doesn't matter if code is hidden behind elipsies or something like that, it still clutters the Chrome downloads page.

2015-05-02 17:37 GMT+02:00 Daniel F <dan...@openmailbox.org>:
You are right. I forgot about the download attribute. 
However, if you ever want to make this into a website, the download attribute does not have cross-browser support.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Daniel F

unread,
May 2, 2015, 11:54:59 AM5/2/15
to chromium-...@chromium.org, dan...@openmailbox.org
What is your extension saving?


On Saturday, May 2, 2015 at 8:53:33 AM UTC-7, Wolf War wrote:
it's not about downloading the file (that part works fine)
it's about Chrome internal downloads page (chrome://downloads)
Chrome is listing all downloads, and in the case of files downloaded as dataURL it is actual presenting that raw downloaded data. If the file is larger (or if there are many of those files) internal Chrome's download page  is stuck or leads to crash.
I'm not sure how filesaver.js library works, but if using same methods I don't think it will change something on chrome internal page.
Like I said, I'm cleaning those downloads from my extension after they done, but....
here is ss (it's from Opera, but the same situation) 
it doesn't matter if code is hidden behind elipsies or something like that, it still clutters the Chrome downloads page.
2015-05-02 17:37 GMT+02:00 Daniel F <dan...@openmailbox.org>:
You are right. I forgot about the download attribute. 
However, if you ever want to make this into a website, the download attribute does not have cross-browser support.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Wolf War

unread,
May 2, 2015, 11:56:19 AM5/2/15
to Daniel F, Chromium-extensions
user data...


2015-05-02 17:54 GMT+02:00 Daniel F <dan...@openmailbox.org>:
What is your extension saving?

On Saturday, May 2, 2015 at 8:53:33 AM UTC-7, Wolf War wrote:
it's not about downloading the file (that part works fine)
it's about Chrome internal downloads page (chrome://downloads)
Chrome is listing all downloads, and in the case of files downloaded as dataURL it is actual presenting that raw downloaded data. If the file is larger (or if there are many of those files) internal Chrome's download page  is stuck or leads to crash.
I'm not sure how filesaver.js library works, but if using same methods I don't think it will change something on chrome internal page.
Like I said, I'm cleaning those downloads from my extension after they done, but....
here is ss (it's from Opera, but the same situation) 
it doesn't matter if code is hidden behind elipsies or something like that, it still clutters the Chrome downloads page.
2015-05-02 17:37 GMT+02:00 Daniel F <dan...@openmailbox.org>:
You are right. I forgot about the download attribute. 
However, if you ever want to make this into a website, the download attribute does not have cross-browser support.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Daniel F

unread,
May 2, 2015, 11:58:03 AM5/2/15
to chromium-...@chromium.org, dan...@openmailbox.org
Is it images, spreadsheets, rich text files, text files?

What about the filesystem api?

On Saturday, May 2, 2015 at 8:56:19 AM UTC-7, Wolf War wrote:
user data...


2015-05-02 17:54 GMT+02:00 Daniel F <dan...@openmailbox.org>:
What is your extension saving?

On Saturday, May 2, 2015 at 8:53:33 AM UTC-7, Wolf War wrote:
it's not about downloading the file (that part works fine)
it's about Chrome internal downloads page (chrome://downloads)
Chrome is listing all downloads, and in the case of files downloaded as dataURL it is actual presenting that raw downloaded data. If the file is larger (or if there are many of those files) internal Chrome's download page  is stuck or leads to crash.
I'm not sure how filesaver.js library works, but if using same methods I don't think it will change something on chrome internal page.
Like I said, I'm cleaning those downloads from my extension after they done, but....
here is ss (it's from Opera, but the same situation) 
it doesn't matter if code is hidden behind elipsies or something like that, it still clutters the Chrome downloads page.
2015-05-02 17:37 GMT+02:00 Daniel F <dan...@openmailbox.org>:
You are right. I forgot about the download attribute. 
However, if you ever want to make this into a website, the download attribute does not have cross-browser support.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Wolf War

unread,
May 2, 2015, 12:00:37 PM5/2/15
to Daniel F, Chromium-extensions
fileSystem is reserved for chromium apps
data is screenshots or notes 

2015-05-02 17:58 GMT+02:00 Daniel F <dan...@openmailbox.org>:
Is it images, spreadsheets, rich text files, text files?

What about the filesystem api?

On Saturday, May 2, 2015 at 8:56:19 AM UTC-7, Wolf War wrote:
user data...


2015-05-02 17:54 GMT+02:00 Daniel F <dan...@openmailbox.org>:
What is your extension saving?

On Saturday, May 2, 2015 at 8:53:33 AM UTC-7, Wolf War wrote:
it's not about downloading the file (that part works fine)
it's about Chrome internal downloads page (chrome://downloads)
Chrome is listing all downloads, and in the case of files downloaded as dataURL it is actual presenting that raw downloaded data. If the file is larger (or if there are many of those files) internal Chrome's download page  is stuck or leads to crash.
I'm not sure how filesaver.js library works, but if using same methods I don't think it will change something on chrome internal page.
Like I said, I'm cleaning those downloads from my extension after they done, but....
here is ss (it's from Opera, but the same situation) 
it doesn't matter if code is hidden behind elipsies or something like that, it still clutters the Chrome downloads page.
2015-05-02 17:37 GMT+02:00 Daniel F <dan...@openmailbox.org>:
You are right. I forgot about the download attribute. 
However, if you ever want to make this into a website, the download attribute does not have cross-browser support.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Daniel F

unread,
May 2, 2015, 12:08:10 PM5/2/15
to chromium-...@chromium.org, dan...@openmailbox.org
How about the chrome downloads api


On Saturday, May 2, 2015 at 9:00:37 AM UTC-7, Wolf War wrote:
fileSystem is reserved for chromium apps
data is screenshots or notes 
2015-05-02 17:58 GMT+02:00 Daniel F <dan...@openmailbox.org>:
Is it images, spreadsheets, rich text files, text files?

What about the filesystem api?

On Saturday, May 2, 2015 at 8:56:19 AM UTC-7, Wolf War wrote:
user data...


2015-05-02 17:54 GMT+02:00 Daniel F <dan...@openmailbox.org>:
What is your extension saving?

On Saturday, May 2, 2015 at 8:53:33 AM UTC-7, Wolf War wrote:
it's not about downloading the file (that part works fine)
it's about Chrome internal downloads page (chrome://downloads)
Chrome is listing all downloads, and in the case of files downloaded as dataURL it is actual presenting that raw downloaded data. If the file is larger (or if there are many of those files) internal Chrome's download page  is stuck or leads to crash.
I'm not sure how filesaver.js library works, but if using same methods I don't think it will change something on chrome internal page.
Like I said, I'm cleaning those downloads from my extension after they done, but....
here is ss (it's from Opera, but the same situation) 
it doesn't matter if code is hidden behind elipsies or something like that, it still clutters the Chrome downloads page.
2015-05-02 17:37 GMT+02:00 Daniel F <dan...@openmailbox.org>:
You are right. I forgot about the download attribute. 
However, if you ever want to make this into a website, the download attribute does not have cross-browser support.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Wolf War

unread,
May 2, 2015, 12:14:22 PM5/2/15
to chromium-...@chromium.org
:)
actually I'm using that API, but it's the result that is subject
chrome.downloads.download({'url': 'data:text/plain;charset=utf-8,'+n4, 'saveAs': false, 'filename': filename}, function(downloadId){
setTimeout(function(){chrome.downloads.erase({'id': downloadId});},3000);
});

Seems like I need to convert it to blob. In that case, data is not presented on downloads page. Just tested on fileSaver demo page

PhistucK

unread,
May 2, 2015, 12:39:01 PM5/2/15
to Wolf War, Chromium-extensions
Yes, you can convert it to a blob. However, while the URLs will not be long, they will still show up in the downloads page (and may clutter it), I believe. If that is fine with you, then this is the way to go.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Wolf War

unread,
May 2, 2015, 12:49:49 PM5/2/15
to chromium-...@chromium.org, wolf...@gmail.com
I did some testing to see how do blobs behave on downloads page... it's actually good... only id (?! or something like it) is presented...not actual data like in dataURI case.... and downloads page is very responsive 


On Saturday, May 2, 2015 at 6:39:01 PM UTC+2, PhistucK wrote:
Yes, you can convert it to a blob. However, while the URLs will not be long, they will still show up in the downloads page (and may clutter it), I believe. If that is fine with you, then this is the way to go.


PhistucK

On Sat, May 2, 2015 at 7:14 PM, Wolf War <wolf...@gmail.com> wrote:
:)
actually I'm using that API, but it's the result that is subject
chrome.downloads.download({'url': 'data:text/plain;charset=utf-8,'+n4, 'saveAs': false, 'filename': filename}, function(downloadId){
setTimeout(function(){chrome.downloads.erase({'id': downloadId});},3000);
});

Seems like I need to convert it to blob. In that case, data is not presented on downloads page. Just tested on fileSaver demo page

On Saturday, May 2, 2015 at 1:07:31 AM UTC+2, Wolf War wrote:
On internal downloads page, in from field usually is URL of downloaded file. 
But in the case of dataURI downloads (for instance, saving extension data), info presented is actual raw saved data, and in the case of larger files this could lead to browser crash.
To avoid that, I'm cleaning download history after my extension saved data. First question is, is that the proper way of dealing with this problem?
And second, shouldn't Chrome filter those downloads, and in the case of data:.. just write some info how file was downloaded (maybe ext. name if from extension)?

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
Reply all
Reply to author
Forward
0 new messages