Socket
Socket
Sign inDemoInstall

workbox-window

Package Overview
Dependencies
1
Maintainers
4
Versions
59
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0-alpha.2 to 5.0.0-beta.0

2

_version.js
// @ts-ignore
try {
self['workbox:window:5.0.0-alpha.2'] && _();
self['workbox:window:5.0.0-beta.0'] && _();
}
catch (e) { }

@@ -9,3 +9,3 @@ (function (global, factory) {

try {
self['workbox:window:5.0.0-alpha.2'] && _();
self['workbox:window:5.0.0-beta.0'] && _();
} catch (e) {}

@@ -72,3 +72,3 @@

try {
self['workbox:core:5.0.0-alpha.2'] && _();
self['workbox:core:5.0.0-beta.0'] && _();
} catch (e) {}

@@ -156,3 +156,3 @@

var _loop = function _loop() {
var key = loggerMethods[_i];
var key = _loggerMethods[_i];
var method = key;

@@ -169,3 +169,3 @@

for (var _i = 0; _i < loggerMethods.length; _i++) {
for (var _i = 0, _loggerMethods = loggerMethods; _i < _loggerMethods.length; _i++) {
_loop();

@@ -210,3 +210,3 @@ }

foo.add(listener);
};
}
/**

@@ -217,7 +217,7 @@ * @param {string} type

*/
;
_proto.removeEventListener = function removeEventListener(type, listener) {
this._getEventListenersByType(type).delete(listener);
};
}
/**

@@ -227,4 +227,4 @@ * @param {Object} event

*/
;
_proto.dispatchEvent = function dispatchEvent(event) {

@@ -250,3 +250,3 @@ event.target = this;

}
};
}
/**

@@ -260,4 +260,4 @@ * Returns a Set of listeners associated with the passed event type.

*/
;
_proto._getEventListenersByType = function _getEventListenersByType(type) {

@@ -316,34 +316,20 @@ if (!this._eventListenerRegistry.has(type)) {

function _catch(body, recover) {
try {
var result = body();
} catch (e) {
return recover(e);
}
// `skipWaiting()` wasn't called. This 200 amount wasn't scientifically
// chosen, but it seems to avoid false positives in my testing.
if (result && result.then) {
return result.then(void 0, recover);
function _await(value, then, direct) {
if (direct) {
return then ? then(value) : value;
}
return result;
}
function _invoke(body, then) {
var result = body();
if (result && result.then) {
return result.then(then);
if (!value || !value.then) {
value = Promise.resolve(value);
}
return then(result);
return then ? value.then(then) : value;
}
function _awaitIgnored(value, direct) {
if (!direct) {
return value && value.then ? value.then(_empty) : Promise.resolve();
}
}
var WAITING_TIMEOUT_DURATION = 200; // The amount of time after a registration that we can reasonably conclude
// that the registration didn't trigger an update.
function _empty() {}
function _async(f) {

@@ -363,19 +349,2 @@ return function () {

function _await(value, then, direct) {
if (direct) {
return then ? then(value) : value;
}
if (!value || !value.then) {
value = Promise.resolve(value);
}
return then ? value.then(then) : value;
}
// `skipWaiting()` wasn't called. This 200 amount wasn't scientifically
// chosen, but it seems to avoid false positives in my testing.
var WAITING_TIMEOUT_DURATION = 200; // The amount of time after a registration that we can reasonably conclude
// that the registration didn't trigger an update.
var REGISTRATION_TIMEOUT_DURATION = 60000;

@@ -399,2 +368,4 @@ /**

function _empty() {}
var Workbox =

@@ -681,4 +652,2 @@ /*#__PURE__*/

_this3._reportWindowReady(_this3._compatibleControllingSW);
_this3._compatibleControllingSW.addEventListener('statechange', _this3._onStateChange, {

@@ -745,10 +714,4 @@ once: true

once: true
}); // Add message listeners.
}); // Add a message listener.
if ('BroadcastChannel' in self) {
_this3._broadcastChannel = new BroadcastChannel('workbox');
_this3._broadcastChannel.addEventListener('message', _this3._onMessage);
}
navigator.serviceWorker.addEventListener('message', _this3._onMessage);

@@ -758,7 +721,7 @@ return _this3._registration;

});
});
})
/**
* Checks for updates of the registered service worker.
*/
;
_proto.update = _async(function () {

@@ -777,3 +740,3 @@ var _this4 = this;

return _awaitIgnored(_this4._registration.update());
});
})
/**

@@ -788,2 +751,3 @@ * Resolves to the service worker registered by this instance as soon as it

*/
;

