OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <title>Service Workers: ServiceWorkerGlobalScope</title> |
| 4 <head> |
| 5 <link rel="help" href="https://w3c.github.io/ServiceWorker/#service-work
er-global-scope"> |
| 6 <script src="/resources/testharness.js"></script> |
| 7 <script src="/resources/testharnessreport.js"></script> |
| 8 |
| 9 <script src=/resources/WebIDLParser.js></script> |
| 10 <script src=/resources/idlharness.js></script> |
| 11 |
| 12 </head> |
| 13 <body> |
| 14 |
| 15 <script type=text/plain id="idl_0"> |
| 16 [Global] |
| 17 interface ServiceWorkerGlobalScope : WorkerGlobalScope { |
| 18 readonly attribute CacheStorage caches; |
| 19 // A container for a list of window objects, identifiable by ID, that |
| 20 // correspond to windows (or workers) that are "controlled" by this SW |
| 21 readonly attribute ServiceWorkerClients clients; |
| 22 [Unforgeable] readonly attribute DOMString scope; |
| 23 |
| 24 Promise<any> fetch((Request or ScalarValueString) request); |
| 25 |
| 26 void update(); |
| 27 void unregister(); |
| 28 |
| 29 attribute EventHandler oninstall; |
| 30 attribute EventHandler onactivate; |
| 31 attribute EventHandler onfetch; |
| 32 attribute EventHandler onbeforeevicted; |
| 33 attribute EventHandler onevicted; |
| 34 |
| 35 // The event.source of these MessageEvents are instances of Client |
| 36 attribute EventHandler onmessage; |
| 37 |
| 38 // close() method inherited from WorkerGlobalScope is not exposed. |
| 39 }; |
| 40 </pre> |
| 41 |
| 42 <!-- |
| 43 The `ServiceWorkerGlobalScope` interface represents the global execution |
| 44 context of a Service Worker. `ServiceWorkerGlobalScope` object provides |
| 45 generic, event-driven, time-limited script execution contexts that run at an |
| 46 origin. Once successfully [registered][1], a Service Worker is started, kept |
| 47 alive and killed by their relationship to events, not documents. Any type of |
| 48 synchronous requests MUST NOT be initiated inside of a Service Worker. |
| 49 |
| 50 [1]: #navigator-service-worker-register |
| 51 --> |
| 52 |
| 53 |
| 54 <script type=text/plain id="untested_idls"> |
| 55 interface CacheStorage {}; |
| 56 interface ServiceWorkerClients {}; |
| 57 interface Request {}; |
| 58 interface ScalarValueString {}; |
| 59 interface EventHandler {}; |
| 60 interface WorkerGlobalScope {}; |
| 61 </pre> |
| 62 |
| 63 <script> |
| 64 var idl_array = new IdlArray(); |
| 65 idl_array.add_untested_idls(document.getElementById("untested_idls").tex
tContent); |
| 66 idl_array.add_idls(document.getElementById("idl_0").textContent); |
| 67 idl_array.add_objects({ |
| 68 ServiceWorkerGlobalScope: ["throw new Error ('No object defined for
the ServiceWorkerGlobalScope interface')"] |
| 69 }); |
| 70 idl_array.test(); |
| 71 </script> |
| 72 |
| 73 </body> |
| 74 </html> |
| 75 |
OLD | NEW |