diff --git a/.gitignore b/.gitignore index 9e926bfbc..8343ce16c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ /npm-debug.log /npm-debug.log +package-lock.json + !.gitkeep # Junk files diff --git a/src/drivers/bookmarklet/driver.js b/src/drivers/bookmarklet/driver.js index b7f59b401..3e6793b39 100644 --- a/src/drivers/bookmarklet/driver.js +++ b/src/drivers/bookmarklet/driver.js @@ -9,7 +9,7 @@ wappalyzer.driver.document = document; const container = document.getElementById('wappalyzer-container'); - const url = wappalyzer.parseUrl(top.location.href); + const url = wappalyzer.parseUrl(window.top.location.href); const hasOwn = Object.prototype.hasOwnProperty; /** @@ -27,7 +27,7 @@ .filter(s => s.src) .map(s => s.src); - var html = new XMLSerializer().serializeToString(document).split('\n'); + var html = new window.XMLSerializer().serializeToString(document).split('\n'); html = html .slice(0, 1000).concat(html.slice(html.length - 1000)) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index 37cb80701..c9ae64bee 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -1,12 +1,12 @@ 'use strict'; const Wappalyzer = require('./wappalyzer'); -const request = require('request'); const url = require('url'); const fs = require('fs'); +const path = require('path'); const Browser = require('zombie'); -const json = JSON.parse(fs.readFileSync(__dirname + '/apps.json')); +const json = JSON.parse(fs.readFileSync(path.resolve(__dirname + '/apps.json'))); const extensions = /^([^.]+$|\.(asp|aspx|cgi|htm|html|jsp|php)$)/; diff --git a/src/drivers/npm/package.json b/src/drivers/npm/package.json index 8d9ce91cf..f58a0ec9b 100644 --- a/src/drivers/npm/package.json +++ b/src/drivers/npm/package.json @@ -20,7 +20,6 @@ "wappalyzer": "./index.js" }, "dependencies": { - "request": "^2.85.0", "zombie": "^5.0.8" } } diff --git a/src/drivers/npm/yarn.lock b/src/drivers/npm/yarn.lock index fa80a8c4a..b87df14a5 100644 --- a/src/drivers/npm/yarn.lock +++ b/src/drivers/npm/yarn.lock @@ -17,8 +17,8 @@ acorn@^2.1.0, acorn@^2.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" ajv@^5.1.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.3.0.tgz#4414ff74a50879c208ee5fdc826e32c303549eda" + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: co "^4.6.0" fast-deep-equal "^1.0.0" @@ -42,8 +42,8 @@ aws-sign2@~0.7.0: resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" aws4@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + version "1.7.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" babel-runtime@5.8.29: version "5.8.29" @@ -52,8 +52,8 @@ babel-runtime@5.8.29: core-js "^1.0.0" bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" dependencies: tweetnacl "^0.14.3" @@ -61,18 +61,6 @@ bluebird@^3.0: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - dependencies: - hoek "4.x.x" - caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -81,9 +69,9 @@ co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" -combined-stream@^1.0.5, combined-stream@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" +combined-stream@1.0.6, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: delayed-stream "~1.0.0" @@ -95,15 +83,9 @@ core-util-is@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - dependencies: - boom "5.x.x" - cssom@0.3.x, "cssom@>= 0.3.0 < 0.4.0": - version "0.3.2" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + version "0.3.3" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.3.tgz#7b344769915759c2c9e3eb8c26f7fd533dbea252" "cssstyle@>= 0.2.29 < 0.3.0": version "0.2.37" @@ -138,15 +120,15 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" escodegen@^1.6.1: - version "1.9.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.0.tgz#9811a2f265dc1cd3894420ee3717064b632b8852" + version "1.10.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.10.0.tgz#f647395de22519fbd0d928ffcf1d17e0dec2603e" dependencies: esprima "^3.1.3" estraverse "^4.2.0" esutils "^2.0.2" optionator "^0.8.1" optionalDependencies: - source-map "~0.5.6" + source-map "~0.6.1" esprima@^3.1.3: version "3.1.3" @@ -170,13 +152,17 @@ extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" -extsprintf@1.3.0, extsprintf@^1.2.0: +extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + fast-deep-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" fast-json-stable-stringify@^2.0.0: version "2.0.0" @@ -191,11 +177,11 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" form-data@~2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: asynckit "^0.4.0" - combined-stream "^1.0.5" + combined-stream "1.0.6" mime-types "^2.1.12" getpass@^0.1.1: @@ -215,19 +201,6 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" - -hoek@4.x.x: - version "4.2.0" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" - http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -237,8 +210,10 @@ http-signature@~1.2.0: sshpk "^1.7.0" iconv-lite@^0.4.13: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" is-typedarray@~1.0.0: version "1.0.0" @@ -304,19 +279,19 @@ lodash@^3.10.1: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" -mime-db@~1.30.0: - version "1.30.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" +mime-db@~1.33.0: + version "1.33.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" mime-types@^2.1.12, mime-types@~2.1.17: - version "2.1.17" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" + version "2.1.18" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" dependencies: - mime-db "~1.30.0" + mime-db "~1.33.0" mime@^1.3.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" ms@2.0.0: version "2.0.0" @@ -327,8 +302,8 @@ ms@^0.7.1: resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" "nwmatcher@>= 1.3.7 < 2.0.0": - version "1.4.3" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c" + version "1.4.4" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.4.tgz#2285631f34a95f0d0395cd900c96ed39b58f346e" oauth-sign@~0.8.2: version "0.8.2" @@ -350,10 +325,10 @@ options@>=0.0.5: resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" original@>=0.0.5: - version "1.0.0" - resolved "https://registry.yarnpkg.com/original/-/original-1.0.0.tgz#9147f93fa1696d04be61e01bd50baeaca656bd3b" + version "1.0.1" + resolved "https://registry.yarnpkg.com/original/-/original-1.0.1.tgz#b0a53ff42ba997a8c9cd1fb5daaeb42b9d693190" dependencies: - url-parse "1.0.x" + url-parse "~1.4.0" parse5@^1.5.1: version "1.5.1" @@ -367,46 +342,23 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +psl@^1.1.24: + version "1.1.28" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.28.tgz#4fb6ceb08a1e2214d4fd4de0ca22dae13740bc7b" + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" qs@~6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" -querystringify@0.0.x: - version "0.0.4" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-0.0.4.tgz#0cf7f84f9463ff0ae51c4c4b142d95be37724d9c" +querystringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.0.0.tgz#fa3ed6e68eb15159457c89b37bc6472833195755" request@^2.55.0, request@^2.65.0: - version "2.83.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -request@^2.85.0: version "2.87.0" resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" dependencies: @@ -431,53 +383,55 @@ request@^2.85.0: tunnel-agent "^0.6.0" uuid "^3.1.0" -requires-port@1.0.x: +requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" safe-buffer@^5.0.1, safe-buffer@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" sax@^1.1.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" - dependencies: - hoek "4.x.x" - -source-map@~0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" sshpk@^1.7.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + version "1.14.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" dashdash "^1.12.0" getpass "^0.1.1" + safer-buffer "^2.0.2" optionalDependencies: bcrypt-pbkdf "^1.0.0" ecc-jsbn "~0.1.1" jsbn "~0.1.0" tweetnacl "~0.14.0" -stringstream@~0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" - "symbol-tree@>= 3.1.0 < 4.0.0": version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" -tough-cookie@^2.2.0, tough-cookie@~2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" +tough-cookie@^2.2.0: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tough-cookie@~2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: punycode "^1.4.1" @@ -505,16 +459,16 @@ ultron@1.0.x: version "1.0.2" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa" -url-parse@1.0.x: - version "1.0.5" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.0.5.tgz#0854860422afdcfefeb6c965c662d4800169927b" +url-parse@~1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.1.tgz#4dec9dad3dc8585f862fed461d2e19bbf623df30" dependencies: - querystringify "0.0.x" - requires-port "1.0.x" + querystringify "^2.0.0" + requires-port "^1.0.0" uuid@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" verror@1.10.0: version "1.10.0" @@ -539,8 +493,8 @@ wordwrap@~1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" ws@^1.0.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.4.tgz#57f40d036832e5f5055662a397c4de76ed66bf61" + version "1.1.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.5.tgz#cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51" dependencies: options ">=0.0.5" ultron "1.0.x" diff --git a/src/drivers/webextension/js/driver.js b/src/drivers/webextension/js/driver.js index 126d70c79..1eac725a2 100644 --- a/src/drivers/webextension/js/driver.js +++ b/src/drivers/webextension/js/driver.js @@ -29,7 +29,11 @@ function getOption(name, defaultValue = null) { browser.storage.local.get(name) .then(callback) - .catch(error => wappalyzer.log(error, 'driver', 'error')); + .catch(error => { + wappalyzer.log(error, 'driver', 'error') + + reject(); + }); }); } @@ -103,10 +107,12 @@ getOption('version') getOption('upgradeMessage', true) .then(upgradeMessage => { if ( upgradeMessage ) { + /* openTab({ url: wappalyzer.config.websiteURL + 'upgraded?v' + version, background: true }); + */ } }); } @@ -238,16 +244,16 @@ wappalyzer.driver.displayApps = (detected, meta, context) => { tabCache[tab.id].detected = detected; - var appName, found = false; + let found = false; // Find the main application to display [ options.pinnedCategory ].concat(categoryOrder).forEach(match => { Object.keys(detected).forEach(appName => { - var app = detected[appName]; + let app = detected[appName]; app.props.cats.forEach(category => { if ( category === match && !found ) { - var icon = app.props.icon || 'default.svg'; + let icon = app.props.icon || 'default.svg'; if ( !options.dynamicIcon ) { icon = 'default.svg'; @@ -288,7 +294,7 @@ wappalyzer.driver.getRobotsTxt = (host, secure = false) => { return robotsTxtQueue[host]; } - robotsTxtQueue[host] = new Promise((resolve, reject) => { + robotsTxtQueue[host] = new Promise(resolve => { getOption('tracking', true) .then(tracking => { if ( !tracking ) { @@ -318,7 +324,7 @@ wappalyzer.driver.getRobotsTxt = (host, secure = false) => { resolve(robotsTxtCache[host]); }) - .catch(err => resolve([])); + .catch(() => resolve([])); }); }); }) diff --git a/src/drivers/webextension/js/inject.js b/src/drivers/webextension/js/inject.js index d3dab8135..6c0cc60a1 100644 --- a/src/drivers/webextension/js/inject.js +++ b/src/drivers/webextension/js/inject.js @@ -2,7 +2,7 @@ try { addEventListener('message', onMessage); - function onMessage(event) { + const onMessage = event => { if ( event.data.id !== 'patterns' ) { return; } @@ -34,15 +34,15 @@ } postMessage({ id: 'js', js }, '*'); - } + }; - function detectJs(chain) { + const detectJs = chain => { const properties = chain.split('.'); - var value = properties.length ? window : null; + let value = properties.length ? window : null; for ( let i = 0; i < properties.length; i ++ ) { - var property = properties[i]; + let property = properties[i]; if ( value && value.hasOwnProperty(property) ) { value = value[property]; @@ -54,7 +54,7 @@ } return typeof value === 'string' || typeof value === 'number' ? value : !!value; - } + }; } catch(e) { // Fail quietly } diff --git a/src/drivers/webextension/js/popup.js b/src/drivers/webextension/js/popup.js index 47d507bf1..25b30afaf 100644 --- a/src/drivers/webextension/js/popup.js +++ b/src/drivers/webextension/js/popup.js @@ -45,7 +45,7 @@ function replaceDom(domTemplate) { }); Array.from(document.querySelectorAll('.detected__category-pin-wrapper')).forEach(pin => { - pin.addEventListener('click', event => { + pin.addEventListener('click', () => { const categoryId = parseInt(pin.dataset.categoryId, 10); if ( categoryId === pinnedCategory ) { @@ -74,15 +74,13 @@ function replaceDom(domTemplate) { } function appsToDomTemplate(response) { - var - appName, confidence, version, categories, - template = []; + let template = []; if ( response.tabCache && Object.keys(response.tabCache.detected).length > 0 ) { const categories = {}; // Group apps by category - for ( appName in response.tabCache.detected ) { + for ( let appName in response.tabCache.detected ) { response.apps[appName].cats.forEach(cat => { categories[cat] = categories[cat] || { apps: [] }; @@ -90,12 +88,12 @@ function appsToDomTemplate(response) { }); } - for ( cat in categories ) { + for ( let cat in categories ) { const apps = []; for ( appName in categories[cat].apps ) { - confidence = response.tabCache.detected[appName].confidenceTotal; - version = response.tabCache.detected[appName].version; + let confidence = response.tabCache.detected[appName].confidenceTotal; + let version = response.tabCache.detected[appName].version; apps.push( [ diff --git a/src/drivers/webextension/manifest.json b/src/drivers/webextension/manifest.json index 8fa9a3f7e..bec283c38 100644 --- a/src/drivers/webextension/manifest.json +++ b/src/drivers/webextension/manifest.json @@ -4,7 +4,7 @@ "author": "Elbert Alias", "homepage_url": "https://www.wappalyzer.com", "description": "Identify web technologies", - "version": "5.4.17", + "version": "5.4.19", "default_locale": "en", "manifest_version": 2, "icons": { diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 273bbb28c..028a254fe 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -152,7 +152,7 @@ class Wappalyzer { return reject(); } - return resolve(); + resolve(); }, () => resolve()); }); }; @@ -455,8 +455,6 @@ class Wappalyzer { } return this.asyncForEach(patterns, pattern => { - var match; - scripts.forEach(uri => { if ( pattern.regex.test(uri) ) { this.addDetected(app, pattern, 'script', uri); @@ -473,10 +471,10 @@ class Wappalyzer { const patterns = this.parsePatterns(app.props.meta); const promises = []; - var matches = []; + let matches; while ( patterns && ( matches = regex.exec(html) ) ) { - for ( var meta in patterns ) { + for ( let meta in patterns ) { const r = new RegExp('(?:name|property)=["\']' + meta + '["\']', 'i'); if ( r.test(matches[0]) ) { @@ -627,7 +625,7 @@ class Application { getConfidence() { var total = 0; - for ( var id in this.confidence ) { + for ( let id in this.confidence ) { total += this.confidence[id]; }