workbox-window
Advanced tools
Comparing version 5.0.0-rc.1 to 5.0.0-rc.2
"use strict"; | ||
// @ts-ignore | ||
try { | ||
self['workbox:window:5.0.0-rc.1'] && _(); | ||
self['workbox:window:5.0.0-rc.2'] && _(); | ||
} | ||
catch (e) { } |
@@ -8,3 +8,3 @@ (function (global, factory) { | ||
try { | ||
self['workbox:window:5.0.0-rc.1'] && _(); | ||
self['workbox:window:5.0.0-rc.2'] && _(); | ||
} catch (e) {} | ||
@@ -31,3 +31,2 @@ | ||
* @return {Promise<Object|undefined>} | ||
* | ||
* @memberof module:workbox-window | ||
@@ -71,3 +70,3 @@ */ | ||
try { | ||
self['workbox:core:5.0.0-rc.1'] && _(); | ||
self['workbox:core:5.0.0-rc.2'] && _(); | ||
} catch (e) {} | ||
@@ -128,3 +127,8 @@ | ||
var logger = function () { | ||
self.__WB_DISABLE_DEV_LOGS = false; | ||
// Don't overwrite this value if it's already set. | ||
// See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923 | ||
if (!('__WB_DISABLE_DEV_LOGS' in self)) { | ||
self.__WB_DISABLE_DEV_LOGS = false; | ||
} | ||
var inGroup = false; | ||
@@ -377,3 +381,2 @@ var methodToColorMap = { | ||
* @fires [externalactivated]{@link module:workbox-window.Workbox#externalactivated} | ||
* | ||
* @memberof module:workbox-window | ||
@@ -893,3 +896,9 @@ */ | ||
return Workbox; | ||
}(WorkboxEventTarget); // The jsdoc comments below outline the events this instance may dispatch: | ||
}(WorkboxEventTarget); | ||
function _awaitIgnored(value, direct) { | ||
if (!direct) { | ||
return value && value.then ? value.then(_empty) : Promise.resolve(); | ||
} | ||
} // The jsdoc comments below outline the events this instance may dispatch: | ||
// ----------------------------------------------------------------------- | ||
@@ -1053,8 +1062,2 @@ | ||
function _awaitIgnored(value, direct) { | ||
if (!direct) { | ||
return value && value.then ? value.then(_empty) : Promise.resolve(); | ||
} | ||
} | ||
function _invoke(body, then) { | ||
@@ -1061,0 +1064,0 @@ var result = body(); |
@@ -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-rc.1"]&&_()}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-rc.1"]&&_()}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=new Set,s.l=function(){var n=s.g,t=n.installing;s.i>0||!i(t.scriptURL,s.m)||performance.now()>s.v+f?(s.p=t,n.removeEventListener("updatefound",s.l)):(s.P=t,s.h.add(t),s.o.resolve(t)),++s.i,t.addEventListener("statechange",s.j)},s.j=function(n){var t=s.g,e=n.target,r=e.state,i=e===s.p,u=i?"external":"",c={sw:e,originalEvent:n};!i&&s.k&&(c.isUpdate=!0),s.dispatchEvent(new o(u+r,c)),"installed"===r?s.O=self.setTimeout(function(){"installed"===r&&t.waiting===e&&s.dispatchEvent(new o(u+"waiting",c))},a):"activating"===r&&(clearTimeout(s.O),i||s.u.resolve(e))},s._=function(n){var t=s.P;t===navigator.serviceWorker.controller&&(s.dispatchEvent(new o("controlling",{sw:t,originalEvent:n,isUpdate:s.k})),s.s.resolve(t))},s.M=c(function(n){var t=n.data,e=n.source;return u(s.getSW(),function(){s.h.has(e)&&s.dispatchEvent(new o("message",{data:t,sw:e,originalEvent:n}))})}),s.m=t,s.t=e,navigator.serviceWorker.addEventListener("message",s.M),s}v=n,(s=l).prototype=Object.create(v.prototype),s.prototype.constructor=s,s.__proto__=v;var w,d,g,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 window.addEventListener("load",n)}))},function(){return t.k=Boolean(navigator.serviceWorker.controller),t.R=t.S(),u(t.U(),function(n){t.g=n,t.R&&(t.P=t.R,t.u.resolve(t.R),t.s.resolve(t.R),t.R.addEventListener("statechange",t.j,{once:!0}));var e=t.g.waiting;return e&&i(e.scriptURL,t.m)&&(t.P=e,Promise.resolve().then(function(){t.dispatchEvent(new o("waiting",{sw:e,wasWaitingBeforeRegister:!0}))}).then(function(){})),t.P&&(t.o.resolve(t.P),t.h.add(t.P)),t.g.addEventListener("updatefound",t.l),navigator.serviceWorker.addEventListener("controllerchange",t._,{once:!0}),t.g})})}),m.update=c(function(){if(this.g)return h(this.g.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.S=function(){var n=navigator.serviceWorker.controller;return n&&i(n.scriptURL,this.m)?n:void 0},m.U=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.m,n.t),function(t){return n.v=performance.now(),t})},function(n){throw n})}),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.B=new Map}var t=n.prototype;return t.addEventListener=function(n,t){this.L(n).add(t)},t.removeEventListener=function(n,t){this.L(n).delete(t)},t.dispatchEvent=function(n){n.target=this;var t=this.L(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.L=function(n){return this.B.has(n)||this.B.set(n,new Set),this.B.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})}); | ||
!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-rc.2"]&&_()}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-rc.2"]&&_()}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=new Set,s.l=function(){var n=s.g,t=n.installing;s.i>0||!i(t.scriptURL,s.m)||performance.now()>s.v+f?(s.p=t,n.removeEventListener("updatefound",s.l)):(s.P=t,s.h.add(t),s.o.resolve(t)),++s.i,t.addEventListener("statechange",s.j)},s.j=function(n){var t=s.g,e=n.target,r=e.state,i=e===s.p,u=i?"external":"",c={sw:e,originalEvent:n};!i&&s.k&&(c.isUpdate=!0),s.dispatchEvent(new o(u+r,c)),"installed"===r?s.O=self.setTimeout(function(){"installed"===r&&t.waiting===e&&s.dispatchEvent(new o(u+"waiting",c))},a):"activating"===r&&(clearTimeout(s.O),i||s.u.resolve(e))},s._=function(n){var t=s.P;t===navigator.serviceWorker.controller&&(s.dispatchEvent(new o("controlling",{sw:t,originalEvent:n,isUpdate:s.k})),s.s.resolve(t))},s.M=c(function(n){var t=n.data,e=n.source;return u(s.getSW(),function(){s.h.has(e)&&s.dispatchEvent(new o("message",{data:t,sw:e,originalEvent:n}))})}),s.m=t,s.t=e,navigator.serviceWorker.addEventListener("message",s.M),s}v=n,(s=l).prototype=Object.create(v.prototype),s.prototype.constructor=s,s.__proto__=v;var w,d,g,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 window.addEventListener("load",n)}))},function(){return t.k=Boolean(navigator.serviceWorker.controller),t.R=t.S(),u(t.U(),function(n){t.g=n,t.R&&(t.P=t.R,t.u.resolve(t.R),t.s.resolve(t.R),t.R.addEventListener("statechange",t.j,{once:!0}));var e=t.g.waiting;return e&&i(e.scriptURL,t.m)&&(t.P=e,Promise.resolve().then(function(){t.dispatchEvent(new o("waiting",{sw:e,wasWaitingBeforeRegister:!0}))}).then(function(){})),t.P&&(t.o.resolve(t.P),t.h.add(t.P)),t.g.addEventListener("updatefound",t.l),navigator.serviceWorker.addEventListener("controllerchange",t._,{once:!0}),t.g})})}),m.update=c(function(){if(this.g)return h(this.g.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.S=function(){var n=navigator.serviceWorker.controller;return n&&i(n.scriptURL,this.m)?n:void 0},m.U=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.m,n.t),function(t){return n.v=performance.now(),t})},function(n){throw n})}),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.B=new Map}var t=n.prototype;return t.addEventListener=function(n,t){this.L(n).add(t)},t.removeEventListener=function(n,t){this.L(n).delete(t)},t.dispatchEvent=function(n){n.target=this;var t=this.L(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.L=function(n){return this.B.has(n)||this.B.set(n,new Set),this.B.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 |
@@ -14,5 +14,5 @@ import './_version.js'; | ||
* @return {Promise<Object|undefined>} | ||
* | ||
* @memberof module:workbox-window | ||
*/ | ||
export declare function messageSW(sw: ServiceWorker, data: {}): Promise<any>; | ||
declare function messageSW(sw: ServiceWorker, data: {}): Promise<any>; | ||
export { messageSW }; |
@@ -21,6 +21,5 @@ /* | ||
* @return {Promise<Object|undefined>} | ||
* | ||
* @memberof module:workbox-window | ||
*/ | ||
export function messageSW(sw, data) { | ||
function messageSW(sw, data) { | ||
return new Promise((resolve) => { | ||
@@ -35,1 +34,2 @@ let messageChannel = new MessageChannel(); | ||
; | ||
export { messageSW }; |
{ | ||
"name": "workbox-window", | ||
"version": "5.0.0-rc.1", | ||
"version": "5.0.0-rc.2", | ||
"license": "MIT", | ||
@@ -32,5 +32,5 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-core": "^5.0.0-rc.1" | ||
"workbox-core": "^5.0.0-rc.2" | ||
}, | ||
"gitHead": "f03f71e50507e13d82d4e0a875cc49ba4501aff3" | ||
"gitHead": "89904768b2210e59c830dd380cf88a06e1c26a2b" | ||
} |
// @ts-ignore | ||
try{self['workbox:window:5.0.0-rc.1']&&_()}catch(e){} | ||
try{self['workbox:window:5.0.0-rc.2']&&_()}catch(e){} |
@@ -24,6 +24,5 @@ /* | ||
* @return {Promise<Object|undefined>} | ||
* | ||
* @memberof module:workbox-window | ||
*/ | ||
export function messageSW(sw: ServiceWorker, data: {}): Promise<any> { | ||
function messageSW(sw: ServiceWorker, data: {}): Promise<any> { | ||
return new Promise((resolve) => { | ||
@@ -37,1 +36,3 @@ let messageChannel = new MessageChannel(); | ||
}; | ||
export {messageSW} |
@@ -20,2 +20,3 @@ /* | ||
// The time a SW must be in the waiting phase before we can conclude | ||
@@ -43,3 +44,2 @@ // `skipWaiting()` wasn't called. This 200 amount wasn't scientifically | ||
* @fires [externalactivated]{@link module:workbox-window.Workbox#externalactivated} | ||
* | ||
* @memberof module:workbox-window | ||
@@ -529,2 +529,4 @@ */ | ||
export {Workbox}; | ||
// The jsdoc comments below outline the events this instance may dispatch: | ||
@@ -687,3 +689,1 @@ // ----------------------------------------------------------------------- | ||
*/ | ||
export {Workbox}; |
@@ -16,3 +16,2 @@ import { WorkboxEventTarget } from './utils/WorkboxEventTarget.js'; | ||
* @fires [externalactivated]{@link module:workbox-window.Workbox#externalactivated} | ||
* | ||
* @memberof module:workbox-window | ||
@@ -152,2 +151,3 @@ */ | ||
} | ||
export { Workbox }; | ||
/** | ||
@@ -299,2 +299,1 @@ * The `message` event is dispatched any time a `postMessage` is received. | ||
*/ | ||
export { Workbox }; |
@@ -36,3 +36,2 @@ /* | ||
* @fires [externalactivated]{@link module:workbox-window.Workbox#externalactivated} | ||
* | ||
* @memberof module:workbox-window | ||
@@ -471,2 +470,3 @@ */ | ||
} | ||
export { Workbox }; | ||
// The jsdoc comments below outline the events this instance may dispatch: | ||
@@ -620,2 +620,1 @@ // ----------------------------------------------------------------------- | ||
*/ | ||
export { Workbox }; |
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
4673
594128
Updatedworkbox-core@^5.0.0-rc.2