mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-09-30 09:06:56 +13:00
Remove unnecessary fallback code for downloading
This commit is contained in:
parent
33ffb83f23
commit
7ef116e85b
1 changed files with 3 additions and 24 deletions
|
@ -54,30 +54,9 @@ vAPI.download = function(details) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var a = document.createElement('a');
|
var a = document.createElement('a');
|
||||||
|
a.href = details.url;
|
||||||
if ( 'download' in a ) {
|
a.setAttribute('download', details.filename || '');
|
||||||
a.href = details.url;
|
a.dispatchEvent(new MouseEvent('click'));
|
||||||
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();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in a new issue