RESOLVED FIXED Bug 231771
Add a callback to know when the service worker loads via -[WKWebView _loadServiceWorker:]
https://bugs.webkit.org/show_bug.cgi?id=231771
Summary Add a callback to know when the service worker loads via -[WKWebView _loadSer...
Timothy Hatcher
Reported 2021-10-14 14:17:51 PDT
Currently there is no way to know the service worker has loaded. Currently `webView:didFinishNavigation:` fires early and the service worker loads after this. A new delegate or a completion handler on _loadServiceWorker: would be great. The completion handler should likely pass an `NSError`, or `bool` for success or failure reporting.
Attachments
Patch (21.25 KB, patch)
2021-10-18 09:44 PDT, Chris Dumez
no flags
Patch (21.54 KB, patch)
2021-10-18 11:16 PDT, Chris Dumez
no flags
Patch (24.01 KB, patch)
2021-10-18 12:37 PDT, Chris Dumez
no flags
Radar WebKit Bug Importer
Comment 1 2021-10-14 14:26:23 PDT
Chris Dumez
Comment 2 2021-10-18 09:44:33 PDT
Chris Dumez
Comment 3 2021-10-18 11:16:58 PDT
Alex Christensen
Comment 4 2021-10-18 12:08:02 PDT
Comment on attachment 441624 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=441624&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:4812 > + m_serviceWorkerLaunchCompletionHandler(false); I think you need this in the destructor too.
Chris Dumez
Comment 5 2021-10-18 12:09:33 PDT
(In reply to Alex Christensen from comment #4) > Comment on attachment 441624 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=441624&action=review > > > Source/WebKit/UIProcess/WebPageProxy.cpp:4812 > > + m_serviceWorkerLaunchCompletionHandler(false); > > I think you need this in the destructor too. Good point, will fix.
Chris Dumez
Comment 6 2021-10-18 12:37:34 PDT
EWS
Comment 7 2021-10-18 15:21:48 PDT
Committed r284406 (243179@main): <https://commits.webkit.org/243179@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 441631 [details].
Note You need to log in before you can comment on or make changes to this bug.