mirror of https://github.com/gorhill/uBlock.git
Remove unnecessary fallback code for downloading
This commit is contained in:
parent
650d86d5a9
commit
2e076f7e4e
|
@ -36,7 +36,6 @@ var vAPI = self.vAPI = self.vAPI || {};
|
|||
var chrome = self.chrome;
|
||||
var manifest = chrome.runtime.getManifest();
|
||||
|
||||
vAPI.isMainProcess = true;
|
||||
vAPI.chrome = true;
|
||||
|
||||
var noopFunc = function(){};
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
|
@ -38,7 +38,6 @@ const {Services} = Cu.import('resource://gre/modules/Services.jsm', null);
|
|||
/******************************************************************************/
|
||||
|
||||
var vAPI = self.vAPI = self.vAPI || {};
|
||||
vAPI.isMainProcess = true;
|
||||
vAPI.firefox = true;
|
||||
vAPI.fennec = Services.appinfo.ID === '{aa3c5121-dab2-40e2-81ca-7ea25febc110}';
|
||||
|
||||
|
|
|
@ -50,30 +50,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();
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue