Firefox for Android GC bug no longer applies

This commit is contained in:
Eli Grey
2014-05-27 13:01:40 -04:00
parent 6963e120d4
commit d28d0bb26e
+1 -12
View File
@@ -122,20 +122,9 @@ var saveAs = saveAs
}
if (can_use_save_link) {
object_url = get_object_url(blob);
// FF for Android has a nasty garbage collection mechanism
// that turns all objects that are not pure javascript into 'deadObject'
// this means `doc` and `save_link` are unusable and need to be recreated
// `view` is usable though:
doc = view.document;
save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a");
save_link.href = object_url;
save_link.download = name;
var event = doc.createEvent("MouseEvents");
event.initMouseEvent(
"click", true, false, view, 0, 0, 0, 0, 0
, false, false, false, false, 0, null
);
save_link.dispatchEvent(event);
click(save_link);
filesaver.readyState = filesaver.DONE;
dispatch_all();
return;