I have to apologize - you reported this problem as a bug in WWW::Mechanize::Chrome and I rejected that bug because I could not reproduce it. But it is an actual bug. With your posted code above, I can easily reproduce the issue and the problem is that the code does not cope with a Page.navigatedWithinDocument element at all.

I've added the following code to WWW::Mechanize::Chrome, which should fix that issue, or at least not crash anymore:

} elsif ( my $res = $events{ 'Network.responseReceived' }) { #warn "Network.responseReceived"; $response = $self->httpResponseFromChromeResponse( $res ) +; $response->request( $request ); + } elsif ( my $res = $events{ 'Page.navigatedWithinDocument' }) { + # A fake response, just in case anybody checks + $response = HTTP::Response->new( + 200, # is 0 for files?! + "OK", + HTTP::Headers->new(), + ); + $response->request( $request );

A new version of WWW::Mechanize::Chrome is just testing and then on its way onto CPAN.


In reply to Re: Unable to automate login to Twitter with WWW::Mechanize::Chrome by Corion
in thread Unable to automate login to Twitter with WWW::Mechanize::Chrome by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.