package brr

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Service_worker.ContainerSource

Service worker containers.

Sourcetype t

The type for ServiceWorkerContainer objects.

Sourceval of_navigator : Brr.Navigator.t -> t

of_navigator n is the service worker container of navigator n.

Sourceval as_target : t -> Brr.Ev.target

as_target c is c as an event target.

Sourceval controller : t -> service_worker option

controller c is the active service worker if any.

ready c is a future that resolves when a service worker is active.

Sourcetype register_opts

The type for worker registration options.

Sourceval register_opts : ?scope:Jstr.t -> ?type':Worker.Type.t -> ?update_via_cache:Update_via_cache.t -> unit -> register_opts

register_opts ~scope ~type ~update_via_cache () are registration options with given properties.

Sourceval register : ?register_opts:register_opts -> t -> Jstr.t -> Registration.t Fut.or_error

register c script_uri ~register_opts creates or updates a registration with script_url.

Sourceval get_registration : t -> Jstr.t option -> Registration.t option Fut.or_error

get_registration c url is the registration for url (if any).

Sourceval get_registrations : t -> Registration.t list Fut.or_error

get_registrations c are all the registration fo c.

Sourceval start_messages : t -> unit

start_messages c starts the flow of messages from the service worker to the pages.