workbox-google-analytics
Advanced tools
Comparing version 6.4.2 to 6.5.0
"use strict"; | ||
// @ts-ignore | ||
try { | ||
self['workbox:google-analytics:6.4.1'] && _(); | ||
self['workbox:google-analytics:6.4.2'] && _(); | ||
} | ||
catch (e) { } |
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self['workbox:google-analytics:6.4.1'] && _(); | ||
self['workbox:google-analytics:6.4.2'] && _(); | ||
} catch (e) {} | ||
@@ -44,3 +44,3 @@ | ||
* | ||
* @param {Object} config See {@link module:workbox-google-analytics.initialize}. | ||
* @param {Object} config See {@link workbox-google-analytics.initialize}. | ||
* @return {Function} The requestWillDequeue callback function. | ||
@@ -212,3 +212,3 @@ * | ||
* | ||
* @memberof module:workbox-google-analytics | ||
* @memberof workbox-google-analytics | ||
*/ | ||
@@ -215,0 +215,0 @@ |
@@ -1,2 +0,2 @@ | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(t,e,o,n,r,c,a,w,s){"use strict";try{self["workbox:google-analytics:6.4.1"]&&_()}catch(t){}const i="www.google-analytics.com",l="www.googletagmanager.com",u=/^\/(\w+\/)?collect/,m=t=>{const e=({url:t})=>t.hostname===i&&u.test(t.pathname),o=new s.NetworkOnly({plugins:[t]});return[new c.Route(e,o,"GET"),new c.Route(e,o,"POST")]},g=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===i&&"/analytics.js"===t.pathname),e,"GET")},h=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===l&&"/gtag/js"===t.pathname),e,"GET")},b=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===l&&"/gtm.js"===t.pathname),e,"GET")};return t.initialize=(t={})=>{const n=o.cacheNames.getGoogleAnalyticsName(t.cacheName),r=new e.BackgroundSyncPlugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:(c=t,async({queue:t})=>{let e;for(;e=await t.shiftRequest();){const{request:o,timestamp:n}=e,r=new URL(o.url);try{const t="POST"===o.method?new URLSearchParams(await o.clone().text()):r.searchParams,e=n-(Number(t.get("qt"))||0),a=Date.now()-e;if(t.set("qt",String(a)),c.parameterOverrides)for(const e of Object.keys(c.parameterOverrides)){const o=c.parameterOverrides[e];t.set(e,o)}"function"==typeof c.hitFilter&&c.hitFilter.call(null,t),await fetch(new Request(r.origin+r.pathname,{body:t.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(o){throw await t.unshiftRequest(e),o}}})});var c;const w=[b(n),g(n),h(n),...m(r)],s=new a.Router;for(const t of w)s.registerRoute(t);s.addFetchListener()},t}({},workbox.backgroundSync,workbox.core._private,workbox.core._private,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies); | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(t,e,o,n,r,c,a,w,s){"use strict";try{self["workbox:google-analytics:6.4.2"]&&_()}catch(t){}const i="www.google-analytics.com",l="www.googletagmanager.com",u=/^\/(\w+\/)?collect/,m=t=>{const e=({url:t})=>t.hostname===i&&u.test(t.pathname),o=new s.NetworkOnly({plugins:[t]});return[new c.Route(e,o,"GET"),new c.Route(e,o,"POST")]},g=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===i&&"/analytics.js"===t.pathname),e,"GET")},h=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===l&&"/gtag/js"===t.pathname),e,"GET")},b=t=>{const e=new w.NetworkFirst({cacheName:t});return new c.Route((({url:t})=>t.hostname===l&&"/gtm.js"===t.pathname),e,"GET")};return t.initialize=(t={})=>{const n=o.cacheNames.getGoogleAnalyticsName(t.cacheName),r=new e.BackgroundSyncPlugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:(c=t,async({queue:t})=>{let e;for(;e=await t.shiftRequest();){const{request:o,timestamp:n}=e,r=new URL(o.url);try{const t="POST"===o.method?new URLSearchParams(await o.clone().text()):r.searchParams,e=n-(Number(t.get("qt"))||0),a=Date.now()-e;if(t.set("qt",String(a)),c.parameterOverrides)for(const e of Object.keys(c.parameterOverrides)){const o=c.parameterOverrides[e];t.set(e,o)}"function"==typeof c.hitFilter&&c.hitFilter.call(null,t),await fetch(new Request(r.origin+r.pathname,{body:t.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(o){throw await t.unshiftRequest(e),o}}})});var c;const w=[b(n),g(n),h(n),...m(r)],s=new a.Router;for(const t of w)s.registerRoute(t);s.addFetchListener()},t}({},workbox.backgroundSync,workbox.core._private,workbox.core._private,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies); | ||
//# sourceMappingURL=workbox-offline-ga.prod.js.map |
@@ -23,5 +23,5 @@ import './_version.js'; | ||
* | ||
* @memberof module:workbox-google-analytics | ||
* @memberof workbox-google-analytics | ||
*/ | ||
declare const initialize: (options?: GoogleAnalyticsInitializeOptions) => void; | ||
export { initialize }; |
@@ -24,3 +24,3 @@ /* | ||
* | ||
* @param {Object} config See {@link module:workbox-google-analytics.initialize}. | ||
* @param {Object} config See {@link workbox-google-analytics.initialize}. | ||
* @return {Function} The requestWillDequeue callback function. | ||
@@ -157,3 +157,3 @@ * | ||
* | ||
* @memberof module:workbox-google-analytics | ||
* @memberof workbox-google-analytics | ||
*/ | ||
@@ -160,0 +160,0 @@ const initialize = (options = {}) => { |
{ | ||
"name": "workbox-google-analytics", | ||
"version": "6.4.2", | ||
"version": "6.5.0", | ||
"license": "MIT", | ||
@@ -28,8 +28,8 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-background-sync": "6.4.2", | ||
"workbox-core": "6.4.2", | ||
"workbox-routing": "6.4.2", | ||
"workbox-strategies": "6.4.2" | ||
"workbox-background-sync": "6.5.0", | ||
"workbox-core": "6.5.0", | ||
"workbox-routing": "6.5.0", | ||
"workbox-strategies": "6.5.0" | ||
}, | ||
"gitHead": "9fae1320327a3a75bf71df9a76708978bd252428" | ||
"gitHead": "d796009eadcba556b2795e0fea7d71a241f535e0" | ||
} |
// @ts-ignore | ||
try{self['workbox:google-analytics:6.4.2']&&_()}catch(e){} | ||
try{self['workbox:google-analytics:6.5.0']&&_()}catch(e){} |
@@ -43,3 +43,3 @@ /* | ||
* | ||
* @param {Object} config See {@link module:workbox-google-analytics.initialize}. | ||
* @param {Object} config See {@link workbox-google-analytics.initialize}. | ||
* @return {Function} The requestWillDequeue callback function. | ||
@@ -209,3 +209,3 @@ * | ||
* | ||
* @memberof module:workbox-google-analytics | ||
* @memberof workbox-google-analytics | ||
*/ | ||
@@ -212,0 +212,0 @@ const initialize = (options: GoogleAnalyticsInitializeOptions = {}): void => { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
80586
+ Addedworkbox-background-sync@6.5.0(transitive)
+ Addedworkbox-core@6.5.0(transitive)
+ Addedworkbox-routing@6.5.0(transitive)
+ Addedworkbox-strategies@6.5.0(transitive)
- Removedworkbox-background-sync@6.4.2(transitive)
- Removedworkbox-core@6.4.2(transitive)
- Removedworkbox-routing@6.4.2(transitive)
- Removedworkbox-strategies@6.4.2(transitive)
Updatedworkbox-core@6.5.0
Updatedworkbox-routing@6.5.0
Updatedworkbox-strategies@6.5.0