mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-20 01:12:38 +01:00
Fix vAPI.download across all platforms
This commit is contained in:
parent
60e36c0ffe
commit
03797626cf
@ -71,7 +71,7 @@ vAPI.download = function(details) {
|
||||
};
|
||||
|
||||
if ( vAPI.isMainProcess ) {
|
||||
vAPI.tabs.open(request);
|
||||
vAPI.tabs.open(request.details);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -57,14 +57,22 @@ vAPI.download = function(details) {
|
||||
a.dispatchEvent(new MouseEvent('click'));
|
||||
return;
|
||||
}
|
||||
var messager = vAPI.messaging.channel('_download');
|
||||
messager.send({
|
||||
|
||||
var request = {
|
||||
what: 'gotoURL',
|
||||
details: {
|
||||
url: details.url,
|
||||
index: -1
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if ( vAPI.isMainProcess ) {
|
||||
vAPI.tabs.open(request);
|
||||
return;
|
||||
}
|
||||
|
||||
var messager = vAPI.messaging.channel('_download');
|
||||
messager.send(request);
|
||||
messager.close();
|
||||
};
|
||||
|
||||
|
@ -31,7 +31,8 @@
|
||||
"use strict";
|
||||
|
||||
var vAPI = self.vAPI = self.vAPI || {};
|
||||
|
||||
|
||||
vAPI.isMainProcess = true;
|
||||
vAPI.safari = true;
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -55,14 +55,21 @@ vAPI.download = function(details) {
|
||||
a.dispatchEvent(new MouseEvent('click'));
|
||||
return;
|
||||
}
|
||||
var messager = vAPI.messaging.channel('_download');
|
||||
messager.send({
|
||||
var request = {
|
||||
what: 'gotoURL',
|
||||
details: {
|
||||
url: details.url,
|
||||
index: -1
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if ( vAPI.isMainProcess ) {
|
||||
vAPI.tabs.open(request);
|
||||
return;
|
||||
}
|
||||
|
||||
var messager = vAPI.messaging.channel('_download');
|
||||
messager.send(request);
|
||||
messager.close();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user