SlideShare a Scribd company logo
S E R V I C E
W O R K E R S
w i t h S a l l y a n d L a r r y
Hi Larry! Let's learn a little
about service workers
today.
Service
Workers...
Do they do
something with
building apps?
That means we can access the app
when we don't have signal?
Exactly! Service workers make
working offline possible.
Yes!
It's a JavaScript file? Does
that mean it works with the
DOM?
Service Workers are just
another JavaScript file
that we create.
No - and that's what
makes it work offline.
Really? How does the service worker
work with the browser?
Even though service workers
don't have access to the DOM it
does have access to the browser
capabilities
I'm glad you asked - it's really
interesting!
Yes, that's right.
When you go to a website you either
type it in or click on a link, right?
Okay, after you type or click on the
URL your computer uses the cables
and satellites to contact the web
server that's hosting your website.
The information you're looking for
is then sent to you on those cables
and satellites from the web server.
Search for
www.hocking.edu
Sees the homepage for www.hocking.edu
For example, if Susie is looking to check
out Hocking College she can do a search
online and click on the link for
www.hocking.edu. Susie's computer uses
cables, radio towers and satellites to find
the server where the Hocking College
website is hosted. The server sends her the
files (the web pages) she's asked for.
If a Service Worker file is included,
Susie's search goes to the Service Worker
first.
Search for
www.hocking.edu
Sees the homepage for www.hocking.edu
Well, the service worker leaves
instructions to the browser that
Susie is using. Those instructions
will be performed before the
request is sent further.
Do you see how Susie's request went
to a service worker instead of going
straight to the radio towers, cables
and satellites?
Yes, what does it do there?
Yes! That's why these service
worker pages don't access the DOM.
If no other pages are loaded yet,
there's nothing for it to look
through.
For example, the service worker can
tell the browser "If the user is asking
for a particular URL, run this
JavaScript file (the service worker
file) first."
So the browser runs that file first before
any of the other pages are searched for
or loaded?
There are three different analogies we can use
to help better understand. Let's go over
them.
Cookie Virus Toolbox
Cookies and Service
Workers are downloaded
when accessing a
website
Service Workers are
more powerful than
cookies as they contain
a set of instructions.
Those instructions are
reviewed before making
a requests to the
website that originally
installed the service
worker.
Viruses and Service
Workers are installed
in the background
when first visit a
website.
Afterwards when a
request to the website
is made, the service
worker intercepts it.
The service worker
can only handle
requests for the
original website that
installed the service
worker.
Tools and Service
Workers don't do
much on their own
but they are useful
when needing to
access something.
Service workers
allow access to
powerful browser
features
Instructions can be
written in service
workers to take
advantage of the
tools
Yes! You got it!
You can see that all three
analogies help with the
understanding of what a service
worker does.
Yes, so basically the service worker
JavaScript file is downloaded onto
our computer when we first visit a
website. The next time we visit our
browser reads those instructions first.
Does that sound right?
So you can see that service
workers can be very powerful.
But you know what they say
"With great power, comes great
responsibility".
Yeah, I think I've heard that before.
Think about it. If there was a
hacker who wanted to create
havoc all they would have to do is
impersonate a website and write
their own service worker with evil
instructions. So there are some
policies that need to be followed.
It's important to be sure that the
service worker really belongs to the
site it claims it's from. For example if
a service worker says its for
www.example.com - it really is from
www.example.com
Okay, I think I know what you mean. Can
you explain a bit more?
Certainly! Sometimes webpages use
third party providers to hold images
and other assets. That works fine for
those instances. The service workers
HAVE to be part of the original
website. It can't be hosted elsewhere.
The same origin is one policy that
service workers have to follow.
Okay, what is the other one?
Service workers can only be used on
HTTPS websites. If a website is only
HTTP and doesn't have the S
(indicates it's secured), the service
worker won't work.
When publishing your website for
others to see you need to be sure your
site is secured with HTTPS, but you
don't need to do that while your still
building your app.
That's good! I wasn't sure how that was
going to work when we're still in testing
phase. How else can we see our site with
the service worker in action?
You can build and test with the
service worker while working with
your local host (web server on your
own computer).
Hopefully this helps explain what a
Service Worker is and how it help
build apps for users to use - even if
they aren't online or connected.
If you have questions please feel free
to reach out to Tasha Penwell at
Hocking College at the information
below.
Text: 740-300-1684
Email: penwellt31810@hocking.edu
Source: https://abookapart.com/

More Related Content

Similar to Service Workers and Their Role in Apps

Shaping up with angular JS
Shaping up with angular JSShaping up with angular JS
Shaping up with angular JS
Brajesh Yadav
 
Get Top
Get Top Get Top
Get Top
auto446
 
Introduction to web design
Introduction to web designIntroduction to web design
Introduction to web design
Fitra Sani
 
Web Server Application Logs LTEC2013
Web Server Application Logs LTEC2013Web Server Application Logs LTEC2013
Web Server Application Logs LTEC2013
Michal Špaček
 
2020 Top Web Development Trends
2020 Top Web Development Trends2020 Top Web Development Trends
2020 Top Web Development Trends
Pencil Agency
 
Challenges in web crawling
Challenges in web crawlingChallenges in web crawling
Challenges in web crawling
Burhan Ahmed
 
Semantic Web: Explanation
Semantic Web: ExplanationSemantic Web: Explanation
Semantic Web: Explanation
Anil Mishra
 
The semantic web
The semantic webThe semantic web
The semantic web
Dotkumo
 
How developer's can help seo
How developer's can help seo How developer's can help seo
How developer's can help seo
Gunjan Srivastava
 
A Beginner's Guide To Web Design
A Beginner's Guide To Web DesignA Beginner's Guide To Web Design
A Beginner's Guide To Web Design
Ais Technolabs
 
Linking: Viral Advertising is a Good Virus
Linking: Viral Advertising is a Good VirusLinking: Viral Advertising is a Good Virus
Linking: Viral Advertising is a Good Virus
mtwdhs0001
 
Basic SEO Structural Issues
Basic SEO Structural IssuesBasic SEO Structural Issues
Basic SEO Structural Issues
R2integrated
 
Article20
Article20Article20
Article20
egrowtech
 
Ijaprr vol1-5-24-29mukesh negi
Ijaprr vol1-5-24-29mukesh negiIjaprr vol1-5-24-29mukesh negi
Ijaprr vol1-5-24-29mukesh negi
ijaprr_editor
 
Designing with content-first
Designing with content-firstDesigning with content-first
Designing with content-first
Andy Parker
 
Domain Name
Domain NameDomain Name
Domain Name
webhostingguy
 
This is the web platform
This is the web platformThis is the web platform
This is the web platform
Paul Kinlan
 
Jmp206 Web Services Bootcamp Final Draft
Jmp206   Web Services Bootcamp Final DraftJmp206   Web Services Bootcamp Final Draft
Jmp206 Web Services Bootcamp Final Draft
Bill Buchan
 
Search Engine Optimization-tips & tricks
Search Engine Optimization-tips & tricksSearch Engine Optimization-tips & tricks
Search Engine Optimization-tips & tricks
digisays
 
Search engine optimization_strategies_-_part_2
Search engine optimization_strategies_-_part_2Search engine optimization_strategies_-_part_2
Search engine optimization_strategies_-_part_2
Flora Runyenje
 

Similar to Service Workers and Their Role in Apps (20)

Shaping up with angular JS
Shaping up with angular JSShaping up with angular JS
Shaping up with angular JS
 
Get Top
Get Top Get Top
Get Top
 
Introduction to web design
Introduction to web designIntroduction to web design
Introduction to web design
 
Web Server Application Logs LTEC2013
Web Server Application Logs LTEC2013Web Server Application Logs LTEC2013
Web Server Application Logs LTEC2013
 
2020 Top Web Development Trends
2020 Top Web Development Trends2020 Top Web Development Trends
2020 Top Web Development Trends
 
Challenges in web crawling
Challenges in web crawlingChallenges in web crawling
Challenges in web crawling
 
Semantic Web: Explanation
Semantic Web: ExplanationSemantic Web: Explanation
Semantic Web: Explanation
 
The semantic web
The semantic webThe semantic web
The semantic web
 
How developer's can help seo
How developer's can help seo How developer's can help seo
How developer's can help seo
 
A Beginner's Guide To Web Design
A Beginner's Guide To Web DesignA Beginner's Guide To Web Design
A Beginner's Guide To Web Design
 
Linking: Viral Advertising is a Good Virus
Linking: Viral Advertising is a Good VirusLinking: Viral Advertising is a Good Virus
Linking: Viral Advertising is a Good Virus
 
Basic SEO Structural Issues
Basic SEO Structural IssuesBasic SEO Structural Issues
Basic SEO Structural Issues
 
Article20
Article20Article20
Article20
 
Ijaprr vol1-5-24-29mukesh negi
Ijaprr vol1-5-24-29mukesh negiIjaprr vol1-5-24-29mukesh negi
Ijaprr vol1-5-24-29mukesh negi
 
Designing with content-first
Designing with content-firstDesigning with content-first
Designing with content-first
 
Domain Name
Domain NameDomain Name
Domain Name
 
This is the web platform
This is the web platformThis is the web platform
This is the web platform
 
Jmp206 Web Services Bootcamp Final Draft
Jmp206   Web Services Bootcamp Final DraftJmp206   Web Services Bootcamp Final Draft
Jmp206 Web Services Bootcamp Final Draft
 
Search Engine Optimization-tips & tricks
Search Engine Optimization-tips & tricksSearch Engine Optimization-tips & tricks
Search Engine Optimization-tips & tricks
 
Search engine optimization_strategies_-_part_2
Search engine optimization_strategies_-_part_2Search engine optimization_strategies_-_part_2
Search engine optimization_strategies_-_part_2
 

More from Tasha Penwell

The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxThe Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
Tasha Penwell
 
Revolutionize the way you work with AI and ChatGPT..gslides (2).pdf
Revolutionize the way you work with AI and ChatGPT..gslides (2).pdfRevolutionize the way you work with AI and ChatGPT..gslides (2).pdf
Revolutionize the way you work with AI and ChatGPT..gslides (2).pdf
Tasha Penwell
 
4 Ways That Snapchat Can Be Used in the Classroom.pdf
4 Ways That Snapchat Can Be Used in the Classroom.pdf4 Ways That Snapchat Can Be Used in the Classroom.pdf
4 Ways That Snapchat Can Be Used in the Classroom.pdf
Tasha Penwell
 
Snap Into It Bring Snapchat to the Classroom 20230124.pdf
Snap Into It Bring Snapchat to the Classroom 20230124.pdfSnap Into It Bring Snapchat to the Classroom 20230124.pdf
Snap Into It Bring Snapchat to the Classroom 20230124.pdf
Tasha Penwell
 
Roles in Cloud Computing
Roles in Cloud ComputingRoles in Cloud Computing
Roles in Cloud Computing
Tasha Penwell
 
Snapchat Insights from Community Lens Filter Experience
Snapchat Insights from Community Lens Filter ExperienceSnapchat Insights from Community Lens Filter Experience
Snapchat Insights from Community Lens Filter Experience
Tasha Penwell
 
Amazon Career Day
Amazon Career DayAmazon Career Day
Amazon Career Day
Tasha Penwell
 
AWS Shared Responsibility Model
AWS Shared Responsibility ModelAWS Shared Responsibility Model
AWS Shared Responsibility Model
Tasha Penwell
 
Fetch with Frankie and Bowser
Fetch with Frankie and BowserFetch with Frankie and Bowser
Fetch with Frankie and Bowser
Tasha Penwell
 
Let's learn about Lex and IAM Roles
Let's learn about Lex and IAM RolesLet's learn about Lex and IAM Roles
Let's learn about Lex and IAM Roles
Tasha Penwell
 
A Bot Named Lex
A Bot Named LexA Bot Named Lex
A Bot Named Lex
Tasha Penwell
 
Tasha Penwell Resume.docx
Tasha Penwell Resume.docxTasha Penwell Resume.docx
Tasha Penwell Resume.docx
Tasha Penwell
 

More from Tasha Penwell (12)

The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxThe Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
 
Revolutionize the way you work with AI and ChatGPT..gslides (2).pdf
Revolutionize the way you work with AI and ChatGPT..gslides (2).pdfRevolutionize the way you work with AI and ChatGPT..gslides (2).pdf
Revolutionize the way you work with AI and ChatGPT..gslides (2).pdf
 
4 Ways That Snapchat Can Be Used in the Classroom.pdf
4 Ways That Snapchat Can Be Used in the Classroom.pdf4 Ways That Snapchat Can Be Used in the Classroom.pdf
4 Ways That Snapchat Can Be Used in the Classroom.pdf
 
Snap Into It Bring Snapchat to the Classroom 20230124.pdf
Snap Into It Bring Snapchat to the Classroom 20230124.pdfSnap Into It Bring Snapchat to the Classroom 20230124.pdf
Snap Into It Bring Snapchat to the Classroom 20230124.pdf
 
Roles in Cloud Computing
Roles in Cloud ComputingRoles in Cloud Computing
Roles in Cloud Computing
 
Snapchat Insights from Community Lens Filter Experience
Snapchat Insights from Community Lens Filter ExperienceSnapchat Insights from Community Lens Filter Experience
Snapchat Insights from Community Lens Filter Experience
 
Amazon Career Day
Amazon Career DayAmazon Career Day
Amazon Career Day
 
AWS Shared Responsibility Model
AWS Shared Responsibility ModelAWS Shared Responsibility Model
AWS Shared Responsibility Model
 
Fetch with Frankie and Bowser
Fetch with Frankie and BowserFetch with Frankie and Bowser
Fetch with Frankie and Bowser
 
Let's learn about Lex and IAM Roles
Let's learn about Lex and IAM RolesLet's learn about Lex and IAM Roles
Let's learn about Lex and IAM Roles
 
A Bot Named Lex
A Bot Named LexA Bot Named Lex
A Bot Named Lex
 
Tasha Penwell Resume.docx
Tasha Penwell Resume.docxTasha Penwell Resume.docx
Tasha Penwell Resume.docx
 

Recently uploaded

“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 

Recently uploaded (20)

“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 

Service Workers and Their Role in Apps

  • 1. S E R V I C E W O R K E R S w i t h S a l l y a n d L a r r y
  • 2. Hi Larry! Let's learn a little about service workers today. Service Workers... Do they do something with building apps?
  • 3. That means we can access the app when we don't have signal? Exactly! Service workers make working offline possible. Yes!
  • 4. It's a JavaScript file? Does that mean it works with the DOM? Service Workers are just another JavaScript file that we create. No - and that's what makes it work offline.
  • 5. Really? How does the service worker work with the browser? Even though service workers don't have access to the DOM it does have access to the browser capabilities I'm glad you asked - it's really interesting!
  • 6. Yes, that's right. When you go to a website you either type it in or click on a link, right? Okay, after you type or click on the URL your computer uses the cables and satellites to contact the web server that's hosting your website. The information you're looking for is then sent to you on those cables and satellites from the web server.
  • 7. Search for www.hocking.edu Sees the homepage for www.hocking.edu For example, if Susie is looking to check out Hocking College she can do a search online and click on the link for www.hocking.edu. Susie's computer uses cables, radio towers and satellites to find the server where the Hocking College website is hosted. The server sends her the files (the web pages) she's asked for.
  • 8. If a Service Worker file is included, Susie's search goes to the Service Worker first. Search for www.hocking.edu Sees the homepage for www.hocking.edu
  • 9. Well, the service worker leaves instructions to the browser that Susie is using. Those instructions will be performed before the request is sent further. Do you see how Susie's request went to a service worker instead of going straight to the radio towers, cables and satellites? Yes, what does it do there?
  • 10. Yes! That's why these service worker pages don't access the DOM. If no other pages are loaded yet, there's nothing for it to look through. For example, the service worker can tell the browser "If the user is asking for a particular URL, run this JavaScript file (the service worker file) first." So the browser runs that file first before any of the other pages are searched for or loaded?
  • 11. There are three different analogies we can use to help better understand. Let's go over them. Cookie Virus Toolbox Cookies and Service Workers are downloaded when accessing a website Service Workers are more powerful than cookies as they contain a set of instructions. Those instructions are reviewed before making a requests to the website that originally installed the service worker. Viruses and Service Workers are installed in the background when first visit a website. Afterwards when a request to the website is made, the service worker intercepts it. The service worker can only handle requests for the original website that installed the service worker. Tools and Service Workers don't do much on their own but they are useful when needing to access something. Service workers allow access to powerful browser features Instructions can be written in service workers to take advantage of the tools
  • 12. Yes! You got it! You can see that all three analogies help with the understanding of what a service worker does. Yes, so basically the service worker JavaScript file is downloaded onto our computer when we first visit a website. The next time we visit our browser reads those instructions first. Does that sound right?
  • 13. So you can see that service workers can be very powerful. But you know what they say "With great power, comes great responsibility". Yeah, I think I've heard that before. Think about it. If there was a hacker who wanted to create havoc all they would have to do is impersonate a website and write their own service worker with evil instructions. So there are some policies that need to be followed.
  • 14. It's important to be sure that the service worker really belongs to the site it claims it's from. For example if a service worker says its for www.example.com - it really is from www.example.com Okay, I think I know what you mean. Can you explain a bit more? Certainly! Sometimes webpages use third party providers to hold images and other assets. That works fine for those instances. The service workers HAVE to be part of the original website. It can't be hosted elsewhere.
  • 15. The same origin is one policy that service workers have to follow. Okay, what is the other one? Service workers can only be used on HTTPS websites. If a website is only HTTP and doesn't have the S (indicates it's secured), the service worker won't work.
  • 16. When publishing your website for others to see you need to be sure your site is secured with HTTPS, but you don't need to do that while your still building your app. That's good! I wasn't sure how that was going to work when we're still in testing phase. How else can we see our site with the service worker in action? You can build and test with the service worker while working with your local host (web server on your own computer).
  • 17. Hopefully this helps explain what a Service Worker is and how it help build apps for users to use - even if they aren't online or connected. If you have questions please feel free to reach out to Tasha Penwell at Hocking College at the information below. Text: 740-300-1684 Email: penwellt31810@hocking.edu Source: https://abookapart.com/