1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-26 10:01:08 +12:00

Remove unnecessary fallback code for downloading

This commit is contained in:
Deathamns 2015-03-12 12:09:45 +01:00 committed by gorhill
parent 33ffb83f23
commit 7ef116e85b

View file

@ -54,30 +54,9 @@ vAPI.download = function(details) {
}
var a = document.createElement('a');
if ( 'download' in a ) {
a.href = details.url;
a.setAttribute('download', details.filename || '');
a.dispatchEvent(new MouseEvent('click'));
return;
}
var request = {
what: 'gotoURL',
details: {
url: details.url,
index: -1
}
};
if ( vAPI.isMainProcess ) {
vAPI.tabs.open(request.details);
return;
}
var messager = vAPI.messaging.channel('_download');
messager.send(request);
messager.close();
a.href = details.url;
a.setAttribute('download', details.filename || '');
a.dispatchEvent(new MouseEvent('click'));
};
/******************************************************************************/