mirror of https://github.com/vitalif/phantomjs
Fix potential hang in the example scripts due to missing exit() call.
Patch by Jônatas Pedraza <jonatas.nona@gmail.com> and Vivek Galatage <vivekgalatage@gmail.com>. http://code.google.com/p/phantomjs/issues/detail?id=9221.8
parent
15fe514025
commit
9c0888d54d
|
@ -28,6 +28,7 @@ else
|
|||
page.open address, (status) ->
|
||||
if status isnt 'success'
|
||||
console.log 'FAIL to load the address'
|
||||
phantom.exit()
|
||||
else
|
||||
window.setTimeout ->
|
||||
sniffed = page.evaluate(->
|
||||
|
|
|
@ -41,6 +41,7 @@ if (system.args.length === 1) {
|
|||
page.open(address, function (status) {
|
||||
if (status !== 'success') {
|
||||
console.log('FAIL to load the address');
|
||||
phantom.exit();
|
||||
} else {
|
||||
window.setTimeout(function () {
|
||||
sniffed = page.evaluate(function () {
|
||||
|
|
|
@ -21,6 +21,7 @@ if (system.args.length < 3 || system.args.length > 5) {
|
|||
page.open(address, function (status) {
|
||||
if (status !== 'success') {
|
||||
console.log('Unable to load the address!');
|
||||
phantom.exit();
|
||||
} else {
|
||||
window.setTimeout(function () {
|
||||
page.render(output);
|
||||
|
|
Loading…
Reference in New Issue