Service worker scope
As mentioned earlier, service workers are limited to a single domain. The domain is your site's address, such as https://podcast.love2dev.com/. This is a security feature. Limiting a service worker is known as the service worker's scope. This prevents external scripts from doing bad things to your site.
Imagine if your customer also visits your competition's web site, which installs a service worker. Without limits on service worker scope, they could conceivably manipulate your content or spy on you and your customer's private data.
In fact, a third-party script cannot register a service worker from a page on your site. This should keep external scripts and service providers from using service workers in conjunction with ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access