workbox-google-analytics
Advanced tools
Comparing version 3.0.0-alpha.4 to 3.0.0-alpha.5
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self.workbox.v['workbox:google-analytics:3.0.0-alpha.4'] = 1; | ||
self.workbox.v['workbox:google-analytics:3.0.0-alpha.5'] = 1; | ||
} catch (e) {} // eslint-disable-line | ||
@@ -9,0 +9,0 @@ |
@@ -1,3 +0,3 @@ | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(e,t,n,o,r,c,s){"use strict";try{self.workbox.v["workbox:google-analytics:3.0.0-alpha.4"]=1}catch(e){}const a="www.google-analytics.com",l=/^\/(\w+\/)?collect/,w=e=>(()=>{var t=babelHelpers.asyncToGenerator(function*({url:t,timestamp:n,requestInit:o}){t=new URL(t);let r;if(o.body){const e=yield c=o.body,new Promise((e,t)=>{const n=new FileReader;n.onloadend=(()=>e(n.result)),n.onerror=(()=>t(n.error)),n.readAsText(c)});r=new URLSearchParams(e)}else r=t.searchParams;var c;const s=Date.now()-n;if(r.set("qt",s),e.parameterOverrides)for(const t of Object.keys(e.parameterOverrides)){const n=e.parameterOverrides[t];r.set(t,n)}"function"==typeof e.hitFilter&&e.hitFilter.call(null,r),o.body=r.toString(),o.method="POST",o.mode="cors",o.credentials="omit",o.headers='[["Content-Type", "text/plain"]]',o.url=`${t.origin}${t.pathname}`});return function(e){return t.apply(this,arguments)}})();return e.initialize=((e={})=>{const i=n.cacheNames.getGoogleAnalyticsName(e.cacheName),u=new t.Plugin("workbox-google-analytics",{maxRetentionTime:1728e5,callbacks:{requestWillReplay:w(e)}}),f=[(e=>{const t=new c.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>e.hostname===a&&"/analytics.js"===e.pathname,t,"GET")})(i),(e=>{const t=new c.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,t,"GET")})(i),...(e=>{const t=({url:e})=>e.hostname===a&&l.test(e.pathname),n=new s.NetworkOnly({plugins:[e]});return[new o.Route(t,n,"GET"),new o.Route(t,n,"POST")]})(u)],m=new r.Router;for(const e of f)m.registerRoute(e);self.addEventListener("fetch",e=>{const t=m.handleRequest(e);t&&e.respondWith(t)})}),e}({},workbox.backgroundSync,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies); | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(e,t,n,o,r,c,s){"use strict";try{self.workbox.v["workbox:google-analytics:3.0.0-alpha.5"]=1}catch(e){}const a="www.google-analytics.com",l=/^\/(\w+\/)?collect/,w=e=>(()=>{var t=babelHelpers.asyncToGenerator(function*({url:t,timestamp:n,requestInit:o}){t=new URL(t);let r;if(o.body){const e=yield c=o.body,new Promise((e,t)=>{const n=new FileReader;n.onloadend=(()=>e(n.result)),n.onerror=(()=>t(n.error)),n.readAsText(c)});r=new URLSearchParams(e)}else r=t.searchParams;var c;const s=Date.now()-n;if(r.set("qt",s),e.parameterOverrides)for(const t of Object.keys(e.parameterOverrides)){const n=e.parameterOverrides[t];r.set(t,n)}"function"==typeof e.hitFilter&&e.hitFilter.call(null,r),o.body=r.toString(),o.method="POST",o.mode="cors",o.credentials="omit",o.headers='[["Content-Type", "text/plain"]]',o.url=`${t.origin}${t.pathname}`});return function(e){return t.apply(this,arguments)}})();return e.initialize=((e={})=>{const i=n.cacheNames.getGoogleAnalyticsName(e.cacheName),u=new t.Plugin("workbox-google-analytics",{maxRetentionTime:1728e5,callbacks:{requestWillReplay:w(e)}}),f=[(e=>{const t=new c.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>e.hostname===a&&"/analytics.js"===e.pathname,t,"GET")})(i),(e=>{const t=new c.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,t,"GET")})(i),...(e=>{const t=({url:e})=>e.hostname===a&&l.test(e.pathname),n=new s.NetworkOnly({plugins:[e]});return[new o.Route(t,n,"GET"),new o.Route(t,n,"POST")]})(u)],m=new r.Router;for(const e of f)m.registerRoute(e);self.addEventListener("fetch",e=>{const t=m.handleRequest(e);t&&e.respondWith(t)})}),e}({},workbox.backgroundSync,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies); | ||
//# sourceMappingURL=workbox-google-analytics.prod.js.map |
{ | ||
"name": "workbox-google-analytics", | ||
"version": "3.0.0-alpha.4", | ||
"version": "3.0.0-alpha.5", | ||
"license": "Apache-2.0", | ||
@@ -31,7 +31,7 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-background-sync": "^3.0.0-alpha.4", | ||
"workbox-core": "^3.0.0-alpha.4", | ||
"workbox-routing": "^3.0.0-alpha.4", | ||
"workbox-strategies": "^3.0.0-alpha.4" | ||
"workbox-background-sync": "^3.0.0-alpha.5", | ||
"workbox-core": "^3.0.0-alpha.5", | ||
"workbox-routing": "^3.0.0-alpha.5", | ||
"workbox-strategies": "^3.0.0-alpha.5" | ||
} | ||
} |
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
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