Service Workers can navigate out-of-scope clients
Categories
(Core :: DOM: Service Workers, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox76 | --- | fixed |
People
(Reporter: twiss, Assigned: twiss)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Steps to reproduce:
- Open https://out-of-scope-sw-navigation.glitch.me/test/
- In another tab, open https://out-of-scope-sw-navigation.glitch.me/
- In the first tab, click "Try to navigate"
This sends a request to the service worker (scoped to /test/) which then attempts to navigate the second client to /test/ as well.
Actual results:
The second tab is navigated. The service worker's console outputs:
[fetch event] https://out-of-scope-sw-navigation.glitch.me/test/navigate
scope: https://out-of-scope-sw-navigation.glitch.me/test/
controlled clients: Array [ WindowClient ]
all clients: Array [ WindowClient, WindowClient ]
navigated client to /test/
Expected results:
This navigation should not be allowed, as discussed in https://github.com/w3c/ServiceWorker/issues/752.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
Unfortunately, some of the above web platform tests are currently broken (the "NOTRUN" ones). I've submitted a PR here: https://github.com/web-platform-tests/wpt/pull/22063.
With that PR and the above patch, Firefox passes all tests.
Updated•6 years ago
|
Comment 4•6 years ago
|
||
Mark dependency on the WPT fix https://github.com/web-platform-tests/wpt/pull/22063 being synced to mozilla-central in bug 1619613.
Comment 6•6 years ago
|
||
| bugherder | ||
Comment 7•6 years ago
|
||
Woo! Thanks so much for the fix!
Description
•