Bug 226638
| Summary: | Implement FetchEvent.replacesClientId | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jake Archibald <jaffathecake> |
| Component: | Service Workers | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ahmad.saleem792, gregory.terzian, mail, philip, simon.fraser, webkit-bug-importer, youennf |
| Priority: | P2 | Keywords: | InRadar, WPTImpact |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Jake Archibald
This was renamed in 2018 (https://github.com/w3c/ServiceWorker/pull/1333) but no bug was filed with WebKit, sorry about that. Anyway, this is that bug. I don't expect the rename to cause problems in the wild.
Test to fail if targetClientId is present https://github.com/web-platform-tests/wpt/pull/29213.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Philip Jägenstedt
As part of sorting out many errors in the browser compat data for FetchEvent in https://github.com/mdn/browser-compat-data/pull/10774, I noticed that no browser has shipped replacesClientId yet.
Radar WebKit Bug Importer
<rdar://problem/79189580>
youenn fablet
WebKit exposes targetClientId so I guess we should do the migration to replacesClientId even if no other browser supports it. We can deal with this as part of bug 190313
Sam Sneddon [:gsnedders]
targetClientId was removed in bug 235107, but replacesClientId wasn't implemented.
Gregory Terzian
Can I please tackle this one?
I've tried to follow the flow; is it correct that one should add a String, say "m_replacesClientIdentifier", to the "NetworkResourceLoader" in the network process, and do something similar to what is currently done with "m_resultingClientIdentifier"(propagate it all the way to where the "FetchEvent" is created in "ServiceWorkerFetch" within WebCore)?
youenn fablet
You are more than welcome to contribute :)
This bug might not be the easiest bug to tackle if this is your first WebKit contribution given there is probably few existing tests and no browser is implementing it yet: https://wpt.fyi/results/service-workers/idlharness.https.any.serviceworker.html?label=experimental&label=master&aligned
The principle would be to add to new ScriptExecutionContextIdentifier member to either FetchOptions or ResourceLoaderOptions.
See resultingClientId as an example.
Gregory Terzian
Great!
A quick search indeed did not reveal any wpt test, but there is again the example of testing for the presence of resultingClientId(https://github.com/web-platform-tests/wpt/blob/0a40de7a4db9e52cdb0fc436173640756740c9e3/service-workers/service-worker/fetch-event.https.html#L129)
Thanks for the additional info, I will start looking into this.
Gregory Terzian
Pull request: https://github.com/WebKit/WebKit/pull/13130