Verified Commit 75c1b42a authored by Aral Balkan's avatar Aral Balkan
Browse files

No longer requires manual Chrome install or running headless chrome for inspect

parent 19122154
......@@ -22,6 +22,8 @@ HTTPArchive = require './HTTPArchive'
args = (require 'minimist') process.argv.slice(2), {boolean: true}
puppeteer = require 'puppeteer'
_ = (s) -> console.log s
# Draw the logo
......@@ -75,12 +77,14 @@ spinner.start()
# Time the inspection
inspectionStartTime = new Date()
endInspection = ->
inspectionEndTime = new Date()
_ "\nInspection took: #{((inspectionEndTime - inspectionStartTime)/1000).toFixed(2)}s\n"
endInspection = (browser) ->
browser.close().then ->
inspectionEndTime = new Date()
_ "\nInspection took: #{((inspectionEndTime - inspectionStartTime)/1000).toFixed(2)}s\n"
(itemToLoad.generator itemToLoad.path, (args.i? or args.interactive)).then (archive) ->
(puppeteer.launch args: ['--remote-debugging-port=9222']).then (browser) ->
(itemToLoad.generator itemToLoad.path, (args.i? or args.interactive)).then (archive) ->
# Stop status indicator.
spinner.stop true
......@@ -102,7 +106,9 @@ endInspection = ->
_ "Error: Could not save HTTP Archive (HAR) file"
_ error
.finally ->
endInspection()
endInspection(browser)
else
_ "\nInspected file #{itemToLoad.path}."
endInspection()
endInspection(browser)
.catch (error) ->
console.log ("Could not launch browser " + error)
\ No newline at end of file
......@@ -4,6 +4,34 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/core-js": {
"version": "0.9.43",
"resolved": "https://registry.npmjs.org/@types/core-js/-/core-js-0.9.43.tgz",
"integrity": "sha512-Y11dktBJ5YwKXX8DfHSb9V6shXKSHN5P2URPZLHTRjX3OsO/u8u1kZnSJvsuSH74aTg8f5ZKcpEeCdIJOcBkHg=="
},
"@types/mkdirp": {
"version": "0.3.29",
"resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.3.29.tgz",
"integrity": "sha1-fyrX7FX5FEgvybHsS7GuYCjUYGY="
},
"@types/node": {
"version": "6.0.66",
"resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.66.tgz",
"integrity": "sha1-VoC3SmE10z1MAER+fD3GkaRgFiU="
},
"@types/rimraf": {
"version": "0.0.28",
"resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-0.0.28.tgz",
"integrity": "sha1-VWJRm8eWPKyoq/fxKMrjtZTUHQY="
},
"agent-base": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.1.1.tgz",
"integrity": "sha512-yWGUUmCZD/33IRjG2It94PzixT8lX+47Uq8fjmd0cgQWITCMrJuXFaVIMnGDmDnZGGKAGdwTx8UGeU8lMR2urA==",
"requires": {
"es6-promisify": "5.0.0"
}
},
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
......@@ -19,10 +47,24 @@
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"bluebird": {
"version": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz",
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw="
},
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"requires": {
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
"buffer-equal": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz",
......@@ -48,6 +90,21 @@
"commander": "2.11.0"
}
},
"chrome-launcher": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.8.1.tgz",
"integrity": "sha512-YhLMJ5acDodfRfIL6Vzv1NQ3ygAHqW78BJJryRxlcUdcvkfp3/R1V+qEBDi2S0k07/bZIubqfRIsKsg25GqQBQ==",
"requires": {
"@types/core-js": "0.9.43",
"@types/mkdirp": "0.3.29",
"@types/node": "6.0.66",
"@types/rimraf": "0.0.28",
"is-wsl": "1.1.0",
"lighthouse-logger": "1.0.1",
"mkdirp": "0.5.1",
"rimraf": "2.6.2"
}
},
"chrome-remote-interface": {
"version": "0.25.2",
"resolved": "https://registry.npmjs.org/chrome-remote-interface/-/chrome-remote-interface-0.25.2.tgz",
......@@ -78,6 +135,34 @@
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ=="
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"concat-stream": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz",
"integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=",
"requires": {
"inherits": "2.0.3",
"readable-stream": "2.3.3",
"typedarray": "0.0.6"
}
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"defaults": {
"version": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
"integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
......@@ -93,11 +178,71 @@
"wcwidth": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz"
}
},
"es6-promise": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.1.1.tgz",
"integrity": "sha512-OaU1hHjgJf+b0NzsxCg7NdIYERD6Hy/PEmFLTjw+b65scuisG3Kt4QoTvJ66BBkPZ581gr0kpoVzKnxniM8nng=="
},
"es6-promisify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
"integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
"requires": {
"es6-promise": "4.1.1"
}
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"extract-zip": {
"version": "1.6.5",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.5.tgz",
"integrity": "sha1-maBnNbbqIOqbcF13ms/8yHz/BEA=",
"requires": {
"concat-stream": "1.6.0",
"debug": "2.2.0",
"mkdirp": "0.5.0",
"yauzl": "2.4.1"
},
"dependencies": {
"debug": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=",
"requires": {
"ms": "0.7.1"
}
},
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
},
"mkdirp": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=",
"requires": {
"minimist": "0.0.8"
}
},
"ms": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
"integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg="
}
}
},
"fd-slicer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
"integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=",
"requires": {
"pend": "1.2.0"
}
},
"file-size": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-size/-/file-size-1.0.0.tgz",
......@@ -237,6 +382,24 @@
}
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"has-ansi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
......@@ -245,6 +408,39 @@
"ansi-regex": "2.1.1"
}
},
"https-proxy-agent": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.1.0.tgz",
"integrity": "sha512-/DTVSUCbRc6AiyOV4DBRvPDpKKCJh4qQJNaCgypX0T41quD9hp/PB5iUyx/60XobuMPQa9ce1jNV9UOUq6PnTg==",
"requires": {
"agent-base": "4.1.1",
"debug": "2.6.9"
}
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"is-wsl": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz",
"integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0="
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"json-stable-stringify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
......@@ -260,16 +456,57 @@
}
}
},
"lighthouse-logger": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.0.1.tgz",
"integrity": "sha1-8HPYP3rLyWcpvxAKEhyPAGmRrmE=",
"requires": {
"debug": "2.6.9"
}
},
"mime": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz",
"integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ=="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "1.1.8"
}
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
}
}
},
"moment": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.15.1.tgz",
"integrity": "sha1-6XnCop4iiI5g85byIgphGPhc2Uw="
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"natural": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/natural/-/natural-0.4.0.tgz",
......@@ -355,6 +592,14 @@
"resolved": "https://registry.npmjs.org/node-pngcrush/-/node-pngcrush-0.3.7.tgz",
"integrity": "sha1-B7RivyQjRSYD1D7qRlWV8dsg8hc="
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1.0.2"
}
},
"parse-domain": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/parse-domain/-/parse-domain-0.2.1.tgz",
......@@ -365,6 +610,68 @@
"resolved": "https://registry.npmjs.org/path-extra/-/path-extra-3.0.0.tgz",
"integrity": "sha1-tVut04+O3APXE6hM2bHBwh6Kfvc="
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"pend": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
},
"progress": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
"integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8="
},
"proxy-from-env": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz",
"integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4="
},
"puppeteer": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-0.12.0.tgz",
"integrity": "sha512-H/bylN7FccwbN7JZoSP+xRozxgJEDNy4uC4p727cyttKUVNXYjFuEMueJYHW0pblnrfLEH341SyFJVWhJMLxKQ==",
"requires": {
"debug": "2.6.9",
"extract-zip": "1.6.5",
"https-proxy-agent": "2.1.0",
"mime": "1.4.1",
"progress": "2.0.0",
"proxy-from-env": "1.0.0",
"rimraf": "2.6.2",
"ws": "3.2.0"
}
},
"readable-stream": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
"integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==",
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "1.0.7",
"safe-buffer": "5.1.1",
"string_decoder": "1.0.3",
"util-deprecate": "1.0.2"
}
},
"rimraf": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"requires": {
"glob": "7.1.2"
}
},
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
......@@ -386,6 +693,14 @@
}
}
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"requires": {
"safe-buffer": "5.1.1"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
......@@ -399,11 +714,21 @@
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
},
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"ultron": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.0.tgz",
"integrity": "sha1-sHoualQagV/Go0zNRTO67DB8qGQ="
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"wcwidth": {
"version": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
"integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=",
......@@ -1482,6 +1807,11 @@
}
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"ws": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-3.2.0.tgz",
......@@ -1491,6 +1821,14 @@
"safe-buffer": "5.1.1",
"ultron": "1.1.0"
}
},
"yauzl": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz",
"integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=",
"requires": {
"fd-slicer": "1.0.1"
}
}
}
}
......@@ -14,9 +14,10 @@
"dependencies": {
"bluebird": "^3.3.4",
"buffer-equal": "^1.0.0",
"chrome-har-capturer": "git+https://source.ind.ie/forks/chrome-har-capturer.git",
"chrome-launcher": "^0.8.1",
"cli-spinner": "^0.2.5",
"easy-table": "^1.0.0",
"chrome-har-capturer": "git+https://source.ind.ie/forks/chrome-har-capturer.git",
"file-size": "^1.0.0",
"fs-extra": "^0.26.7",
"json-stable-stringify": "^1.0.1",
......@@ -26,6 +27,7 @@
"node-pngcrush": "^0.3.6",
"parse-domain": "^0.2.1",
"path-extra": "^3.0.0",
"puppeteer": "^0.12.0",
"snufkin": "^0.4.0",
"webshot": "^0.18.0",
"whois": "^2.1.5"
......
......@@ -24,18 +24,12 @@ Inquiry is a tool that runs inspections on [the domains currently being tracked
## Installation
Update: Headless Chrome version. Until we automate this, make sure you have Chrome installed first.
```bash
./install
```
## Usage
Update: Headless Chrome version. Until we automate this, make sure Headless Chrome is running first:
`chrome --headless --disable-gpu --remote-debugging-port=9222`
```bash
./inspect <URL> : non-interactive
./inspect <URL> -i : interactive
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment