diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-02-12 22:01:09 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-02-12 22:06:15 +0800 |
commit | 3c915b0d7ff7241c0b3f1b58aadda6da7bcb712d (patch) | |
tree | f0d664d09740912035bae2c65adff9f5a412b76e /app/scripts | |
parent | 969cf73fae4073f48a6491d3768d68ce64caeff9 (diff) | |
download | tangerine-wallet-browser-3c915b0d7ff7241c0b3f1b58aadda6da7bcb712d.tar tangerine-wallet-browser-3c915b0d7ff7241c0b3f1b58aadda6da7bcb712d.tar.gz tangerine-wallet-browser-3c915b0d7ff7241c0b3f1b58aadda6da7bcb712d.tar.bz2 tangerine-wallet-browser-3c915b0d7ff7241c0b3f1b58aadda6da7bcb712d.tar.lz tangerine-wallet-browser-3c915b0d7ff7241c0b3f1b58aadda6da7bcb712d.tar.xz tangerine-wallet-browser-3c915b0d7ff7241c0b3f1b58aadda6da7bcb712d.tar.zst tangerine-wallet-browser-3c915b0d7ff7241c0b3f1b58aadda6da7bcb712d.zip |
Update contentscript to use ES6 destructuring, const, let
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/contentscript.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 92e382ea5..65e2ec523 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -7,7 +7,7 @@ const PongStream = require('ping-pong-stream/pong') const ObjectMultiplex = require('obj-multiplex') const extension = require('extensionizer') const PortStream = require('extension-port-stream') -const TransformStream = require('stream').Transform +const {Transform: TransformStream} = require('stream') const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'inpage.js')).toString() const inpageSuffix = '//# sourceURL=' + extension.extension.getURL('inpage.js') + '\n' @@ -247,7 +247,7 @@ function suffixCheck () { * @returns {boolean} {@code true} if the documentElement is an html node or if none exists */ function documentElementCheck () { - var documentElement = document.documentElement.nodeName + const documentElement = document.documentElement.nodeName if (documentElement) { return documentElement.toLowerCase() === 'html' } @@ -260,7 +260,7 @@ function documentElementCheck () { * @returns {boolean} {@code true} if the current domain is blacklisted */ function blacklistedDomainCheck () { - var blacklistedDomains = [ + const blacklistedDomains = [ 'uscourts.gov', 'dropbox.com', 'webbyawards.com', @@ -271,8 +271,8 @@ function blacklistedDomainCheck () { 'ani.gamer.com.tw', 'blueskybooking.com', ] - var currentUrl = window.location.href - var currentRegex + const currentUrl = window.location.href + let currentRegex for (let i = 0; i < blacklistedDomains.length; i++) { const blacklistedDomain = blacklistedDomains[i].replace('.', '\\.') currentRegex = new RegExp(`(?:https?:\\/\\/)(?:(?!${blacklistedDomain}).)*$`) |