Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

register-service-worker

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

register-service-worker - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

CHANGELOG.md

5

index.js

@@ -49,3 +49,8 @@ // Register a service worker to serve assets from local cache.

emit('registered', registration)
if (registration.waiting) {
emit('updated', registration)
return
}
registration.onupdatefound = function () {
emit('updatefound')
var installingWorker = registration.installing

@@ -52,0 +57,0 @@ installingWorker.onstatechange = function () {

8

package.json
{
"name": "register-service-worker",
"sideEffects": false,
"version": "1.4.1",
"version": "1.5.0",
"description": "Script for registering service worker, with hooks",

@@ -9,3 +9,4 @@ "main": "index.js",

"build": "node scripts/build.js",
"prepare": "npm run build"
"prepare": "npm run build",
"prepublishOnly": "conventional-changelog -p angular -r 2 -i CHANGELOG.md -s"
},

@@ -26,4 +27,5 @@ "repository": {

"devDependencies": {
"buble": "^0.18.0"
"buble": "^0.18.0",
"conventional-changelog-cli": "^2.0.1"
}
}

@@ -22,2 +22,5 @@ # register-service-worker

},
updatefound (registration) {
console.log('New content is downloading.')
},
updated (registration) {

@@ -35,2 +38,2 @@ console.log('New content is available; please refresh.')

The `cached` and `updated` events passes a [ServiceWorkerRegistration](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration) instance in their arguments.
The `cached`, `updatefound` and `updated` events passes a [ServiceWorkerRegistration](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration) instance in their arguments.

@@ -46,3 +46,8 @@ // Register a service worker to serve assets from local cache.

emit('registered', registration)
if (registration.waiting) {
emit('updated', registration)
return
}
registration.onupdatefound = () => {
emit('updatefound')
const installingWorker = registration.installing

@@ -49,0 +54,0 @@ installingWorker.onstatechange = () => {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc