1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00
This commit is contained in:
gorhill 2015-03-11 19:48:00 -04:00
parent 717c7a0a60
commit 60e36c0ffe
3 changed files with 13 additions and 3 deletions

View File

@ -36,6 +36,7 @@ var vAPI = self.vAPI = self.vAPI || {};
var chrome = self.chrome;
var manifest = chrome.runtime.getManifest();
vAPI.isMainProcess = true;
vAPI.chrome = true;
var noopFunc = function(){};

View File

@ -61,14 +61,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();
};

View File

@ -38,6 +38,7 @@ 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}';