Skip to content

Instantly share code, notes, and snippets.

@matthewp
Created May 26, 2014 21:11
Show Gist options
  • Save matthewp/9906c438e22cadf0e450 to your computer and use it in GitHub Desktop.
Save matthewp/9906c438e22cadf0e450 to your computer and use it in GitHub Desktop.
Phantom + Traceur
var page = require('webpage').create();
page.onError = function(msg, trace){
console.log(msg, trace);
};
page.open('http://localhost/phantom_traceur/test.html', function() {
phantom.exit();
});
function debugPage() {
console.log("Refresh a second debugger-port page and open a second webkit inspector for the target page.");
console.log("Letting this page continue will then trigger a break in the target page.");
debugger; // pause here in first web browser tab for steps 5 & 6
page.evaluateAsync(function() {
debugger; // step 7 will wait here in the second web browser tab
});
}
//debugPage();
<html>
<head><title>Phantom test</title></head>
<body>
<script src="traceur.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment