I have seen usage of this as the shared worker context, but also self in other documentations.
Which one should I use ?
Examples of personal service positions include: medical assistants and other healthcare support positions, hairdressers, ushers, and transportation attendants. Examples of cleaning service positions include: cleaners, janitors, and porters.
Service workers are specialized JavaScript assets that act as proxies between web browsers and web servers. They aim to improve reliability by providing offline access, as well as boost page performance.
To run code using service workers, you'll need to serve your code via HTTPS — Service workers are restricted to running across HTTPS for security reasons.
self is guaranteed to point to the ServiceWorkerGlobalScope in which you can find properties such as clients, registration or caches and a variety of event handlers. In the other hand, this obeys the same rules about dynamic binding as in the rest of the JavaScript environment. It does not matter always you remember this but my advice is to use self when you want to refer the global context specifically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With