@@ -811,3 +775,3 @@ /**

return _this5._sw !== undefined ? _this5._sw : _this5._swDeferred.promise;
});
})
/**

@@ -826,3 +790,3 @@ * Sends the passed data object to the service worker registered by this

*/
;
_proto.messageSW = _async(function (data) {

@@ -834,3 +798,3 @@ var _this6 = this;

});
});
})
/**

@@ -843,2 +807,3 @@ * Checks for a service worker already controlling the page and returns

*/
;

@@ -853,3 +818,3 @@ _proto._getControllingSWIfCompatible = function _getControllingSWIfCompatible() {

}
};
}
/**

@@ -861,4 +826,4 @@ * Registers a service worker for this instances script URL and register

*/
;
_proto._registerScript = _async(function () {

@@ -884,16 +849,3 @@ var _this7 = this;

});
/**
* Sends a message to the passed service worker that the window is ready.
*
* @param {ServiceWorker} sw
* @private
*/
_proto._reportWindowReady = function _reportWindowReady(sw) {
messageSW(sw, {
type: 'WINDOW_READY',
meta: 'workbox-window'
});
};
_createClass(Workbox, [{

@@ -926,3 +878,190 @@ key: "active",

}(WorkboxEventTarget); // The jsdoc comments below outline the events this instance may dispatch:
// -----------------------------------------------------------------------
/**
* The `message` event is dispatched any time a `postMessage` is received.
*
* @event module:workbox-window.Workbox#message
* @type {WorkboxEvent}
* @property {*} data The `data` property from the original `message` event.
* @property {Event} originalEvent The original [`message`]{@link https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent}
* event.
* @property {string} type `message`.
* @property {Workbox} target The `Workbox` instance.
*/
/**
* The `installed` event is dispatched if the state of a
* [`Workbox`]{@link module:workbox-window.Workbox} instance's
* [registered service worker]{@link https://developers.google.com/web/tools/workbox/modules/workbox-precaching#def-registered-sw}
* changes to `installed`.
*
* Then can happen either the very first time a service worker is installed,
* or after an update to the current service worker is found. In the case
* of an update being found, the event's `isUpdate` property will be `true`.
*
* @event module:workbox-window.Workbox#installed
* @type {WorkboxEvent}
* @property {ServiceWorker} sw The service worker instance.
* @property {Event} originalEvent The original [`statechange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange}
* event.
* @property {boolean|undefined} isUpdate True if a service worker was already
* controlling when this `Workbox` instance called `register()`.
* @property {string} type `installed`.
* @property {Workbox} target The `Workbox` instance.
*/
/**
* The `waiting` event is dispatched if the state of a
* [`Workbox`]{@link module:workbox-window.Workbox} instance's
* [registered service worker]{@link https://developers.google.com/web/tools/workbox/modules/workbox-precaching#def-registered-sw}
* changes to `installed` and then doesn't immediately change to `activating`.
* It may also be dispatched if a service worker with the same
* [`scriptURL`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/scriptURL}
* was already waiting when the [`register()`]{@link module:workbox-window.Workbox#register}
* method was called.
*
* @event module:workbox-window.Workbox#waiting
* @type {WorkboxEvent}
* @property {ServiceWorker} sw The service worker instance.
* @property {Event|undefined} originalEvent The original
* [`statechange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange}
* event, or `undefined` in the case where the service worker was waiting
* to before `.register()` was called.
* @property {boolean|undefined} isUpdate True if a service worker was already
* controlling when this `Workbox` instance called `register()`.
* @property {boolean|undefined} wasWaitingBeforeRegister True if a service worker with
* a matching `scriptURL` was already waiting when this `Workbox`
* instance called `register()`.
* @property {string} type `waiting`.
* @property {Workbox} target The `Workbox` instance.
*/
/**
* The `controlling` event is dispatched if a
* [`controllerchange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/oncontrollerchange}
* fires on the service worker [container]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer}
* and the [`scriptURL`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/scriptURL}
* of the new [controller]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/controller}
* matches the `scriptURL` of the `Workbox` instance's
* [registered service worker]{@link https://developers.google.com/web/tools/workbox/modules/workbox-precaching#def-registered-sw}.
*
* @event module:workbox-window.Workbox#controlling
* @type {WorkboxEvent}
* @property {ServiceWorker} sw The service worker instance.
* @property {Event} originalEvent The original [`controllerchange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/oncontrollerchange}
* event.
* @property {boolean|undefined} isUpdate True if a service worker was already
* controlling when this service worker was registered.
* @property {string} type `controlling`.
* @property {Workbox} target The `Workbox` instance.
*/
/**
* The `activated` event is dispatched if the state of a
* [`Workbox`]{@link module:workbox-window.Workbox} instance's
* [registered service worker]{@link https://developers.google.com/web/tools/workbox/modules/workbox-precaching#def-registered-sw}
* changes to `activated`.
*
* @event module:workbox-window.Workbox#activated
* @type {WorkboxEvent}
* @property {ServiceWorker} sw The service worker instance.
* @property {Event} originalEvent The original [`statechange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange}
* event.
* @property {boolean|undefined} isUpdate True if a service worker was already
* controlling when this `Workbox` instance called `register()`.
* @property {string} type `activated`.
* @property {Workbox} target The `Workbox` instance.
*/
/**
* The `redundant` event is dispatched if the state of a
* [`Workbox`]{@link module:workbox-window.Workbox} instance's
* [registered service worker]{@link https://developers.google.com/web/tools/workbox/modules/workbox-precaching#def-registered-sw}
* changes to `redundant`.
*
* @event module:workbox-window.Workbox#redundant
* @type {WorkboxEvent}
* @property {ServiceWorker} sw The service worker instance.
* @property {Event} originalEvent The original [`statechange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange}
* event.
* @property {boolean|undefined} isUpdate True if a service worker was already
* controlling when this `Workbox` instance called `register()`.
* @property {string} type `redundant`.
* @property {Workbox} target The `Workbox` instance.
*/
/**
* The `externalinstalled` event is dispatched if the state of an
* [external service worker]{@link https://developers.google.com/web/tools/workbox/modules/workbox-precaching#def-external-sw}
* changes to `installed`.
*
* @event module:workbox-window.Workbox#externalinstalled
* @type {WorkboxEvent}
* @property {ServiceWorker} sw The service worker instance.
* @property {Event} originalEvent The original [`statechange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange}
* event.
* @property {string} type `externalinstalled`.
* @property {Workbox} target The `Workbox` instance.
*/
/**
* The `externalwaiting` event is dispatched if the state of an
* [external service worker]{@link https://developers.google.com/web/tools/workbox/modules/workbox-precaching#def-external-sw}
* changes to `waiting`.
*
* @event module:workbox-window.Workbox#externalwaiting
* @type {WorkboxEvent}
* @property {ServiceWorker} sw The service worker instance.
* @property {Event} originalEvent The original [`statechange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange}
* event.
* @property {string} type `externalwaiting`.
* @property {Workbox} target The `Workbox` instance.
*/
/**
* The `externalactivated` event is dispatched if the state of an
* [external service worker]{@link https://developers.google.com/web/tools/workbox/modules/workbox-precaching#def-external-sw}
* changes to `activated`.
*
* @event module:workbox-window.Workbox#externalactivated
* @type {WorkboxEvent}
* @property {ServiceWorker} sw The service worker instance.
* @property {Event} originalEvent The original [`statechange`]{@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/onstatechange}
* event.
* @property {string} type `externalactivated`.
* @property {Workbox} target The `Workbox` instance.
*/
function _awaitIgnored(value, direct) {
if (!direct) {
return value && value.then ? value.then(_empty) : Promise.resolve();
}
}
function _invoke(body, then) {
var result = body();
if (result && result.then) {
return result.then(then);
}
return then(result);
}
function _catch(body, recover) {
try {
var result = body();
} catch (e) {
return recover(e);
}
if (result && result.then) {
return result.then(void 0, recover);
}
return result;
}
exports.Workbox = Workbox;

@@ -929,0 +1068,0 @@ exports.messageSW = messageSW;

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

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).workbox={})}(this,function(n){"use strict";try{self["workbox:window:5.0.0-alpha.2"]&&_()}catch(n){}function t(n,t){return new Promise(function(e){var i=new MessageChannel;i.port1.onmessage=function(n){e(n.data)},n.postMessage(t,[i.port2])})}function e(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}try{self["workbox:core:5.0.0-alpha.2"]&&_()}catch(n){}var i=function(){var n=this;this.promise=new Promise(function(t,e){n.resolve=t,n.reject=e})};function r(n,t){var e=location.href;return new URL(n,e).href===new URL(t,e).href}var o=function(n,t){this.type=n,Object.assign(this,t)};function u(n,t){if(!t)return n&&n.then?n.then(a):Promise.resolve()}function a(){}function c(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(n.apply(this,t))}catch(n){return Promise.reject(n)}}}function f(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}var s=200,v=6e4,h=function(n){var a,h;function l(t,e){var u;return void 0===e&&(e={}),(u=n.call(this)||this).t={},u.i=0,u.o=new i,u.u=new i,u.s=new i,u.v=0,u.h=function(){var n=u.l,t=n.installing;u.i>0||!r(t.scriptURL,u.g)||performance.now()>u.v+v?(u.m=t,n.removeEventListener("updatefound",u.h)):(u.p=t,u.o.resolve(t)),++u.i,t.addEventListener("statechange",u.P)},u.P=function(n){var t=u.l,e=n.target,i=e.state,r=e===u.m,a=r?"external":"",c={sw:e,originalEvent:n};!r&&u.k&&(c.isUpdate=!0),u.dispatchEvent(new o(a+i,c)),"installed"===i?u.j=self.setTimeout(function(){"installed"===i&&t.waiting===e&&u.dispatchEvent(new o(a+"waiting",c))},s):"activating"===i&&(clearTimeout(u.j),r||u.u.resolve(e))},u.O=function(n){var t=u.p;t===navigator.serviceWorker.controller&&(u.dispatchEvent(new o("controlling",{sw:t,originalEvent:n,isUpdate:u.k})),u.s.resolve(t))},u._=c(function(n){var t=n.data,e=u,i=e.dispatchEvent;return f(u.getSW(),function(r){i.call(e,new o("message",{data:t,sw:r,originalEvent:n}))})}),u.g=t,u.t=e,u}h=n,(a=l).prototype=Object.create(h.prototype),a.prototype.constructor=a,a.__proto__=h;var w,d,g,m=l.prototype;return m.register=c(function(n){var t,e,i=this,a=(void 0===n?{}:n).immediate,c=void 0!==a&&a;return t=function(){return i.k=Boolean(navigator.serviceWorker.controller),i.B=i.R(),f(i.C(),function(n){i.l=n,i.B&&(i.p=i.B,i.u.resolve(i.B),i.s.resolve(i.B),i.L(i.B),i.B.addEventListener("statechange",i.P,{once:!0}));var t=i.l.waiting;return t&&r(t.scriptURL,i.g)&&(i.p=t,Promise.resolve().then(function(){i.dispatchEvent(new o("waiting",{sw:t,wasWaitingBeforeRegister:!0}))})),i.p&&i.o.resolve(i.p),i.l.addEventListener("updatefound",i.h),navigator.serviceWorker.addEventListener("controllerchange",i.O,{once:!0}),"BroadcastChannel"in self&&(i.M=new BroadcastChannel("workbox"),i.M.addEventListener("message",i._)),navigator.serviceWorker.addEventListener("message",i._),i.l})},(e=function(){if(!c&&"complete"!==document.readyState)return u(new Promise(function(n){return addEventListener("load",n)}))}())&&e.then?e.then(t):t(e)}),m.update=c(function(){if(this.l)return u(this.l.update())}),m.getSW=c(function(){return void 0!==this.p?this.p:this.o.promise}),m.messageSW=c(function(n){return f(this.getSW(),function(e){return t(e,n)})}),m.R=function(){var n=navigator.serviceWorker.controller;return n&&r(n.scriptURL,this.g)?n:void 0},m.C=c(function(){var n=this;return function(n,t){try{var e=n()}catch(n){return t(n)}return e&&e.then?e.then(void 0,t):e}(function(){return f(navigator.serviceWorker.register(n.g,n.t),function(t){return n.v=performance.now(),t})},function(n){throw n})}),m.L=function(n){t(n,{type:"WINDOW_READY",meta:"workbox-window"})},w=l,(d=[{key:"active",get:function(){return this.u.promise}},{key:"controlling",get:function(){return this.s.promise}}])&&e(w.prototype,d),g&&e(w,g),l}(function(){function n(){this.U=new Map}var t=n.prototype;return t.addEventListener=function(n,t){this.W(n).add(t)},t.removeEventListener=function(n,t){this.W(n).delete(t)},t.dispatchEvent=function(n){n.target=this;var t=this.W(n.type),e=Array.isArray(t),i=0;for(t=e?t:t[Symbol.iterator]();;){var r;if(e){if(i>=t.length)break;r=t[i++]}else{if((i=t.next()).done)break;r=i.value}r(n)}},t.W=function(n){return this.U.has(n)||this.U.set(n,new Set),this.U.get(n)},n}());n.Workbox=h,n.messageSW=t,Object.defineProperty(n,"__esModule",{value:!0})});
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).workbox={})}(this,function(n){"use strict";try{self["workbox:window:5.0.0-beta.0"]&&_()}catch(n){}function t(n,t){return new Promise(function(e){var r=new MessageChannel;r.port1.onmessage=function(n){e(n.data)},n.postMessage(t,[r.port2])})}function e(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}try{self["workbox:core:5.0.0-beta.0"]&&_()}catch(n){}var r=function(){var n=this;this.promise=new Promise(function(t,e){n.resolve=t,n.reject=e})};function i(n,t){var e=location.href;return new URL(n,e).href===new URL(t,e).href}var o=function(n,t){this.type=n,Object.assign(this,t)};function u(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}var a=200;function c(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(n.apply(this,t))}catch(n){return Promise.reject(n)}}}var f=6e4;function s(){}var v=function(n){var s,v;function l(t,e){var s;return void 0===e&&(e={}),(s=n.call(this)||this).t={},s.i=0,s.o=new r,s.u=new r,s.s=new r,s.v=0,s.h=function(){var n=s.l,t=n.installing;s.i>0||!i(t.scriptURL,s.g)||performance.now()>s.v+f?(s.m=t,n.removeEventListener("updatefound",s.h)):(s.p=t,s.o.resolve(t)),++s.i,t.addEventListener("statechange",s.P)},s.P=function(n){var t=s.l,e=n.target,r=e.state,i=e===s.m,u=i?"external":"",c={sw:e,originalEvent:n};!i&&s.j&&(c.isUpdate=!0),s.dispatchEvent(new o(u+r,c)),"installed"===r?s.k=self.setTimeout(function(){"installed"===r&&t.waiting===e&&s.dispatchEvent(new o(u+"waiting",c))},a):"activating"===r&&(clearTimeout(s.k),i||s.u.resolve(e))},s.O=function(n){var t=s.p;t===navigator.serviceWorker.controller&&(s.dispatchEvent(new o("controlling",{sw:t,originalEvent:n,isUpdate:s.j})),s.s.resolve(t))},s._=c(function(n){var t=n.data,e=s,r=e.dispatchEvent;return u(s.getSW(),function(i){r.call(e,new o("message",{data:t,sw:i,originalEvent:n}))})}),s.g=t,s.t=e,s}v=n,(s=l).prototype=Object.create(v.prototype),s.prototype.constructor=s,s.__proto__=v;var d,g,w,m=l.prototype;return m.register=c(function(n){var t=this,e=(void 0===n?{}:n).immediate,r=void 0!==e&&e;return function(n,t){var e=n();if(e&&e.then)return e.then(t);return t(e)}(function(){if(!r&&"complete"!==document.readyState)return h(new Promise(function(n){return addEventListener("load",n)}))},function(){return t.j=Boolean(navigator.serviceWorker.controller),t.L=t.M(),u(t.R(),function(n){t.l=n,t.L&&(t.p=t.L,t.u.resolve(t.L),t.s.resolve(t.L),t.L.addEventListener("statechange",t.P,{once:!0}));var e=t.l.waiting;return e&&i(e.scriptURL,t.g)&&(t.p=e,Promise.resolve().then(function(){t.dispatchEvent(new o("waiting",{sw:e,wasWaitingBeforeRegister:!0}))})),t.p&&t.o.resolve(t.p),t.l.addEventListener("updatefound",t.h),navigator.serviceWorker.addEventListener("controllerchange",t.O,{once:!0}),navigator.serviceWorker.addEventListener("message",t._),t.l})})}),m.update=c(function(){if(this.l)return h(this.l.update())}),m.getSW=c(function(){return void 0!==this.p?this.p:this.o.promise}),m.messageSW=c(function(n){return u(this.getSW(),function(e){return t(e,n)})}),m.M=function(){var n=navigator.serviceWorker.controller;return n&&i(n.scriptURL,this.g)?n:void 0},m.R=c(function(){var n=this;return function(n,t){try{var e=n()}catch(n){return t(n)}if(e&&e.then)return e.then(void 0,t);return e}(function(){return u(navigator.serviceWorker.register(n.g,n.t),function(t){return n.v=performance.now(),t})},function(n){throw n})}),d=l,(g=[{key:"active",get:function(){return this.u.promise}},{key:"controlling",get:function(){return this.s.promise}}])&&e(d.prototype,g),w&&e(d,w),l}(function(){function n(){this.U=new Map}var t=n.prototype;return t.addEventListener=function(n,t){this.B(n).add(t)},t.removeEventListener=function(n,t){this.B(n).delete(t)},t.dispatchEvent=function(n){n.target=this;var t=this.B(n.type),e=Array.isArray(t),r=0;for(t=e?t:t[Symbol.iterator]();;){var i;if(e){if(r>=t.length)break;i=t[r++]}else{if((r=t.next()).done)break;i=r.value}i(n)}},t.B=function(n){return this.U.has(n)||this.U.set(n,new Set),this.U.get(n)},n}());function h(n,t){if(!t)return n&&n.then?n.then(s):Promise.resolve()}n.Workbox=v,n.messageSW=t,Object.defineProperty(n,"__esModule",{value:!0})});
//# sourceMappingURL=workbox-window.prod.umd.js.map
{
"name": "workbox-window",
"version": "5.0.0-alpha.2",
"version": "5.0.0-beta.0",
"license": "MIT",

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

"dependencies": {
"workbox-core": "^5.0.0-alpha.2"
"workbox-core": "^5.0.0-beta.0"
},
"gitHead": "0cb0029b692c3802545238fe59b6d6179ca32f6c"
"gitHead": "136b38f2c701bd7c04e808d19961310a9ede524b"
}
// @ts-ignore
try{self['workbox:window:5.0.0-alpha.2']&&_()}catch(e){}
try{self['workbox:window:5.0.0-beta.0']&&_()}catch(e){}

