workbox-google-analytics
Advanced tools
Comparing version 4.0.0-beta.0 to 4.0.0-beta.1
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self.workbox.v['workbox:google-analytics:4.0.0-beta.0'] = 1; | ||
self.workbox.v['workbox:google-analytics:4.0.0-beta.1'] = 1; | ||
} catch (e) {} // eslint-disable-line | ||
@@ -218,10 +218,2 @@ | ||
/* | ||
Copyright 2018 Google LLC | ||
Use of this source code is governed by an MIT-style | ||
license that can be found in the LICENSE file or at | ||
https://opensource.org/licenses/MIT. | ||
*/ | ||
exports.initialize = initialize; | ||
@@ -228,0 +220,0 @@ |
@@ -1,3 +0,3 @@ | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(t,e,o,n,c,a,r){"use strict";try{self.workbox.v["workbox:google-analytics:4.0.0-beta.0"]=1}catch(t){}const w=/^\/(\w+\/)?collect/;return t.initialize=((t={})=>{const s=o.cacheNames.getGoogleAnalyticsName(t.cacheName),i=new e.Plugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:(t=>async({queue:e})=>{let o;for(;o=await e.shiftRequest();){const{request:n,timestamp:c}=o,a=new URL(n.url);try{const r="POST"===n.method?new URLSearchParams(await n.text()):a.searchParams,w=c-(Number(r.get("qt"))||0),s=Date.now()-w;if(r.set("qt",s),t.parameterOverrides)for(const e of Object.keys(t.parameterOverrides)){const o=t.parameterOverrides[e];r.set(e,o)}"function"==typeof t.hitFilter&&t.hitFilter.call(null,r),await fetch(new Request(a.origin+a.pathname,{body:r.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(t){return void await e.unshiftRequest(o)}}})(t)}),l=[(t=>{const e=new a.NetworkFirst({cacheName:t});return new n.Route(({url:t})=>"www.google-analytics.com"===t.hostname&&"/analytics.js"===t.pathname,e,"GET")})(s),(t=>{const e=new a.NetworkFirst({cacheName:t});return new n.Route(({url:t})=>"www.googletagmanager.com"===t.hostname&&"/gtag/js"===t.pathname,e,"GET")})(s),...(t=>{const e=({url:t})=>"www.google-analytics.com"===t.hostname&&w.test(t.pathname),o=new r.NetworkOnly({plugins:[t]});return[new n.Route(e,o,"GET"),new n.Route(e,o,"POST")]})(i)],u=new c.Router;for(const t of l)u.registerRoute(t);u.addFetchListener()}),t}({},workbox.backgroundSync,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies); | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(t,e,o,n,c,a,r){"use strict";try{self.workbox.v["workbox:google-analytics:4.0.0-beta.1"]=1}catch(t){}const w=/^\/(\w+\/)?collect/;return t.initialize=((t={})=>{const s=o.cacheNames.getGoogleAnalyticsName(t.cacheName),i=new e.Plugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:(t=>async({queue:e})=>{let o;for(;o=await e.shiftRequest();){const{request:n,timestamp:c}=o,a=new URL(n.url);try{const r="POST"===n.method?new URLSearchParams(await n.text()):a.searchParams,w=c-(Number(r.get("qt"))||0),s=Date.now()-w;if(r.set("qt",s),t.parameterOverrides)for(const e of Object.keys(t.parameterOverrides)){const o=t.parameterOverrides[e];r.set(e,o)}"function"==typeof t.hitFilter&&t.hitFilter.call(null,r),await fetch(new Request(a.origin+a.pathname,{body:r.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(t){return void await e.unshiftRequest(o)}}})(t)}),l=[(t=>{const e=new a.NetworkFirst({cacheName:t});return new n.Route(({url:t})=>"www.google-analytics.com"===t.hostname&&"/analytics.js"===t.pathname,e,"GET")})(s),(t=>{const e=new a.NetworkFirst({cacheName:t});return new n.Route(({url:t})=>"www.googletagmanager.com"===t.hostname&&"/gtag/js"===t.pathname,e,"GET")})(s),...(t=>{const e=({url:t})=>"www.google-analytics.com"===t.hostname&&w.test(t.pathname),o=new r.NetworkOnly({plugins:[t]});return[new n.Route(e,o,"GET"),new n.Route(e,o,"POST")]})(i)],u=new c.Router;for(const t of l)u.registerRoute(t);u.addFetchListener()}),t}({},workbox.backgroundSync,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies); | ||
//# sourceMappingURL=workbox-offline-ga.prod.js.map |
{ | ||
"name": "workbox-google-analytics", | ||
"version": "4.0.0-beta.0", | ||
"version": "4.0.0-beta.1", | ||
"license": "MIT", | ||
@@ -32,8 +32,8 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-background-sync": "^4.0.0-beta.0", | ||
"workbox-core": "^4.0.0-beta.0", | ||
"workbox-routing": "^4.0.0-beta.0", | ||
"workbox-strategies": "^4.0.0-beta.0" | ||
"workbox-background-sync": "^4.0.0-beta.1", | ||
"workbox-core": "^4.0.0-beta.1", | ||
"workbox-routing": "^4.0.0-beta.1", | ||
"workbox-strategies": "^4.0.0-beta.1" | ||
}, | ||
"gitHead": "bc90cc4bdb1f8ad435564aa84b0c90acfac611e2" | ||
"gitHead": "dda07c48e184f57ce5dfe3b3e93af316989a0877" | ||
} |
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
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
28894
11
398