Chrome-remote-interface: Page.navigate hangs with angular application

Created on 8 Feb 2018  路  14Comments  路  Source: cyrus-and/chrome-remote-interface

| Component | Version
|-|-
| Operating system | Manjaro Linux
| Node.js | 8.9.4
| Chrome/Chromium/... | 64.0.3282.140
| chrome-remote-interface | 0.25.5

Is Chrome running in a container? NO

When navigating in an angular application, the call to Page.navigate hangs forever.
I bundled a minimal script that triggers this bug: https://gist.github.com/m-rousse/de42a69db1405d82a919689778329c12

If I add a void Page.navigate({url: 'http://localhost:8123/index.html#!/next'}) before line 10 of main.js, the call is successful and the navigation is resumed.
If I reload the page in the browser (using F5), it does also resume the script.

While debugging, I noticed that the Page.navigate command is successfully sent but no response is received. (cf. image)
capture du 2018-02-08 16-01-23

I have this same bug at other calls in my code, and noticeably when using the Debugger.resume command, and the only way out of this being calling the Page.navigate once again.

This might be a problem of chrome itself so I crossposted this issue on the chromium bugtracker (cf. issue)

external issue

All 14 comments

Hm here it seems that is the await Page.loadEventFired(); that hangs, i.e., the event doesn't trigger. I see the following output:

Page 1 loaded
navigate 2 finished

I'm using Chrome 66.0.3343.0 on macOS though.

Same goes for Chrome 64.0.3282.140 on Linux.

the event doesn't trigger

And I guess this is the intended behaviour since there is not actually a page load from a network point of view. If you want to detect an Angular page load you have to manually implement the check.

That's odd, I tried, in a docker this time (with circleci/node:latest-browsers and :8.5.0-browsers), and still have the same result (only Page 1 loaded).
So OK for the loadEventFirst not being triggered.
I am going to try on an Ubuntu 16.04 to double check.

I have the exact same behavior with an Ubuntu 16.04, node 8.9.1, chrome-remote-interface 0.25.5 and Chrome 64.0.3282.119.
My output is only Page 1 loaded.
Do you have any idea why it goes on step further on your side?

Same goes for Chrome 64.0.3282.140 on Linux.

I apologise this is wrong, it works with version 65.0.3325.51, so I assume it was a bug that has been fixed for Chrome >= 65.

So you would suggest to simply use Chrome >= 65?
I have been able to reproduce this bug in a similar manner but I could not factorize it to a simple example.
https://gist.github.com/m-rousse/9330319d662ccc05fdb1d630b3f318ce

This time, the whole tab hangs, I am unable to scroll, execute any other commands and even the video in background freezes (after a few seconds).
It does this with both 64 and 65 (I do not have an OSX/Windows to try with 66).

So you would suggest to simply use Chrome >= 65?

Yes, I mean the original example works with Chrome 65 but it doesn't with Chrome 64, have you tried this one with the former?


About your second example, it hangs because you set up to pause on exceptions and for some reason the debugger does not resume after a Drupal.AjaxError which happens after the synthetic click.

You can even reproduce this manually with DevTools, as soon as you perform the click, an AJAX request is started then immediately cancelled:

2018-02-09-135500_792x40_scrot

This is a different issue IMO. Anyway the debug part is quite fragile in my experience, I would avoid using it if possible.

have you tried this one with the former?

It works with 65 for me too! (When removing the loadEventFired)
However, I do not understand why it does not work with the version 64.
Do you see a reason why the Page.navigate works for you and not for me? (It works if I call it twice)


For the second bug, I will report it to the chromium team.

It works with 65 for me too! (When removing the loadEventFired)

That's right, navigating to a fragment does not trigger a load event.

However, I do not understand why it does not work with the version 64.

Possibly a bug, I guess.

Do you see a reason why the Page.navigate works for you and not for me? (It works if I call it twice)

I though we were on the same page here, the original example works the same for both you and me with Chrome >= 65, right? Namely, the output is Page 1 loaded \n navigate 2 finished then the Page.loadEventFired never fires.

My bad, I did not write it well!
It is okay for both of us for Chrome >= 65.
I was asking about Page.navigate for Chrome 64, but as you say, possibly a bug!
Thank you for your help!

You're welcome!

For the second bug, I will report it to the chromium team.

Feel free to post here the follow up so to help others.

As @paulirish pointed out, the Page.navigate problem is already known so it has been marked as wontfix.
The Debugger issue has been transferred to its own issue: Debugger Agent hangs indefinitely after pause-on-exception pause

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renschler picture renschler  路  5Comments

FergusNelson picture FergusNelson  路  7Comments

paambaati picture paambaati  路  7Comments

puppeteer701 picture puppeteer701  路  4Comments

benjamingr picture benjamingr  路  4Comments