Browse Source

Remove unnecessary fallback code for downloading

pull/2/head
Deathamns 10 years ago
committed by gorhill
parent
commit
7ef116e85b
  1. 21
      platform/chromium/vapi-common.js

21
platform/chromium/vapi-common.js

@ -54,30 +54,9 @@ vAPI.download = function(details) {
} }
var a = document.createElement('a'); var a = document.createElement('a');
if ( 'download' in a ) {
a.href = details.url; a.href = details.url;
a.setAttribute('download', details.filename || ''); a.setAttribute('download', details.filename || '');
a.dispatchEvent(new MouseEvent('click')); 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();
}; };
/******************************************************************************/ /******************************************************************************/

Loading…
Cancel
Save