NavigationPreloadManager

Overview

The NavigationPreloadManager interface of the the Service Worker API provides methods for managing the preloading of resources with a service worker.

Location

Required Methods


disable

Returns a Promise that resolves when navigation preloading is disabled.

 

method disable: dynamic

 

dynamic disable()

 

func disable() -> dynamic

 

dynamic disable()

 

Function disable() As dynamic

enable

Returns a Promise that resolves when navigation preloading is enabled.

 

method enable: dynamic

 

dynamic enable()

 

func enable() -> dynamic

 

dynamic enable()

 

Function enable() As dynamic

getState

Returns a Promise that resolves to an object with properties indicating whether preload is enabled and the contents of the Service-Worker-Navigation-Preload.

 

method getState: dynamic

 

dynamic getState()

 

func getState() -> dynamic

 

dynamic getState()

 

Function getState() As dynamic

setHeaderValue

Sets the value of the Service-Worker-Navigation-Preload header and returns an empty Promise.

 

method setHeaderValue: dynamic

 

dynamic setHeaderValue()

 

func setHeaderValue() -> dynamic

 

dynamic setHeaderValue()

 

Function setHeaderValue() As dynamic