Skip to content

Expose redirectCount for TAO opted-in redirect chains#12513

Open
yoavweiss wants to merge 3 commits into
whatwg:mainfrom
yoavweiss:tao_on_navigation_redirect
Open

Expose redirectCount for TAO opted-in redirect chains#12513
yoavweiss wants to merge 3 commits into
whatwg:mainfrom
yoavweiss:tao_on_navigation_redirect

Conversation

@yoavweiss

@yoavweiss yoavweiss commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Fixes w3c/navigation-timing#215

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs:
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


/document-lifecycle.html ( diff )
/infrastructure.html ( diff )

@yoavweiss yoavweiss requested a review from noamr June 3, 2026 12:43

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this works. What if one redirect allows it and one doesn't?

@yoavweiss

Copy link
Copy Markdown
Contributor Author

I don't understand how this works. What if one redirect allows it and one doesn't?

I may have gotten this wrong, but I thought TAO check only passes if the entire redirect chain has Timing-Allow-Origin

@annevk

annevk commented Jun 3, 2026

Copy link
Copy Markdown
Member

No, TAO check only looks at a single response. There's https://fetch.spec.whatwg.org/#concept-response-timing-allow-passed but I don't actually know if that works well for navigations. Navigations are messy.

@yoavweiss

yoavweiss commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

I don't actually know if that works well for navigations.

A bit of Claude-assisted digging got me to:

So I think that simply changing the TAO check to looking at the response's timing-allow-passed value should work..

Let me know if you agree

@annevk

annevk commented Jun 3, 2026

Copy link
Copy Markdown
Member

Yeah that looks correct. I think there are still issues with it, but this is not one of them. There is still the question as to whether it's okay that same-origin redirects end up exposed without opt-in.

@yoavweiss

Copy link
Copy Markdown
Contributor Author

There is still the question as to whether it's okay that same-origin redirects end up exposed without opt-in.

Yeah, I'll open a separate issue RE that

@yoavweiss

Copy link
Copy Markdown
Contributor Author

There is still the question as to whether it's okay that same-origin redirects end up exposed without opt-in.

Yeah, I'll open a separate issue RE that

w3c/resource-timing#434

@yoavweiss yoavweiss requested a review from annevk June 4, 2026 06:47
@yoavweiss

Copy link
Copy Markdown
Contributor Author

As discussed yesterday on the WebPerfWG call (and as pointed out by @annevk elsewhere), this is not correct, as we'd need the navigation TAO to opt-in to the destination origin, rather than the source origin. I'll revamp.

@annevk annevk added the do not merge yet Pull request must not be merged per rationale in comment label Jun 5, 2026
@yoavweiss

Copy link
Copy Markdown
Contributor Author

In w3c/navigation-timing#215 (comment) @achristensen07 suggests that we should also take the "noreferrer" values into account. This seems like we could add that condition here.

In the context of Fetch, I'm working on a PR to create navigation-specific TAO checks that look at the destination origin.

@yoavweiss

Copy link
Copy Markdown
Contributor Author

In w3c/navigation-timing#215 (comment) @achristensen07 suggests that we should also take the "noreferrer" values into account. This seems like we could add that condition here.

Thinking about this, I think it makes sense. We can think of it as:

  • The source navigation can opt-out of redirect timing (as it is the one choosing the redirectors) through noreferrer, or through Referrer-Policy.
  • The redirector itself can opt-in to timing through TAO, based on the destination origin

@noamr

noamr commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

As far as implementer support, Chrome team is supportive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge yet Pull request must not be merged per rationale in comment

Development

Successfully merging this pull request may close these issues.

(Re-)Expose redirectCount, redirectStart and redirectEnd for TAO opted-in cross-origin redirects

3 participants