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

workbox-broadcast-update

Package Overview
Dependencies
Maintainers
6
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-broadcast-update - npm Package Compare versions

Comparing version 6.5.1 to 6.5.2

2

_version.js
"use strict";
// @ts-ignore
try {
self['workbox:broadcast-update:6.5.0'] && _();
self['workbox:broadcast-update:6.5.1'] && _();
}
catch (e) { }

@@ -40,4 +40,4 @@ import { CacheDidUpdateCallbackParam } from 'workbox-core/types.js';

* and sends a message (via `postMessage()`) to all window clients if the
* responses differ (note: neither of the Responses can be
* {@link http://stackoverflow.com/questions/39109789|opaque}).
* responses differ. Neither of the Responses can be
* [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
*

@@ -44,0 +44,0 @@ * The message that's posted has the following format (where `payload` can

@@ -65,4 +65,4 @@ /*

* and sends a message (via `postMessage()`) to all window clients if the
* responses differ (note: neither of the Responses can be
* {@link http://stackoverflow.com/questions/39109789|opaque}).
* responses differ. Neither of the Responses can be
* [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
*

@@ -69,0 +69,0 @@ * The message that's posted has the following format (where `payload` can

@@ -13,5 +13,5 @@ import { WorkboxPlugin } from 'workbox-core/types.js';

/**
* Construct a BroadcastCacheUpdate instance with the passed options and
* calls its {@link workbox-broadcast-update.BroadcastCacheUpdate~notifyIfUpdated}
* method whenever the plugin's `cacheDidUpdate` callback is invoked.
* Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with
* the passed options and calls its `notifyIfUpdated` method whenever the
* plugin's `cacheDidUpdate` callback is invoked.
*

@@ -18,0 +18,0 @@ * @param {Object} [options]

@@ -19,5 +19,5 @@ /*

/**
* Construct a BroadcastCacheUpdate instance with the passed options and
* calls its {@link workbox-broadcast-update.BroadcastCacheUpdate~notifyIfUpdated}
* method whenever the plugin's `cacheDidUpdate` callback is invoked.
* Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with
* the passed options and calls its `notifyIfUpdated` method whenever the
* plugin's `cacheDidUpdate` callback is invoked.
*

@@ -24,0 +24,0 @@ * @param {Object} [options]

@@ -6,3 +6,3 @@ this.workbox = this.workbox || {};

try {
self['workbox:broadcast-update:6.5.0'] && _();
self['workbox:broadcast-update:6.5.1'] && _();
} catch (e) {}

@@ -134,4 +134,4 @@

* and sends a message (via `postMessage()`) to all window clients if the
* responses differ (note: neither of the Responses can be
* {@link http://stackoverflow.com/questions/39109789|opaque}).
* responses differ. Neither of the Responses can be
* [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
*

@@ -262,5 +262,5 @@ * The message that's posted has the following format (where `payload` can

/**
* Construct a BroadcastCacheUpdate instance with the passed options and
* calls its {@link workbox-broadcast-update.BroadcastCacheUpdate~notifyIfUpdated}
* method whenever the plugin's `cacheDidUpdate` callback is invoked.
* Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with
* the passed options and calls its `notifyIfUpdated` method whenever the
* plugin's `cacheDidUpdate` callback is invoked.
*

@@ -267,0 +267,0 @@ * @param {Object} [options]

@@ -1,2 +0,2 @@

this.workbox=this.workbox||{},this.workbox.broadcastUpdate=function(t,s,a,e){"use strict";try{self["workbox:broadcast-update:6.5.0"]&&_()}catch(t){}const n=(t,s,a)=>!a.some((a=>t.headers.has(a)&&s.headers.has(a)))||a.every((a=>{const e=t.headers.has(a)===s.headers.has(a),n=t.headers.get(a)===s.headers.get(a);return e&&n})),i=["content-length","etag","last-modified"],o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function c(t){return{cacheName:t.cacheName,updatedURL:t.request.url}}class r{constructor({generatePayload:t,headersToCheck:s,notifyAllClients:a}={}){this.C=s||i,this.A=t||c,this.U=null==a||a}async notifyIfUpdated(t){if(t.oldResponse&&!n(t.oldResponse,t.newResponse,this.C)){const e={type:"CACHE_UPDATED",meta:"workbox-broadcast-update",payload:this.A(t)};if("navigate"===t.request.mode){let e;t.event instanceof FetchEvent&&(e=t.event.resultingClientId);await a.resultingClientExists(e)&&!o||await s.timeout(3500)}if(this.U){const t=await self.clients.matchAll({type:"window"});for(const s of t)s.postMessage(e)}else if(t.event instanceof FetchEvent){const s=await self.clients.get(t.event.clientId);null==s||s.postMessage(e)}}}}return t.BroadcastCacheUpdate=r,t.BroadcastUpdatePlugin=class{constructor(t){this.cacheDidUpdate=async t=>{e.dontWaitFor(this.F.notifyIfUpdated(t))},this.F=new r(t)}},t.responsesAreSame=n,t}({},workbox.core._private,workbox.core._private,workbox.core._private);
this.workbox=this.workbox||{},this.workbox.broadcastUpdate=function(t,s,a,e){"use strict";try{self["workbox:broadcast-update:6.5.1"]&&_()}catch(t){}const n=(t,s,a)=>!a.some((a=>t.headers.has(a)&&s.headers.has(a)))||a.every((a=>{const e=t.headers.has(a)===s.headers.has(a),n=t.headers.get(a)===s.headers.get(a);return e&&n})),i=["content-length","etag","last-modified"],o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function c(t){return{cacheName:t.cacheName,updatedURL:t.request.url}}class r{constructor({generatePayload:t,headersToCheck:s,notifyAllClients:a}={}){this.C=s||i,this.A=t||c,this.U=null==a||a}async notifyIfUpdated(t){if(t.oldResponse&&!n(t.oldResponse,t.newResponse,this.C)){const e={type:"CACHE_UPDATED",meta:"workbox-broadcast-update",payload:this.A(t)};if("navigate"===t.request.mode){let e;t.event instanceof FetchEvent&&(e=t.event.resultingClientId);await a.resultingClientExists(e)&&!o||await s.timeout(3500)}if(this.U){const t=await self.clients.matchAll({type:"window"});for(const s of t)s.postMessage(e)}else if(t.event instanceof FetchEvent){const s=await self.clients.get(t.event.clientId);null==s||s.postMessage(e)}}}}return t.BroadcastCacheUpdate=r,t.BroadcastUpdatePlugin=class{constructor(t){this.cacheDidUpdate=async t=>{e.dontWaitFor(this.F.notifyIfUpdated(t))},this.F=new r(t)}},t.responsesAreSame=n,t}({},workbox.core._private,workbox.core._private,workbox.core._private);
//# sourceMappingURL=workbox-broadcast-update.prod.js.map

@@ -1,2 +0,2 @@

import { BroadcastCacheUpdate } from './BroadcastCacheUpdate.js';
import { BroadcastCacheUpdate, BroadcastCacheUpdateOptions } from './BroadcastCacheUpdate.js';
import { BroadcastUpdatePlugin } from './BroadcastUpdatePlugin.js';

@@ -8,2 +8,2 @@ import { responsesAreSame } from './responsesAreSame.js';

*/
export { BroadcastCacheUpdate, BroadcastUpdatePlugin, responsesAreSame };
export { BroadcastCacheUpdate, BroadcastCacheUpdateOptions, BroadcastUpdatePlugin, responsesAreSame, };

@@ -8,3 +8,3 @@ /*

*/
import { BroadcastCacheUpdate } from './BroadcastCacheUpdate.js';
import { BroadcastCacheUpdate, } from './BroadcastCacheUpdate.js';
import { BroadcastUpdatePlugin } from './BroadcastUpdatePlugin.js';

@@ -16,2 +16,2 @@ import { responsesAreSame } from './responsesAreSame.js';

*/
export { BroadcastCacheUpdate, BroadcastUpdatePlugin, responsesAreSame };
export { BroadcastCacheUpdate, BroadcastUpdatePlugin, responsesAreSame, };
{
"name": "workbox-broadcast-update",
"version": "6.5.1",
"version": "6.5.2",
"license": "MIT",

@@ -25,5 +25,5 @@ "author": "Google's Web DevRel Team",

"dependencies": {
"workbox-core": "6.5.1"
"workbox-core": "6.5.2"
},
"gitHead": "7c095b4f981976d11a29ac934a16c6a0fbd0c0c1"
"gitHead": "85bdecd24ded38c215b4e8943ee9b3eb0e2c3ee9"
}
// @ts-ignore
try{self['workbox:broadcast-update:6.5.1']&&_()}catch(e){}
try{self['workbox:broadcast-update:6.5.2']&&_()}catch(e){}

@@ -100,4 +100,4 @@ /*

* and sends a message (via `postMessage()`) to all window clients if the
* responses differ (note: neither of the Responses can be
* {@link http://stackoverflow.com/questions/39109789|opaque}).
* responses differ. Neither of the Responses can be
* [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).
*

@@ -104,0 +104,0 @@ * The message that's posted has the following format (where `payload` can

@@ -29,5 +29,5 @@ /*

/**
* Construct a BroadcastCacheUpdate instance with the passed options and
* calls its {@link workbox-broadcast-update.BroadcastCacheUpdate~notifyIfUpdated}
* method whenever the plugin's `cacheDidUpdate` callback is invoked.
* Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with
* the passed options and calls its `notifyIfUpdated` method whenever the
* plugin's `cacheDidUpdate` callback is invoked.
*

@@ -34,0 +34,0 @@ * @param {Object} [options]

@@ -9,5 +9,9 @@ /*

import {BroadcastCacheUpdate} from './BroadcastCacheUpdate.js';
import {
BroadcastCacheUpdate,
BroadcastCacheUpdateOptions,
} from './BroadcastCacheUpdate.js';
import {BroadcastUpdatePlugin} from './BroadcastUpdatePlugin.js';
import {responsesAreSame} from './responsesAreSame.js';
import './_version.js';

@@ -19,2 +23,7 @@

export {BroadcastCacheUpdate, BroadcastUpdatePlugin, responsesAreSame};
export {
BroadcastCacheUpdate,
BroadcastCacheUpdateOptions,
BroadcastUpdatePlugin,
responsesAreSame,
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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