Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Service workers in browser extensions are not able to load resources …
…over a custom protocol https://bugs.webkit.org/show_bug.cgi?id=242871 <rdar://96973622> Reviewed by Geoffrey Garen and Timothy Hatcher. Loads from service workers could not get serviced by a custom scheme handler. Part of the issue is that the custom scheme handlers as per WKWebView but service workers can be shared by many web views. However, the service workers from browser extensions are special in that they run on the main thread and they have a tight coupling with a WKWevView (and its internal service worker page). In WebLoaderStrategy::tryLoadingUsingURLSchemeHandler(), we now add support for service workers from browser extensions by using the URL scheme handlers from their associated service worker page. Regular / traditional service workers still have no support for custom scheme handlers and this is something we should consider fixing in the future. However, this patch takes care of extension service workers, which is what the radar is about since they rely on custom scheme handlers to do loads from the extension bundle. This is an important use case we need to support ASAP. * Source/WebCore/page/Page.cpp: (WebCore::Page::serviceWorkerPage): * Source/WebCore/page/Page.h: * Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp: (WebCore::ServiceWorkerGlobalScope::serviceWorkerPage): * Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler): * Source/WebKit/WebProcess/Storage/RemoteWorkerFrameLoaderClient.h: * Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): * Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: (-[ServiceWorkerSchemeHandler webView:startURLSchemeTask:]): Canonical link: https://commits.webkit.org/252585@main
- Loading branch information
Showing
7 changed files
with
51 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters