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.2.0 to 1.3.0

4

index.js

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

// available; please refresh." message in your web app.
emit('updated')
emit('updated', registration)
} else {

@@ -63,3 +63,3 @@ // At this point, everything has been precached.

// "Content is cached for offline use." message.
emit('cached')
emit('cached', registration)
}

@@ -66,0 +66,0 @@ }

{
"name": "register-service-worker",
"sideEffects": false,
"version": "1.2.0",
"version": "1.3.0",
"description": "Script for registering service worker, with hooks",

@@ -6,0 +6,0 @@ "main": "index.js",

@@ -16,6 +16,6 @@ # register-service-worker

},
cached () {
cached (registration) {
console.log('Content has been cached for offline use.')
},
updated () {
updated (registration) {
console.log('New content is available; please refresh.')

@@ -31,1 +31,3 @@ },

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

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

// available; please refresh." message in your web app.
emit('updated')
emit('updated', registration)
} else {

@@ -60,3 +60,3 @@ // At this point, everything has been precached.

// "Content is cached for offline use." message.
emit('cached')
emit('cached', registration)
}

@@ -63,0 +63,0 @@ }

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