-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish Navigation URLs and Frame URLs #13706
Comments
Interesting development, I think we can use Edit: Perhaps not, I was hoping the |
From our discussions in #13819, it seems like we have 3 bikeshedding decisions to make:
I'm not including My preferences: |
brendan also pitched "navigated"/"navigation" for the |
Terminology
This doesn't have to stick, I just need it to make writing the issue easier.
Page.frameNavigated
events.history.pushState
or anchor links without making an additional network request or performing a hard navigation.Page.getFrameTree
.page.url()
function (wrapped bydriver.url()
).Problem
For navigations, gatherers need to know the navigated URL in order to find the main document, and there can be issues if the frame URL is provided instead. #13699 will ensure consistent use of the navigation URL for navigation mode. However, timespan and snapshot mode cannot resolve the navigated URL without
Page.frameNavigated
events, so they must use the frame url withpage.url()
instead.In the LHR
requestedUrl
/finalUrl
, we use the nav URL which can be confusing to the end user who probably expects the frame URL #13697. Again, this does not apply timespan/snapshot which have to use the frame URL everywhere.Once #13699 is merged the following shows when each "type" of URL will be returned from different sources:
context.url
artifacts.URL
lhr.requestedUrl
/lhr.finalUrl
driver.url()
/page.url()
Solution
To ensure the "type" of URL is consistant in all three modes, I propose the following setup:
context.url
artifacts.URL.*
lhr.requestedUrl
lhr.finalUrl
driver.url()
/page.url()
New
URL
artifact:Some notes on the above proposal:
context.url
is deprecate because we can get the Nav URL fromartifacts.URL
and the frame URL fromdriver.url()
lhr.requestedUrl
will be an optional property that only appears on navigation LHRs.initialUrl
to be a staple of everyartifacts.URL
about:blank
on most navigations.Implementation Plan
initialUrl
andmainDocumentUrl
to theartifacts.URL
.artifacts.URL.finalUrl
toartifacts.URL.mainDocumentUrl
context.url
requestedUrl
undefined in timespan/snapshot onartifacts.URL
and the LHRfinalDisplayedUrl
and deprecatefinalUrl
mainDocumentUrl
to the LHRinitialUrl
and hold until we actually need itRelated
#8984
The text was updated successfully, but these errors were encountered: