Open Bug 1706353 Opened 3 years ago Updated 11 months ago

page.navigate times out when navigation changes processes (fission, COOP headers, parent process)

Categories

(Remote Protocol :: CDP, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

(Blocks 1 open bug)

Details

From https://github.com/puppeteer/puppeteer/issues/6940

Our current CDP implementation doesn't support process changes, so if a navigation triggers a process change, we will timeout.

In practice, the ContentProcessSession has no access to the new browsing context we want to debug, and the navigation never resolves (we never catch the DOMWindowCreated event https://searchfox.org/mozilla-central/rev/b6f52976b562008c9d9ceeda22907e1eda506c8e/remote/cdp/observers/ContextObserver.jsm#90)

There are several use cases which can lead to a process change:

  • navigating to/from a page which sets Cross-Origin-Opener-Policy (COOP) headers (even when Fission is disabled)
  • when Fission is enabled, navigating to a page with a different eTLD+1
  • navigating from a page in parent process (eg about: pages) to a page in content process (even when Fission is disabled)

Even if we don't aim to add support for this in CDP, it could be interesting to listen for TabRemotenessChange events on the XULTab we are targetting in order to detect such process changes and fail with a better error message.

Fission Milestone: --- → ?

IIUC, this bug is about experimental CDP support and doesn't need to block Fission MVP.

Fission Milestone: ? → Future

The better way here might actually be to listen for XULFrameLoaderCreated events that occur whenever a top-level browsing context gets changed, which actually only happens for cross-group navigations:

https://firefox-source-docs.mozilla.org/dom/navigation/nav_replace.html

This specific event will also be used in Marionette once my patch bug 1704697 gets landed.

See Also: → 1704697

We decided to wait for now if more reports are coming in. If yes, we will re-prioritize the bug.

Whiteboard: [webdriver:triage]

No new reports for 3 months (either here or on Github). Setting P3/S3.

Severity: -- → S3
Priority: -- → P3

I picked the top 500 sites from https://moz.com/top500 for testing, whereby I'm not how up-to-date these are. But at least it should give us a glimpse into how often we might hang during navigation. From all the sites some were not valid anymore, and the biggest amount of sites actually finish the navigation, which is great. But for the following list our navigation in CDP always runs into a timeout:

let pages = [
  "accounts.google.com",
  "adssettings.google.com",
  "digitaltrends.com",
  "draft.blogger.com",
  "drive.google.com",
  "groups.google.com",
  "instagram.com",
  "m.me",
  "myaccount.google.com",
  "news.google.com",
  "photos.google.com",
  "picasaweb.google.com",
  "play.google.com",
  "plus.google.com",
  "si.edu",
  "sina.com.cn",
  "translate.google.com",
  "twitter.com",
  "wa.me",
  "whatsapp.com",
  "www.blogger.com",
  "xinhuanet.com",
];

There is mostly Google specific sites that seem to use COOP headers, which cause timeouts.

Fission Milestone: Future → ---

page.goto is actually the API from Puppeteer. In CDP the command is page.navigate.

Summary: page.goto times out when navigation changes processes (fission, COOP headers, parent process) → page.navigate times out when navigation changes processes (fission, COOP headers, parent process)
You need to log in before you can comment on or make changes to this bug.