Changes

Jump to: navigation, search

DPS921/Web Worker API

1,717 bytes added, 04:37, 5 December 2020
m
References
== Other Workers ==
 
=== Service Worker ===
 
As a type of Web Worker, the Service Worker is a also a JavaScript source file that runs in the background of the browser on a thread that is separated from the main thread. It acts as a proxy server between the application on the browser and the Internet. It is euqipped with utilities that help intercept network request and perform some actions with that requests. Those actions include relaying the request to its intneded destination, dropping the request, caching of the request contents or responding to the request with the cached data. In addition, it can act on the requests differently based on each of the request or the current network status.
 
For those utilities, the Service Worker enables your applications to be capable of working offline. It allows the developer to write the strategies for that such as "network-first-then-cache", "cache-first-then-network" or "cache-only"...etc. Service Worker is an essential component of any Progressive Web App (PWA).
 
=== Chrome Worker ===
 
This type of Web Worker allows the developer to write privileged codes by giving them accesses to low-level functions. Specifically, the worker gives us access to [https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes js-ctypes] that allows an application to extend or call native codes written in C or C++.
 
This feature is not standardized and might be or already have been removed from many browsers.
= References =
<ol>
<li>HTML Living Standard, Web Workers: https://html.spec.whatwg.org/multipage/workers.html. Last updated: 2 Dec. 2020.</li> <li>MDN Web Docs, Web Worker API: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API. Last updated: 26 Aug. 2020.</li> <li>Can I use..., Support tables for HTML5, CSS3, etc. , Web Workers: https://caniuse.com/webworkers. Last updated: 30 Nov. 2020.</li> <li>Can I use..., Support tables for HTML5, CSS3, etc. , Shared Workers: https://caniuse.com/sharedworkers. Last updated: 30 Nov. 2020.</li> <li>HTML5Rocks, The Problem: JavaScript Concurrency: https://www.html5rocks.com/en/tutorials/workers/basics/. Last updated: 26 Jul. 2020.</li><li>MDN Web Docs, Service Worker API: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API. Last updated: 16 Nov. 2020.</li><li>MDN Web Docs, ChromeWorker: https://developer.mozilla.org/en-US/docs/Mozilla/Gecko/Chrome/API/ChromeWorker. Last updated: 18 Feb. 2020.</li>
</ol>

Navigation menu