From 3e43478e1355016a76e4ee887a5ea194e9b16cb7 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 1e9f81c..4ae7717 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(); };