Building Browser Extensions by 2023
Author:2023
Language: eng
Format: epub
CHapTer 7 BaCkGround SCrIpTS
This simple extension service worker sets listeners for the runtime.
onInstalled, bookmark.onCreated, and webNavigation.onCompleted
events. Each handler prints a log statement to the console when those
events are fired.
Similarities
The W3C specification for service workers begins with the following high-
level characterization:
The core of this specification is a worker that wakes to
receive events.
In this respect, a web page service worker and an extension service
worker are serving the same purpose. Whatâs more, the distinction
between a âweb pageâ service worker and an âextensionâ service worker
only describes how the service worker is deployed in that context; the
underlying service worker platform remains unchanged.
When comparing the two examples from above, you may have noticed
the following:
⢠Both service worker scripts are largely composed
of event handlers being assigned in the top level of
the script.
⢠Both service workers are listening for some form of an
installation event.
⢠Both service workers can access network requests
occurring in the browser.
These similarities underscore many of the similarities between the
two. With these code similarities in mind, letâs explore the ways that these
service worker contexts are alike.
190
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Kathy Andrews Collection by Kathy Andrews(10520)
The remains of the day by Kazuo Ishiguro(7551)
Spare by Prince Harry The Duke of Sussex(4198)
Paper Towns by Green John(4169)
The Body: A Guide for Occupants by Bill Bryson(3802)
Be in a Treehouse by Pete Nelson(3213)
Harry Potter and the Goblet Of Fire by J.K. Rowling(3046)
Goodbye Paradise(2964)
Never by Ken Follett(2881)
Into Thin Air by Jon Krakauer(2701)
The Remains of the Day by Kazuo Ishiguro(2619)
The Genius of Japanese Carpentry by Azby Brown(2609)
The Cellar by Natasha Preston(2595)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2532)
120 Days of Sodom by Marquis de Sade(2438)
Architecture 101 by Nicole Bridge(2350)
The Man Who Died Twice by Richard Osman(2300)
Machine Learning at Scale with H2O by Gregory Keys | David Whiting(2292)
Fairy Tale by Stephen King(2070)