WWW-Mechanize-PhantomJS

 view release on metacpan or  search on metacpan

lib/WWW/Mechanize/PhantomJS.pm  view on Meta::CPAN

        $options{ driver }->commands->get_cmds->{get}->{no_content_success}= 0;
    };

    # if PhantomJS started, but so slow or unresponsive that SRD cannot connect to it,
    # kill it manually to avoid waiting for it indefinitely
    if ( $@ ) {
        kill 9, delete $options{ pid } if $options{ kill_pid };
        die $@;
    }

     my $self= bless \%options => $class;

     $self->eval_in_phantomjs(<<'JS');
         var page= this;
         page.errors= [];
         page.alerts= [];
         page.confirms= {};
         page.onError= function(msg, trace) {
             //_log.warn("Caught JS error", msg);
             page.errors.push({ "message": msg, "trace": trace });
         };



( run in 0.294 second using v1.01-cache-2.11-cpan-65fba6d93b7 )