aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2015-02-12 23:12:08 +0100
committerPetter Reinholdtsen <pere@hungry.com>2015-02-12 23:12:08 +0100
commit494525b183388b48a93c86e44fe32e199617fbca (patch)
treed000a740cff6e4caddc1415d6323a8cc0cd3fedf
parent39a078c295232f72318aa3b7f4c7f0646f4bb9b0 (diff)
Avoid hanging forever.
-rw-r--r--netsniff.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/netsniff.js b/netsniff.js
index b702543..6884452 100644
--- a/netsniff.js
+++ b/netsniff.js
@@ -1,3 +1,7 @@
+// from http://stackoverflow.com/questions/16846506/phantomjs-timeout
+// stop after 20 sec ( add this before you request your webpage )
+setTimeout(function() {phantom.exit();},20000);
+
if (!Date.prototype.toISOString) {
Date.prototype.toISOString = function () {
function pad(n) { return n < 10 ? '0' + n : n; }