workbox-google-analytics
Advanced tools
Comparing version 3.0.0-alpha.6 to 3.0.0-beta.0
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self.workbox.v['workbox:google-analytics:3.0.0-alpha.6'] = 1; | ||
self.workbox.v['workbox:google-analytics:3.0.0-beta.0'] = 1; | ||
} catch (e) {} // eslint-disable-line | ||
@@ -26,3 +26,3 @@ | ||
const QUEUE_NAME = 'workbox-google-analytics'; | ||
const MAX_RETENTION_TIME = 1000 * 60 * 60 * 48; // Two days | ||
const MAX_RETENTION_TIME = 60 * 48; // Two days in minutes | ||
const GOOGLE_ANALYTICS_HOST = 'www.google-analytics.com'; | ||
@@ -29,0 +29,0 @@ const GTM_HOST = 'www.googletagmanager.com'; |
@@ -1,3 +0,3 @@ | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(e,n,t,o,r,c,s){"use strict";try{self.workbox.v["workbox:google-analytics:3.0.0-alpha.6"]=1}catch(e){}const i="www.google-analytics.com",l=/^\/(\w+\/)?collect/,a=(()=>{var e=babelHelpers.asyncToGenerator(function*(e){return yield new Promise(function(n,t){const o=new FileReader;o.onloadend=function(){return n(o.result)},o.onerror=function(){return t(o.error)},o.readAsText(e)})});return function(n){return e.apply(this,arguments)}})(),u=e=>(()=>{var n=babelHelpers.asyncToGenerator(function*({url:n,timestamp:t,requestInit:o}){n=new URL(n);let r;if(o.body){const e=yield a(o.body);r=new URLSearchParams(e)}else r=n.searchParams;const c=Date.now()-t;if(r.set("qt",c),e.parameterOverrides)for(const n of Object.keys(e.parameterOverrides)){const t=e.parameterOverrides[n];r.set(n,t)}"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=`${n.origin}${n.pathname}`});return function(e){return n.apply(this,arguments)}})();return e.initialize=((e={})=>{const a=t.cacheNames.getGoogleAnalyticsName(e.cacheName),w=new n.Plugin("workbox-google-analytics",{maxRetentionTime:1728e5,callbacks:{requestWillReplay:u(e)}}),f=[(e=>{const n=new c.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>e.hostname===i&&"/analytics.js"===e.pathname,n,"GET")})(a),(e=>{const n=new c.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,n,"GET")})(a),...(e=>{const n=({url:e})=>e.hostname===i&&l.test(e.pathname),t=new s.NetworkOnly({plugins:[e]});return[new o.Route(n,t,"GET"),new o.Route(n,t,"POST")]})(w)],b=new r.Router;for(const e of f)b.registerRoute(e);self.addEventListener("fetch",e=>{const n=b.handleRequest(e);n&&e.respondWith(n)})}),e}({},workbox.backgroundSync,workbox.core._private,workbox.routing,workbox.routing,workbox.strategies,workbox.strategies); | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(e,n,t,o,r,c,s){"use strict";try{self.workbox.v["workbox:google-analytics:3.0.0-beta.0"]=1}catch(e){}const i="www.google-analytics.com",l=/^\/(\w+\/)?collect/,a=(()=>{var e=babelHelpers.asyncToGenerator(function*(e){return yield new Promise(function(n,t){const o=new FileReader;o.onloadend=function(){return n(o.result)},o.onerror=function(){return t(o.error)},o.readAsText(e)})});return function(n){return e.apply(this,arguments)}})(),u=e=>(()=>{var n=babelHelpers.asyncToGenerator(function*({url:n,timestamp:t,requestInit:o}){n=new URL(n);let r;if(o.body){const e=yield a(o.body);r=new URLSearchParams(e)}else r=n.searchParams;const c=Date.now()-t;if(r.set("qt",c),e.parameterOverrides)for(const n of Object.keys(e.parameterOverrides)){const t=e.parameterOverrides[n];r.set(n,t)}"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=`${n.origin}${n.pathname}`});return function(e){return n.apply(this,arguments)}})();return e.initialize=((e={})=>{const a=t.cacheNames.getGoogleAnalyticsName(e.cacheName),w=new n.Plugin("workbox-google-analytics",{maxRetentionTime:2880,callbacks:{requestWillReplay:u(e)}}),f=[(e=>{const n=new c.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>e.hostname===i&&"/analytics.js"===e.pathname,n,"GET")})(a),(e=>{const n=new c.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,n,"GET")})(a),...(e=>{const n=({url:e})=>e.hostname===i&&l.test(e.pathname),t=new s.NetworkOnly({plugins:[e]});return[new o.Route(n,t,"GET"),new o.Route(n,t,"POST")]})(w)],b=new r.Router;for(const e of f)b.registerRoute(e);self.addEventListener("fetch",e=>{const n=b.handleRequest(e);n&&e.respondWith(n)})}),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.6", | ||
"version": "3.0.0-beta.0", | ||
"license": "Apache-2.0", | ||
@@ -31,7 +31,7 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-background-sync": "^3.0.0-alpha.6", | ||
"workbox-core": "^3.0.0-alpha.6", | ||
"workbox-routing": "^3.0.0-alpha.6", | ||
"workbox-strategies": "^3.0.0-alpha.6" | ||
"workbox-background-sync": "^3.0.0-beta.0", | ||
"workbox-core": "^3.0.0-beta.0", | ||
"workbox-routing": "^3.0.0-beta.0", | ||
"workbox-strategies": "^3.0.0-beta.0" | ||
} | ||
} |
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
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
31998
10