@@ -58,3 +58,2 @@ /*

private _sw?: ServiceWorker;
private _broadcastChannel?: BroadcastChannel;
private _externalSW?: ServiceWorker;

@@ -122,3 +121,2 @@ private _waitingTimeout?: number;

this._reportWindowReady(this._compatibleControllingSW);
this._compatibleControllingSW.addEventListener(

@@ -188,7 +186,3 @@ 'statechange', this._onStateChange, {once: true});

// Add message listeners.
if ('BroadcastChannel' in self) {
this._broadcastChannel = new BroadcastChannel('workbox');
this._broadcastChannel.addEventListener('message', this._onMessage);
}
// Add a message listener.
navigator.serviceWorker.addEventListener('message', this._onMessage);

@@ -325,19 +319,5 @@

/**
* Sends a message to the passed service worker that the window is ready.
*
* @param {ServiceWorker} sw
* @private
*/
private _reportWindowReady(sw: ServiceWorker) {
messageSW(sw, {
type: 'WINDOW_READY',
meta: 'workbox-window',
});
}
/**
* @private
*/
private _onUpdateFound = () => {

@@ -535,4 +515,3 @@ // `this._registration` will never be `undefined` after an update is found.

/**
* The `message` event is dispatched any time a `postMessage` (or a
* `BroadcastChannel` message with the `workbox` channel name) is received.
* The `message` event is dispatched any time a `postMessage` is received.
*

@@ -539,0 +518,0 @@ * @event module:workbox-window.Workbox#message

@@ -31,3 +31,2 @@ import { WorkboxEventTarget } from './utils/WorkboxEventTarget.js';

private _sw?;
private _broadcastChannel?;
private _externalSW?;

@@ -133,11 +132,4 @@ private _waitingTimeout?;

/**
* Sends a message to the passed service worker that the window is ready.
*
* @param {ServiceWorker} sw
* @private
*/
private _reportWindowReady;
/**
* @private
*/
private _onUpdateFound;

@@ -161,4 +153,3 @@ /**

/**
* The `message` event is dispatched any time a `postMessage` (or a
* `BroadcastChannel` message with the `workbox` channel name) is received.
* The `message` event is dispatched any time a `postMessage` is received.
*

@@ -165,0 +156,0 @@ * @event module:workbox-window.Workbox#message

@@ -277,3 +277,2 @@ /*

this._controllingDeferred.resolve(this._compatibleControllingSW);
this._reportWindowReady(this._compatibleControllingSW);
this._compatibleControllingSW.addEventListener('statechange', this._onStateChange, { once: true });

@@ -333,7 +332,3 @@ }

navigator.serviceWorker.addEventListener('controllerchange', this._onControllerChange, { once: true });
// Add message listeners.
if ('BroadcastChannel' in self) {
this._broadcastChannel = new BroadcastChannel('workbox');
this._broadcastChannel.addEventListener('message', this._onMessage);
}
// Add a message listener.
navigator.serviceWorker.addEventListener('message', this._onMessage);

@@ -459,14 +454,2 @@ return this._registration;

}
/**
* Sends a message to the passed service worker that the window is ready.
*
* @param {ServiceWorker} sw
* @private
*/
_reportWindowReady(sw) {
messageSW(sw, {
type: 'WINDOW_READY',
meta: 'workbox-window',
});
}
}

@@ -476,4 +459,3 @@ // The jsdoc comments below outline the events this instance may dispatch:

/**
* The `message` event is dispatched any time a `postMessage` (or a
* `BroadcastChannel` message with the `workbox` channel name) is received.
* The `message` event is dispatched any time a `postMessage` is received.
*

@@ -480,0 +462,0 @@ * @event module:workbox-window.Workbox#message

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

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

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc