Service workers & PWA
Në shqip: Service workers dhe PWA
ShpjegimiSQ
Një service worker është skript që qëndron mes faqes dhe rrjetit: ruan skedarë në cache që faqja të punojë offline dhe merr push notifications. Me një manifest, faqja bëhet PWA që instalohet si aplikacion.
EnglishEN
A service worker is a script sitting between the page and the network: it caches files so the site works offline and receives push notifications. With a manifest, the site becomes a PWA installable like an app.
Si ta mendosh
Si një asistent që mban kopje të faqeve kur s'ka internet.
Lexoje në anglisht
Like an assistant keeping copies of pages for when there's no internet.
Shembull kodijavascript
if ("serviceWorker" in navigator)
navigator.serviceWorker.register("/sw.js");