aboutsummaryrefslogtreecommitdiffstats
path: root/platform/firefox/vapi-common.js
diff options
context:
space:
mode:
Diffstat (limited to 'platform/firefox/vapi-common.js')
-rw-r--r--platform/firefox/vapi-common.js14
1 files 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();
};