yoavweiss / subresource-reporting

2 stars 0 forks source link

What URL should be reported? #3

Open yoavweiss opened 2 weeks ago

yoavweiss commented 2 weeks ago

ResourceTiming currently reports the request's URL, which is the first URL in the redirect chain (the one that the site initiated).

We could also opt to report the last URL in the redirect chain (the response URL). I believe the response URL is already exposed to Service Workers. At the same time, I'm not sure there's a strong use case for it, and folks may find it confusing. ("How did this URL get here?")

So, I think the request URL is the way to go, unless folks find use cases for the response one.

MrMarvin commented 1 week ago

Without much context, what URL is reported in other reporting mechanisms such as CSP violations? I'd think that request URL is the generally more useful as thats a direct reflection of whats on the page, so using it to both resource timing and subresource reporting makes for a more complete overall picture.

yoavweiss commented 1 week ago

what URL is reported in other reporting mechanisms such as CSP violations?

CSP reports the request URL, as it doesn't have a response at the point in which reporting happens (nor ever, when in enforcement mode).