From 7ef116e85b8fb8127bcd12aaedeea9575295e686 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Thu, 12 Mar 2015 12:09:45 +0100 Subject: [PATCH] Remove unnecessary fallback code for downloading --- platform/chromium/vapi-common.js | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/platform/chromium/vapi-common.js b/platform/chromium/vapi-common.js index 7721646..799136d 100644 --- a/platform/chromium/vapi-common.js +++ b/platform/chromium/vapi-common.js @@ -54,30 +54,9 @@ vAPI.download = function(details) { } var a = document.createElement('a'); - - if ( 'download' in a ) { - a.href = details.url; - a.setAttribute('download', details.filename || ''); - a.dispatchEvent(new MouseEvent('click')); - return; - } - - var request = { - what: 'gotoURL', - details: { - url: details.url, - index: -1 - } - }; - - if ( vAPI.isMainProcess ) { - vAPI.tabs.open(request.details); - return; - } - - var messager = vAPI.messaging.channel('_download'); - messager.send(request); - messager.close(); + a.href = details.url; + a.setAttribute('download', details.filename || ''); + a.dispatchEvent(new MouseEvent('click')); }; /******************************************************************************/