BiDi load and domContentLoaded events use document baseURI instead of the target URL of the navigation
Categories
(Remote Protocol :: WebDriver BiDi, defect, P1)
Tracking
(firefox114 fixed)
Tracking | Status | |
---|---|---|
firefox114 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
Details
(Whiteboard: [webdriver:m7][wptsync upstream][webdriver:relnote])
Attachments
(2 files)
The BiDi spec defines the url
of navigation status
at https://w3c.github.io/webdriver-bidi/#module-browsingContext
The URL which is being loaded in the navigation
This navigation status url is used to build the payload of the load and domContentLoaded events, as part of the navigation info.
On the implementation side, we used document.baseURI to retrieve this url: https://searchfox.org/mozilla-central/rev/1157486abdf3245c2d3bf425745314c090745de5/remote/webdriver-bidi/modules/windowglobal/browsingContext.sys.mjs#41
However on pages which define a <base>
meta this can significantly differ from the loaded URL.
For instance on https://dashboard.sitespeed.io/d/9NDMzFfMk/page-metrics-desktop?orgId=1&var-base=sitespeed_io&var-path=desktop&var-testname=spa&var-group=dashboard_sitespeed_io&var-page=pageTimingMetricsDefault&var-browser=chrome&var-connectivity=cable&var-function=median&var-resulturl=https:%2F%2Fdata.sitespeed.io%2F&var-screenshottype=jpg , document.baseURI
will be https://dashboard.sitespeed.io/
.
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Comment 1•8 months ago
|
||
For reference, switching from document.baseURI
to document.URL
seems to fix the HAR generation issue spotted over at https://github.com/sitespeedio/browsertime/issues/1925
Assignee | ||
Comment 2•8 months ago
|
||
Updated•8 months ago
|
Assignee | ||
Comment 3•8 months ago
|
||
Depends on D174173
Assignee | ||
Comment 4•8 months ago
|
||
James,
Can you confirm we should not use the document's baseURI for our load events? Reading the spec, I think that's right, but would like to be sure before moving forward with the patches.
Comment 5•8 months ago
|
||
Yeah, the baseURI
is used to resolve relative URLs, it's not the actual URL that will be loaded. Apologies if I missed this earlier.
Assignee | ||
Comment 6•8 months ago
|
||
Thanks James! Will move forward with the patches then.
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/17440e444b7e [bidi] Use document URL for load and domContentLoaded events r=webdriver-reviewers,Sasha https://hg.mozilla.org/integration/autoland/rev/43d40f12fdf7 [wdspec] Add tests for bidi load events with base tags r=webdriver-reviewers,Sasha
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/39497 for changes under testing/web-platform/tests
Updated•8 months ago
|
Comment 9•8 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/17440e444b7e
https://hg.mozilla.org/mozilla-central/rev/43d40f12fdf7
Upstream PR merged by moz-wptsync-bot
Updated•6 months ago
|
Description
•