ServiceWorkerContainer.idl 1.2 KB

1234567891011121314151617181920212223242526272829
  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. [FIXME, NewObject] Promise<(ServiceWorkerRegistration or undefined)> getRegistration(optional USVString clientURL = "");
  12. [FIXME, NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
  13. [FIXME] undefined startMessages();
  14. // events
  15. [FIXME] attribute EventHandler oncontrollerchange;
  16. [FIXME] attribute EventHandler onmessage; // event.source of message events is ServiceWorker object
  17. [FIXME] attribute EventHandler onmessageerror;
  18. };
  19. dictionary RegistrationOptions {
  20. USVString scope;
  21. WorkerType type = "classic";
  22. ServiceWorkerUpdateViaCache updateViaCache = "imports";
  23. };