From the course: JavaScript: Service Workers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Understand the scope - JavaScript Tutorial
From the course: JavaScript: Service Workers
Understand the scope
- [Instructor] We have already mentioned that every service worker has one scope. We know that the scope, it's basically a domain, a port number, and also a path, that can also be the root folder. So, the service worker will manage everything that happens, within that scope. So, for example, if the scope is https://linkedin.com, then here we can see several examples that will be managed by the service worker. So, linkedin.com, so the home page, will be managed by the service worker, the same as /about, or /assets/static/terms.pdf, or anything inside that domain. But if we are going to a different port, such as linkedin.com:1800, that's not managed by that service worker, because it's a different scope. The same happens if there is a subdomain, such as learning.linkedin.com. It's a completely different scope. If you define the scope as a subfolder of your domain, such as linkedin.com/pwa, then now, the homepage of linkedin.com or /about are not part of that scope. Only files or…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Hello, service workers5m 26s
-
(Locked)
Abilities3m 29s
-
(Locked)
What we can do3m 55s
-
(Locked)
Requirements and compatibility3m 42s
-
(Locked)
Service workers in action4m 8s
-
(Locked)
Understand the life cycle5m 1s
-
(Locked)
See all service worker registrations3m 13s
-
(Locked)
Understand the scope5m 20s
-
(Locked)
Learn vocabulary and concepts3m 46s
-
-
-
-
-
-
-