Last active
December 19, 2015 06:29
-
-
Save johanlunds/5912015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options, page; | |
options = { | |
url: phantom.args[0] || 'http://127.0.0.1:3000/jasmine', | |
timeout: parseInt(phantom.args[1] || 5000), | |
specdoc: phantom.args[2] || 'failure', | |
focus: /true/i.test(phantom.args[3]), | |
console: phantom.args[4] || 'failure', | |
errors: phantom.args[5] || 'failure' | |
}; | |
page = require('webpage').create(); | |
page.onError = function(msg, trace) { | |
console.log(msg, trace); | |
}; | |
page.onConsoleMessage = function(msg, line, source) { | |
console.log(msg, line, source); | |
}; | |
page.open(options.url, function(status) { | |
page.onLoadFinished = function() { phantom.exit() }; | |
if (status !== 'success') { | |
console.log(JSON.stringify({ | |
error: "Unable to access at " + options.url | |
})); | |
return phantom.exit(); | |
} | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title></title> | |
<script type="text/javascript"> | |
var ls = window.localStorage; | |
var idb = window.indexedDB || window.webkitIndexedDB; | |
console.log("localstorage type: ", typeof ls); | |
console.log("indexedDb type: ", typeof idb); | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment