diff options
author | Chris <chris@chrismatic.io> | 2015-03-11 17:54:32 -0600 |
---|---|---|
committer | Chris <chris@chrismatic.io> | 2015-03-11 17:54:32 -0600 |
commit | 03797626cf857932810a8c336508093628022b17 (patch) | |
tree | cef801c68705ab166804088ff182b0c95d6f8c72 /platform/safari | |
parent | 60e36c0ffe19ba6a0edde8ec735b80a575dc4693 (diff) | |
download | uBlock-03797626cf857932810a8c336508093628022b17.zip uBlock-03797626cf857932810a8c336508093628022b17.tar.gz uBlock-03797626cf857932810a8c336508093628022b17.tar.bz2 |
Fix vAPI.download across all platforms
Diffstat (limited to 'platform/safari')
-rw-r--r-- | platform/safari/vapi-background.js | 3 | ||||
-rw-r--r-- | platform/safari/vapi-common.js | 13 |
2 files changed, 12 insertions, 4 deletions
diff --git a/platform/safari/vapi-background.js b/platform/safari/vapi-background.js index 143693c..be51b0e 100644 --- a/platform/safari/vapi-background.js +++ b/platform/safari/vapi-background.js @@ -31,7 +31,8 @@ "use strict"; var vAPI = self.vAPI = self.vAPI || {}; - + + vAPI.isMainProcess = true; vAPI.safari = true; /******************************************************************************/ diff --git a/platform/safari/vapi-common.js b/platform/safari/vapi-common.js index ac47849..936d1e8 100644 --- a/platform/safari/vapi-common.js +++ b/platform/safari/vapi-common.js @@ -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(); }; |