From e3959c3610aabdfbd05eabd886e8580a24e50515 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 11 Mar 2015 19:55:27 -0400 Subject: [PATCH] changes re #993 for firefox platform --- platform/firefox/vapi-common.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/platform/firefox/vapi-common.js b/platform/firefox/vapi-common.js index 1e9f81c92..4ae771759 100644 --- a/platform/firefox/vapi-common.js +++ b/platform/firefox/vapi-common.js @@ -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(); };