-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Update marking of navigation timing to include Service Worker Timing #6670
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give a more detailed pointer to the tests? Thanks!
source
Outdated
<var>navigationType</var>.</p></li> | ||
data-x="concept-request-redirect-count">redirect count</span>, <var>navigationType</var>, and | ||
<span data-x="navigation-params-response">response</span>'s <span | ||
data-x="concept-response-service-worker-timing-info">service worker timing info</span>.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this should be next to "response's timing info" or perhaps we should just pass along response?
Also, where are the TAO checks happening for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to pass along the response, to make it clear that navigation timing doesn't keep a response handle. But I don't mind going down that route to simplify.
There are no TAO checks in navigation timing (navigation is always "same origin", and IFrame TAO is handled separately)
I will post a new patch with a different order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are ways you can consider navigation to be same-origin, but I'm not sure it's that straightforward. If a user clicks a link to A, that redirects to B, that redirects to C, why should C be allowed to observe there were 2 redirects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are ways you can consider navigation to be same-origin, but I'm not sure it's that straightforward. If a user clicks a link to A, that redirects to B, that redirects to C, why should C be allowed to observe there were 2 redirects?
This is a general question about Navigation Timing, but not entirely related to TAO. CC @yoavweiss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarifying: we already to a cross-origin check in HTML for redirectCount
. It's unrelated to TAO. We can use that same check to hide thing TAO-wise, I don't know if this is how things are in the current implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing something, but:
- I see where this flag is scrubbing the unload time information in step 5 of update the session history
- I don't see it doing the same for
redirectCount
before calling "Create the Navigation Timing entry" in Initialize the Document object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, maybe it's missing. It's been a while since I've worked on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@yoavweiss can point out if there are more relevant tests. Probably more is better. |
Apologies for the delay :/ |
What is the status on this, @annevk @yoavweiss @noamr? |
Service Workers now expose a "service worker timing info" that is associated with a request. HTML should pass it to Navigation Timing together with the other info. See also w3c/navigation-timing#143 and w3c/ServiceWorker#1575
What else is missing? From my end I feel it's complete. There could always be more tests but I'm not sure what's missing specifically. This spec change reflects current behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks okay now, though I haven't done a full audit. Could you suggest an updated commit message that also accounts for the redirectCount change in a new comment?
Thanks! Updated the issue description (that’s where I’m supposed to suggest an updated commit message, right?) |
Usually we do it in a comment, but that works. Thanks! |
Service Workers now expose a "service worker timing info" that
is associated with a request. HTML should pass it to Navigation Timing
together with the other info.
Amend the parameters passed when creating the navigation timing info entry to include the service worker timing info. Also, pass 0 for
redirectCount
When cross-origin redirects occurred as part of the navigation.See also w3c/navigation-timing#143
and w3c/ServiceWorker#1575
[x ] At least two implementers are interested (and none opposed):
This is already in Chromium+Gecko implementation
/browsing-the-web.html ( diff )
/infrastructure.html ( diff )
/browsing-the-web.html ( diff )
/infrastructure.html ( diff )