Skip to content

Commit

Permalink
Remove pointless local scoping
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 6, 2019
1 parent 35854e4 commit 5688888
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions platform/chromium/vapi-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
/******************************************************************************/
/******************************************************************************/

(function(self) {

/******************************************************************************/

vAPI.T0 = Date.now();

/******************************************************************************/
Expand Down Expand Up @@ -65,10 +61,10 @@ vAPI.webextFlavor = {

// Asynchronous
if (
self.browser instanceof Object &&
typeof self.browser.runtime.getBrowserInfo === 'function'
browser instanceof Object &&
typeof browser.runtime.getBrowserInfo === 'function'
) {
self.browser.runtime.getBrowserInfo().then(info => {
browser.runtime.getBrowserInfo().then(info => {
flavor.major = parseInt(info.version, 10) || 60;
soup.add(info.vendor.toLowerCase())
.add(info.name.toLowerCase());
Expand All @@ -77,7 +73,7 @@ vAPI.webextFlavor = {
}
dispatch();
});
if ( self.browser.runtime.getURL('').startsWith('moz-extension://') ) {
if ( browser.runtime.getURL('').startsWith('moz-extension://') ) {
soup.add('mozilla')
.add('firefox')
.add('user_stylesheet')
Expand Down Expand Up @@ -120,11 +116,8 @@ vAPI.webextFlavor = {
/******************************************************************************/

vAPI.download = function(details) {
if ( !details.url ) {
return;
}

var a = document.createElement('a');
if ( !details.url ) { return; }
const a = document.createElement('a');
a.href = details.url;
a.setAttribute('download', details.filename || '');
a.setAttribute('type', 'text/plain');
Expand Down Expand Up @@ -206,10 +199,6 @@ vAPI.localStorage = {
}
};

/******************************************************************************/

})(this);




Expand Down

0 comments on commit 5688888

Please sign in to comment.