From e96fb5ba30aecca00b4aa2db8429f2d0eb8b26de Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Fri, 1 Sep 2017 08:59:10 +1000 Subject: [PATCH 1/7] Update moment.js icon, remove console.log --- src/apps.json | 4 ++-- src/icons/Moment.js.png | Bin 438 -> 0 bytes src/icons/Moment.js.svg | 1 + src/wappalyzer.js | 8 ++------ 4 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 src/icons/Moment.js.png create mode 100644 src/icons/Moment.js.svg diff --git a/src/apps.json b/src/apps.json index d360c51b9..5435100f4 100755 --- a/src/apps.json +++ b/src/apps.json @@ -5238,7 +5238,7 @@ "cats": [ "12" ], - "icon": "Moment.js.png", + "icon": "Moment.js.svg", "implies": "Moment.js", "script": "moment-timezone(?:\\-data)?(?:\\.min)?\\.js", "website": "http://momentjs.com/timezone/" @@ -5248,7 +5248,7 @@ "12" ], "env": "^moment$", - "icon": "Moment.js.png", + "icon": "Moment.js.svg", "script": "moment(?:\\.min)?\\.js", "website": "http://momentjs.com" }, diff --git a/src/icons/Moment.js.png b/src/icons/Moment.js.png deleted file mode 100644 index f368a3002b59b47c2780aeed1a24d0818518ccf5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 438 zcmV;n0ZIOeP)ToQ5QRBVP~u87+Yol$l-?yyRk{g_aGOL5YH6ibN{}m&8*l(aB-k?E7mrOKiKVJ< zGyeHx&)9D)@rSH`0nO?7@p(KoW&rZY8_j&*wY?~Z9smI-PD#LOIjUGdC~pTsZdqy@ z4pUr%_cuj52fcxSfbAq!^Hm6V=5Df8XSX@DN2QY#WCRh0Dnd$9jF=>!#$8S=pcOm3 zs{-gV+ybzqpn;qe;ua7E$u+PJgb5JAS^SqA>3dmeATLESn0;OG>fqGP`GUv<;Ft3q* z0EhyWw17(mk^b(Sa4?9Iyz|3?ngF`!`~ck9iNO^r#`jzUt@h*eI>VIghpyg? \ No newline at end of file diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 02c29d98c..1374dbfbe 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -116,11 +116,7 @@ class Wappalyzer { this.driver.getRobotsTxt(parsed.host, parsed.protocol === 'https:') .then(robotsTxt => { - robotsTxt.forEach(disallow => { - if ( parsed.pathname.indexOf(disallow) === 0 ) { - reject(); - } - }); + robotsTxt.forEach(disallow => parsed.pathname.indexOf(disallow) === 0 && reject()); resolve(); }); @@ -352,7 +348,7 @@ class Wappalyzer { this.hostnameCache[hostname].applications[appName].version = app.version; } }) - .catch(() => console.log('Disallowed in robots.txt: ' + url)) + .catch(() => this.log('Disallowed in robots.txt: ' + url), 'core') } } }); From db0e2c4dcdd4b66f70c4997de0da27c04dd1ddf0 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Fri, 1 Sep 2017 15:10:53 +1000 Subject: [PATCH 2/7] Fix build script --- Dockerfile | 7 +++--- bin/build | 25 +++++++++++++++++++-- package.json | 3 +-- src/drivers/npm/package.json | 2 +- src/drivers/webextension/manifest.edge.json | 2 +- src/drivers/webextension/manifest.json | 4 ++-- 6 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 79d7c0f38..f2a28e638 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,9 @@ RUN apk update && apk add --no-cache \ optipng \ zip -RUN mkdir -p /usr/share && \ - cd /usr/share \ - && curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar xj \ - && ln -s /usr/share/phantomjs/phantomjs /usr/bin/phantomjs +# Fixes PhantomJS +# https://github.com/dustinblackman/phantomized +RUN curl -Ls "https://github.com/dustinblackman/phantomized/releases/download/2.1.1a/dockerized-phantomjs.tar.gz" | tar xz -C / RUN apk del \ curl diff --git a/bin/build b/bin/build index 2c2941ba6..9f38e3454 100755 --- a/bin/build +++ b/bin/build @@ -2,17 +2,31 @@ cd "$(dirname $0)/.." +version="$2" + +if [[ -z "$version" ]]; then + current=$(grep '"version":' src/drivers/webextension/manifest.json | sed 's/^.*"version": "\(.*\)".*$/\1/') + + echo "No version specified. Current version is $current." + + exit 1; +fi + set -eu ./bin/validate +echo "Deleting junk files..." + +find . -name ".DS_Store" -exec rm {} \; + echo "Prettifying apps.json..." jsonlint-cli -ist $'\t' src/apps.json echo "Converting SVG icons to PNG..." -#svg2png-many -i src/icons/ -o src/icons/converted/ --width=32 --height=32 +svg2png-many -i src/icons/ -o src/icons/converted/ --width=32 --height=32 echo "Compressing PNG icons..." @@ -23,6 +37,9 @@ optipng -quiet "src/icons/converted/*.png" set -e +# NPM +sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$version\"/" src/drivers/npm/package.json + # WebExtension echo "Building WebExtension..." @@ -30,6 +47,8 @@ webextension_dir=src/drivers/webextension pushd $webextension_dir > /dev/null +sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$version\"/" manifest.json + zip -qr ../../../build/wappalyzer_webextension.zip . popd > /dev/null @@ -45,6 +64,8 @@ manifest_dir="Wappalyzer/edgeextension/manifest" mv $webextension_dir/manifest.json $webextension_dir/manifest.webextension.json mv $webextension_dir/manifest.edge.json $webextension_dir/manifest.json +sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$version\"/" $webextension_dir/manifest.json + manifoldjs -l debug -p edgeextension -f edgeextension -m $webextension_dir/manifest.json # Replace symlinks with actual files @@ -74,4 +95,4 @@ rm -rf Wappalyzer popd > /dev/null -echo "Done." +echo "Done (v$version)." diff --git a/package.json b/package.json index dd2dbe93d..2148f0f67 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,7 @@ "dependencies": { "file-type": "3.8.*", "is-svg": "2.0.*", - "read-chunk": "2.0.*", - "svg2png-many": "*" + "read-chunk": "2.0.*" } } diff --git a/src/drivers/npm/package.json b/src/drivers/npm/package.json index e588c0b14..921016f88 100644 --- a/src/drivers/npm/package.json +++ b/src/drivers/npm/package.json @@ -2,7 +2,7 @@ "name": "wappalyzer", "description": "Uncovers the technologies used on websites", "homepage": "https://github.com/AliasIO/Wappalyzer", - "version": "5.1.1", + "version": "5.1.2", "author": "Elbert Alias", "license": "GPL-3.0", "repository": { diff --git a/src/drivers/webextension/manifest.edge.json b/src/drivers/webextension/manifest.edge.json index 4d50e5f47..50cb00946 100644 --- a/src/drivers/webextension/manifest.edge.json +++ b/src/drivers/webextension/manifest.edge.json @@ -4,7 +4,7 @@ "author": "Elbert Alias", "homepage_url": "https://wappalyzer.com/", "description": "Identify web technologies", - "version": "5.1.1", + "version": "5.1.2", "default_locale": "en", "manifest_version": 2, "icons": { diff --git a/src/drivers/webextension/manifest.json b/src/drivers/webextension/manifest.json index 371a312c6..957da7969 100644 --- a/src/drivers/webextension/manifest.json +++ b/src/drivers/webextension/manifest.json @@ -4,7 +4,7 @@ "author": "Elbert Alias", "homepage_url": "https://wappalyzer.com/", "description": "Identify web technologies", - "version": "5.1.1", + "version": "5.1.2", "default_locale": "en", "manifest_version": 2, "icons": { @@ -43,7 +43,7 @@ }, { "matches": [ - "http://*/*", + "http://*/*", "https://*/*" ], "js": [ From 7118649fb07cb69becb472d37bda45d4fccf0625 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Fri, 1 Sep 2017 15:16:28 +1000 Subject: [PATCH 3/7] Update Travis build script --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c6d5ebf3a..e9a3986ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ after_success: - cat build/SHA256SUMS script: - - ./run build + - version=$(grep '"version":' src/drivers/webextension/manifest.json | sed 's/^.*"version": "\(.*\)".*$/\1/'); ./run build $version deploy: provider: releases From a05d78e47d6eeb4c8046a03f437bb38baed3cc8a Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sat, 2 Sep 2017 14:05:03 +1000 Subject: [PATCH 4/7] Fix browser is undefined error in content.js --- src/drivers/webextension/js/content.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/drivers/webextension/js/content.js b/src/drivers/webextension/js/content.js index 2255119e1..c4e1940b0 100644 --- a/src/drivers/webextension/js/content.js +++ b/src/drivers/webextension/js/content.js @@ -1,19 +1,19 @@ /** global: browser */ -if ( document.body !== undefined ) { +if ( typeof browser !== 'undefined' && typeof document.body !== 'undefined' ) { var html = document.documentElement.outerHTML; if ( html.length > 50000 ) { html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length); } - browser.runtime.sendMessage({ - id: 'analyze', - subject: { html }, - source: 'content.js' - }); - try { + browser.runtime.sendMessage({ + id: 'analyze', + subject: { html }, + source: 'content.js' + }); + var container = document.createElement('wappalyzerData'); container.setAttribute('id', 'wappalyzerData'); @@ -42,7 +42,7 @@ if ( document.body !== undefined ) { document.documentElement.appendChild(container); document.documentElement.appendChild(script); } catch(e) { - log('Error: ' + e); + log(e); } } From a4d6373e1b02ba2ad55cea338081d43f09be7717 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Thu, 14 Sep 2017 13:31:47 +0200 Subject: [PATCH 5/7] Travis fix? --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9a3986ee..8db05a48d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ after_success: - cat build/SHA256SUMS script: - - version=$(grep '"version":' src/drivers/webextension/manifest.json | sed 's/^.*"version": "\(.*\)".*$/\1/'); ./run build $version + - version=$(grep '\"version\":' src/drivers/webextension/manifest.json | sed 's/^.*\"version\": \"\(.*\)\".*$/\1/'); ./run build $version deploy: provider: releases @@ -22,4 +22,4 @@ deploy: tags: true env: - - CXX=g++-4.8 + - CXX=g++-4. From bdc6256e0774be931152e20ab5f9dbb70a6c0f72 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Thu, 14 Sep 2017 13:37:41 +0200 Subject: [PATCH 6/7] Travis fix? --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8db05a48d..f24641acc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ after_success: - sha256sum build/* > build/SHA256SUMS - cat build/SHA256SUMS -script: - - version=$(grep '\"version\":' src/drivers/webextension/manifest.json | sed 's/^.*\"version\": \"\(.*\)\".*$/\1/'); ./run build $version +script: |- + version=$(grep '"version":' src/drivers/webextension/manifest.json | sed 's/^.*"version": "\(.*\)".*$/\1/'); ./run build $version deploy: provider: releases From 04aa8dc3991825b4d78fa1fb2a252834312af4dc Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Thu, 14 Sep 2017 13:43:07 +0200 Subject: [PATCH 7/7] Travis fix? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f24641acc..7009b2ce8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,4 +22,4 @@ deploy: tags: true env: - - CXX=g++-4. + - CXX=g++-4.8