[w3c/ServiceWorker] Service worker client URL discrepancy (#1515)

According to the spec, the service worker (window) client URL is the creation URL. Edge (44.18362.449.0) and Firefox (76.0.1) appears to adhere to this specification to the letter. Chrome (83.0.4103.61) returns the URL including any fragment that was added later by navigating within the page, in contrast to the other two.

This means that when comparing the client window URL to the URL from the event from a notificationclick, the comparison will work in Chrome and fail in FF and Edge, if the user navigated within the page using fragments after the page loaded.

There is an [example on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Clients/openWindow) that describes how to compare these two URLs to find the right window the notification is for. If the user has navigated on the page using a hash fragment in the meanwhile, this comparison will fail (in FF and Edge). While the spec for fragments is pretty clear that they form an intrinsic part of the URI, it also states that: 

> (it) allows indirect identification of a secondary resource by reference to a primary resource and additional identifying information.

Which interpretation of the spec is correct here?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1515

Received on Thursday, 28 May 2020 21:19:27 UTC