次の方法で共有


CoreWebView2ServiceWorkerManager Class

This interface manages registrations for service workers in WebView2.

Summary

Members Description
GetServiceWorkerRegistrationsForScope Gets the service worker registrations associated with the specified scope.
GetServiceWorkerRegistrationsAsync Gets a list of the service worker registrations under the same profile.
ServiceWorkerRegistered A ServiceWorker is a specific type of worker that takes a JavaScript file that can control the web-page/site that it is associated with intercepting and modifying navigation and resource requests, and caching resources in a very granular fashion to give you complete control over how app behaves in certain situations.

Methods

GetServiceWorkerRegistrationsForScope

IAsyncOperation<IVectorView<CoreWebView2ServiceWorkerRegistration>> GetServiceWorkerRegistrationsAsync(string scope)

Gets the service worker registrations associated with the specified scope.

GetServiceWorkerRegistrationsAsync

IAsyncOperation<IVectorView<CoreWebView2ServiceWorkerRegistration>> GetServiceWorkerRegistrationsAsync()

Gets a list of the service worker registrations under the same profile.

Events

ServiceWorkerRegistered

A ServiceWorker is a specific type of worker that takes a JavaScript file that can control the web-page/site that it is associated with intercepting and modifying navigation and resource requests, and caching resources in a very granular fashion to give you complete control over how app behaves in certain situations.

Service workers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). They run in a different context from the web page, which means they have no direct access to the DOM. Unlike dedicated and shared workers, which may have direct access to a global scope shared with other scripts, service workers operate in isolation from the DOM, ensuring a more secure and controlled environment.

This event is raised when a web application registers a service worker using the navigator.serviceWorker.register("/sw.js") method. See the Service Worker Registration for more information.

Type: TypedEventHandler<CoreWebView2ServiceWorkerManager, CoreWebView2ServiceWorkerRegisteredEventArgs>

Referenced by