Socket
Socket
Sign inDemoInstall

workbox-google-analytics

Package Overview
Dependencies
Maintainers
3
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-google-analytics - npm Package Compare versions

Comparing version 3.0.0-alpha.2 to 3.0.0-alpha.3

2

build/workbox-google-analytics.dev.js

@@ -6,3 +6,3 @@ this.workbox = this.workbox || {};

try {
self.workbox.v['workbox:google-analytics:3.0.0-alpha.2'] = 1;
self.workbox.v['workbox:google-analytics:3.0.0-alpha.3'] = 1;
} catch (e) {} // eslint-disable-line

@@ -9,0 +9,0 @@

@@ -1,2 +0,2 @@

this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(e,t,n,o,c,r,s){"use strict";try{self.workbox.v["workbox:google-analytics:3.0.0-alpha.2"]=1}catch(e){}const l=/^\/(\w+\/)?collect/;return e.initialize=((e={})=>{const a=n.cacheNames.getGoogleAnalyticsName(e.cacheName),w=new t.Plugin("workbox-google-analytics",{maxRetentionTime:1728e5,callbacks:{requestWillReplay:(e=>(()=>{var t=babelHelpers.asyncToGenerator(function*({url:t,timestamp:n,requestInit:o}){t=new URL(t);let c;if(o.body){const e=yield(e=>new Promise((t,n)=>{const o=new FileReader;o.onloadend=(()=>t(o.result)),o.onerror=(()=>n(o.error)),o.readAsText(e)}))(o.body);c=new URLSearchParams(e)}else c=t.searchParams;const r=Date.now()-n;if(c.set("qt",r),e.parameterOverrides)for(const t of Object.keys(e.parameterOverrides)){const n=e.parameterOverrides[t];c.set(t,n)}"function"==typeof e.hitFilter&&e.hitFilter.call(null,c),o.body=c.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)}})())(e)}}),i=[(e=>{const t=new r.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>"www.google-analytics.com"===e.hostname&&"/analytics.js"===e.pathname,t,"GET")})(a),(e=>{const t=new r.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,t,"GET")})(a),...(e=>{const t=({url:e})=>"www.google-analytics.com"===e.hostname&&l.test(e.pathname),n=new s.NetworkOnly({plugins:[e]});return[new o.Route(t,n,"GET"),new o.Route(t,n,"POST")]})(w)],u=new c.Router;for(const e of i)u.registerRoute(e);self.addEventListener("fetch",e=>{const t=u.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,c,r,s){"use strict";try{self.workbox.v["workbox:google-analytics:3.0.0-alpha.3"]=1}catch(e){}const l=/^\/(\w+\/)?collect/;return e.initialize=((e={})=>{const a=n.cacheNames.getGoogleAnalyticsName(e.cacheName),w=new t.Plugin("workbox-google-analytics",{maxRetentionTime:1728e5,callbacks:{requestWillReplay:(e=>(()=>{var t=babelHelpers.asyncToGenerator(function*({url:t,timestamp:n,requestInit:o}){t=new URL(t);let c;if(o.body){const e=yield(e=>new Promise((t,n)=>{const o=new FileReader;o.onloadend=(()=>t(o.result)),o.onerror=(()=>n(o.error)),o.readAsText(e)}))(o.body);c=new URLSearchParams(e)}else c=t.searchParams;const r=Date.now()-n;if(c.set("qt",r),e.parameterOverrides)for(const t of Object.keys(e.parameterOverrides)){const n=e.parameterOverrides[t];c.set(t,n)}"function"==typeof e.hitFilter&&e.hitFilter.call(null,c),o.body=c.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)}})())(e)}}),i=[(e=>{const t=new r.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>"www.google-analytics.com"===e.hostname&&"/analytics.js"===e.pathname,t,"GET")})(a),(e=>{const t=new r.NetworkFirst({cacheName:e});return new o.Route(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,t,"GET")})(a),...(e=>{const t=({url:e})=>"www.google-analytics.com"===e.hostname&&l.test(e.pathname),n=new s.NetworkOnly({plugins:[e]});return[new o.Route(t,n,"GET"),new o.Route(t,n,"POST")]})(w)],u=new c.Router;for(const e of i)u.registerRoute(e);self.addEventListener("fetch",e=>{const t=u.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.2",
"version": "3.0.0-alpha.3",
"license": "Apache-2.0",

@@ -31,7 +31,7 @@ "author": "Google's Web DevRel Team",

"dependencies": {
"workbox-background-sync": "^3.0.0-alpha.2",
"workbox-core": "^3.0.0-alpha.2",
"workbox-routing": "^3.0.0-alpha.2",
"workbox-strategies": "^3.0.0-alpha.2"
"workbox-background-sync": "^3.0.0-alpha.3",
"workbox-core": "^3.0.0-alpha.3",
"workbox-routing": "^3.0.0-alpha.3",
"workbox-strategies": "^3.0.0-alpha.3"
}
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc