PWA Tutorial for Beginners #8 - Registering a Service Worker

preview_player
Показать описание
In this PWA tutorial I'll show you how to check if service workers are supported in browsers & then register a service worker if they are.

----------------------------------------

🐱‍💻 🐱‍💻 Course Links:

🐱‍💻 🐱‍💻 Other Related Courses:

Рекомендации по теме
Комментарии
Автор

i like how everything you talk about is important to know about service workers

sohjunwen
Автор

So nice to watch this amazing tutorial from Korg, the pile of rocks himself (am I the only one who feels the resemblance in the voice and accent? 🤭)

Loug
Автор

First of all, Thank you! Your PWA playlist is actually better than the Google's PWA playlist.

Secondly, shouldn't the script source in about.html and contact.html be "../js/ui.js"? In relative path we have to go one directory up to reach the project folder to access the js folder.

I've linked them as shown in the video and they are working, but I have no idea WHY they are working. Does this have something to do with start_url property in manifest.json?

uzairazizsuria
Автор

You explain everything very well!, thank you!

code_pilot
Автор

And somehow those service workers run without my permission clogging up valuable resources. 🙄 how do you stop random websites from registering a service worker?

StijnHommes
Автор

how would you overcome the problem if you deploy the site and it's not secured in an HTTP site?

el
Автор

What is my server root in a Flask app? I have a 'static' folder where I put (and serve) my css, js, images, etc. from - that is also where I put my manifest.json but I then had to serve it from my app with a specific route. Would it be correct to do the same with sw.js?

MojaveHigh
Автор

My service worker doesn't show up. When checking the manifest.json file, it says, "Service worker is not registered or does not control the Start URL". I downloaded the git files and replaced what I had, added in the new js script tags, reopened Chrome after clearing cache, but no luck. Console has no feedback and no service worker object". Mac OSX 10.14. Chrome 74.

HoganPowerlifting
Автор

hey anyone, I've noticed we are putting a lot of the same exact code in each html file, would it be plausible to but all that code in one file and then just put a reference to that file in each html file?

pagevpetty
Автор

Hey man, love your content, following along in my own little project and getting this error:
The script has an unsupported MIME type ('text/html'). app.js:4
Uncaught (in promise) ReferenceError: err is not defined at app.js:4


Made sure code matches your, where did i go wrong lol
Thanks in advance.

bigCeffie