NavigationPreloadManager

The NavigationPreloadManager interface of the Service Worker API provides methods for managing the preloading of resources in parallel with service worker bootup. Available only in secure contexts.

MDN Reference

Functions

Link copied to clipboard
suspend fun disable()

The disable() method of the NavigationPreloadManager interface halts the automatic preloading of service-worker-managed resources previously started using NavigationPreloadManager.enable() It returns a promise that resolves with undefined.

Link copied to clipboard
Link copied to clipboard
suspend fun enable()

The enable() method of the NavigationPreloadManager interface is used to enable preloading of resources managed by the service worker.

Link copied to clipboard
Link copied to clipboard

The getState() method of the NavigationPreloadManager interface returns a Promise that resolves to an object with properties that indicate whether preload is enabled and what value will be sent in the Service-Worker-Navigation-Preload HTTP header.

Link copied to clipboard
Link copied to clipboard
suspend fun setHeaderValue(value: String)

The setHeaderValue() method of the NavigationPreloadManager interface sets the value of the Service-Worker-Navigation-Preload header that will be sent with requests resulting from a Window/fetch operation made during service worker navigation preloading.

Link copied to clipboard