ServiceWorkerContainer.idl 1.3 KB

123456789101112131415161718192021222324252627282930
  1. #import <DOM/EventTarget.idl>
  2. #import <DOM/EventHandler.idl>
  3. #import <HTML/ServiceWorkerRegistration.idl>
  4. #import <HTML/Worker.idl>
  5. // https://w3c.github.io/ServiceWorker/#serviceworkercontainer-interface
  6. [SecureContext, Exposed=(Window,Worker)]
  7. interface ServiceWorkerContainer : EventTarget {
  8. [FIXME] readonly attribute ServiceWorker? controller;
  9. [FIXME] readonly attribute Promise<ServiceWorkerRegistration> ready;
  10. // FIXME: [NewObject] Promise<ServiceWorkerRegistration> register((TrustedScriptURL or USVString) scriptURL, optional RegistrationOptions options = {});
  11. [NewObject, ImplementedAs=register_] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options = {});
  12. [FIXME, NewObject] Promise<(ServiceWorkerRegistration or undefined)> getRegistration(optional USVString clientURL = "");
  13. [FIXME, NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
  14. [FIXME] undefined startMessages();
  15. // events
  16. attribute EventHandler oncontrollerchange;
  17. attribute EventHandler onmessage; // event.source of message events is ServiceWorker object
  18. attribute EventHandler onmessageerror;
  19. };
  20. dictionary RegistrationOptions {
  21. USVString scope;
  22. WorkerType type = "classic";
  23. ServiceWorkerUpdateViaCache updateViaCache = "imports";
  24. };