Skip to Content
만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술
book

만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술

by 한민주, 양찬석, 탈 아터
April 2019
Beginner to intermediate
368 pages
7h 18m
Korean
Hanbit Media, Inc.
Content preview from 만들면서 배우는 프로그레시브 웹 앱: 사용자 경험을 극대화하는 차세대 웹 앱 기술
2 당신의 첫 번째 서비스 워커
- 053
가능하다면, 고담시의 평화는 한층 더 요원한 일이 될 것입니다.
이러한 문제를 방지하고자 각각의 서비스 워커는 컨트롤 범위가 제한되어 있습니
다. 컨트롤 범위는 서비스 워커 스크립트 파일이 위치한 디렉터리 위치에 의해 정
해집니다. 앞선 예제처럼
serviceworker
.
js
파일을
root
디렉터리에 저장하는
경우, 서비스 워커가 사이트의 어느 곳에서 발생한 요청이든 제어할 수 있습니다.
반면 서비스 워커 스크립트 파일을
js
디렉터리에 저장하면, 해당 서브 디렉터리
를 대상으로 하는 요청만 서비스 워커로 전달됩니다.
서비스 워커를 등록할 때 추가로
scope
option
을 인자로 넘겨서 컨트롤 범위를
변경할 수도 있습니다. 이를 통해 서비스 워커의 컨트롤 범위를 좀 더 좁힐 수는
있지만, 넓힐 수는 없습니다
(
예를 들어 /
ginnos
/
sw
.
js
가 /
ginnos
/
menu
/에 대한 요청만
전달받도록 제한할 수 있지만, 루트 도메인까지 영향력을 확대하도록 만들 수는 없습니다
)
.
//
다음
두
명령어는
정확히
동일한
범위를
가진다.
navigator
.
serviceWorker
.
register
("/
sw
.
js
");
navigator
.
serviceWorker
.
register
("/
sw
.
js
",
{
scope
:
"/"});
//
다음
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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

파이썬으로 웹 크롤러 만들기: 초간단 나만의 웹 크롤러로 원하는 데이터 가져오는 방법

파이썬으로 웹 크롤러 만들기: 초간단 나만의 웹 크롤러로 원하는 데이터 가져오는 방법

한선용, 라이언 미첼

Publisher Resources

ISBN: 9791162248737