var e,o=require("webpage"),n=require("system"),s=n.args[n.args.length-1];!function n(i){(e=o.create()).windowName="my-window",e.settings.webSecurityEnabled=!1,e.onNavigationRequested=function(o,i,c,r){r&&o!=s&&(s=o,e.close(),n(o))},e.onConsoleMessage=function(e){console.log("console: "+e)},e.onError=function(e,o){console.log("error:",e),o.forEach(function(e){console.log("  ",e.file,":",e.line)})},e.open(i,function(e){"success"!==e&&phantom.exit(1)})}(s);