CanonicalURLChild does not detect pageshow after back button on some sites
Categories
(Firefox :: Tabbed Browser, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: sthompson, Assigned: sthompson)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidefe-tabgrps])
Attachments
(1 file)
Tab notes requires that we detect page content canonical URLs when URLs change. On history navigation, we leave the existing canonicalUrl in place on the tab based on the expectation that the page will emit pageshow when the history navigation is complete. https://searchfox.org/firefox-main/rev/131497bb1b747587b2b21b1abf14f44ecffad805/browser/components/tabnotes/TabNotesController.sys.mjs#208-221 However, on a number of sites, we've observed cases where the back/forward buttons do not yield pageshow:
- x.com
- github.com
- facebook.com
- instagram.com
- reddit.com
Entry #6 in the list https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event#when_popstate_is_sent describes how pageshow should be emitted during history navigations on sites like these that use history.pushState, so it's not clear what is happening on these sites.
We need to investigate the problem and, hopefully, implement a way to ensure that we always re-detect the canonical URL after a history navigation.
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 1•6 months ago
|
||
When using the browser history/back/forward to navigate on sites that use history.pushState, pageshow won't be fired, so we weren't re-parsing the page when we got there.
Listening for popstate helps because it is emitted at the end of the history navigation. However, re-parsing the document immediately on popstate always yields the "previous" page's content. Re-parsing after an immediate timeout worked on some sites (reddit.com, x.com) but not other sites (github.com). I think this patch is good enough to mitigate problems on single page app web sites, but we may need follow up(s) that give web sites more time after popstate to update their document contents.
Comment 3•6 months ago
|
||
| bugherder | ||
Updated•6 months ago
|
Updated•5 months ago
|
Description
•