CoreWebView2ServiceWorkerManager.ServiceWorkerRegistered Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration)
for more information.
public event EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2ServiceWorkerRegisteredEventArgs> ServiceWorkerRegistered;
member this.ServiceWorkerRegistered : EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2ServiceWorkerRegisteredEventArgs>
Public Custom Event ServiceWorkerRegistered As EventHandler(Of CoreWebView2ServiceWorkerRegisteredEventArgs)