-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always shows "Failed - No File" on Chrome #66
Comments
Working on it but still no luck... (function() {
'use strict';
function createBlob(data, config){
try {
return new Blob(data, config);
}
catch(e){}
}
var ab = new ArrayBuffer(10000000);
var blob = createBlob([ab], {type: 'application/zip'});
var url = URL.createObjectURL(blob);
var a = document.createElement('a');
a.setAttribute('download', 'file');
a.setAttribute('href', url);
var clickEvt = new MouseEvent('click');
a.dispatchEvent(clickEvt);
})(); Here is a script that describes how E-Hentai Downloader gives the file, it works fine on Chrome, or even in Tampermonkey sandbox. I also tried save it with FileSaver.js (function() {
'use strict';
function createBlob(data, config){
try {
return new Blob(data, config);
}
catch(e){}
}
var ab = new ArrayBuffer(10000000);
var blob = createBlob([ab], {type: 'application/zip'});
saveAs(blob, 'file')
})(); Both pure browser environment and Tampermonkey are fine, without any warning of "Failed - No File". The same result with JSZip. Tried exploding the ArrayBuffer data to global variable in E-Hentai Downloader. When downloading, Chrome says "Failed - No File", but when I use the first code to download the ArrayBuffer data that exploded to Not sure what's up. |
Got it. Here is the problem. saveAs(blob, fileName + '.zip');
// ...
if ('close' in blob) blob.close();
blob = null; It seems that on latest Chrome it implements the
saveAs(blob, fileName + '.zip');
// ...
setTimeout(function(){
if ('close' in blob) blob.close();
blob = null;
}, 1000); Use a timer will fixed the bug. |
Fixed in 1.26.2, it will delays about 10 seconds to do |
Thought mentioned in wiki, that we can try clicking
Not download? Click here to download
until it gives the file, it seems that it sometimes not working.From my recent test, with Chrome 57.0.2987.133, I tried it some times, but it still said "Failed- No File". I also checked my RAM (8GB) usage, only about 66% are used, and from Chrome Blob usage, all of them don't have file data, which likes the Blob storage is used up. This not only happens on Tampermonkey but also Violentmonkey.
Finally I set it always use File System to store files, and it works fine now.
I'm not sure if you have this bug or just only me, if you also occurred this problem, please note here, and try my settings.
The text was updated successfully, but these errors were encountered: