workbox-google-analytics
Advanced tools
Comparing version 6.0.0-alpha.2 to 6.0.0-alpha.3
"use strict"; | ||
// @ts-ignore | ||
try { | ||
self['workbox:google-analytics:6.0.0-alpha.1'] && _(); | ||
self['workbox:google-analytics:6.0.0-alpha.2'] && _(); | ||
} | ||
catch (e) { } |
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self['workbox:google-analytics:6.0.0-alpha.1'] && _(); | ||
self['workbox:google-analytics:6.0.0-alpha.2'] && _(); | ||
} catch (e) {} | ||
@@ -99,3 +99,3 @@ | ||
if ("dev" !== 'production') { | ||
logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(url.href)}'` + `has been replayed`); | ||
logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(url.href)}' ` + `has been replayed`); | ||
} | ||
@@ -106,3 +106,3 @@ } catch (err) { | ||
{ | ||
logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(url.href)}'` + `failed to replay, putting it back in the queue.`); | ||
logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(url.href)}' ` + `failed to replay, putting it back in the queue.`); | ||
} | ||
@@ -109,0 +109,0 @@ |
@@ -1,2 +0,2 @@ | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(t,o,e,n,a,c,r,w,s){"use strict";try{self["workbox:google-analytics:6.0.0-alpha.1"]&&_()}catch(t){}const i=/^\/(\w+\/)?collect/,l=t=>{const o=({url:t})=>"www.google-analytics.com"===t.hostname&&i.test(t.pathname),e=new s.NetworkOnly({plugins:[t]});return[new c.Route(o,e,"GET"),new c.Route(o,e,"POST")]},g=t=>{const o=new w.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.google-analytics.com"===t.hostname&&"/analytics.js"===t.pathname,o,"GET")},m=t=>{const o=new w.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.googletagmanager.com"===t.hostname&&"/gtag/js"===t.pathname,o,"GET")},u=t=>{const o=new w.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.googletagmanager.com"===t.hostname&&"/gtm.js"===t.pathname,o,"GET")};return t.initialize=(t={})=>{const n=e.cacheNames.getGoogleAnalyticsName(t.cacheName),a=new o.BackgroundSyncPlugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:(c=t,async({queue:t})=>{let o;for(;o=await t.shiftRequest();){const{request:e,timestamp:n}=o,a=new URL(e.url);try{const t="POST"===e.method?new URLSearchParams(await e.clone().text()):a.searchParams,o=n-(Number(t.get("qt"))||0),r=Date.now()-o;if(t.set("qt",String(r)),c.parameterOverrides)for(const o of Object.keys(c.parameterOverrides)){const e=c.parameterOverrides[o];t.set(o,e)}"function"==typeof c.hitFilter&&c.hitFilter.call(null,t),await fetch(new Request(a.origin+a.pathname,{body:t.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(e){throw await t.unshiftRequest(o),e}}})});var c;const w=[u(n),g(n),m(n),...l(a)],s=new r.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.0.0-alpha.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 |
@@ -68,3 +68,3 @@ /* | ||
if (process.env.NODE_ENV !== 'production') { | ||
logger.log(`Request for '${getFriendlyURL(url.href)}'` + | ||
logger.log(`Request for '${getFriendlyURL(url.href)}' ` + | ||
`has been replayed`); | ||
@@ -76,3 +76,3 @@ } | ||
if (process.env.NODE_ENV !== 'production') { | ||
logger.log(`Request for '${getFriendlyURL(url.href)}'` + | ||
logger.log(`Request for '${getFriendlyURL(url.href)}' ` + | ||
`failed to replay, putting it back in the queue.`); | ||
@@ -79,0 +79,0 @@ } |
{ | ||
"name": "workbox-google-analytics", | ||
"version": "6.0.0-alpha.2", | ||
"version": "6.0.0-alpha.3", | ||
"license": "MIT", | ||
@@ -28,8 +28,8 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-background-sync": "^6.0.0-alpha.2", | ||
"workbox-core": "^6.0.0-alpha.2", | ||
"workbox-routing": "^6.0.0-alpha.2", | ||
"workbox-strategies": "^6.0.0-alpha.2" | ||
"workbox-background-sync": "^6.0.0-alpha.3", | ||
"workbox-core": "^6.0.0-alpha.3", | ||
"workbox-routing": "^6.0.0-alpha.3", | ||
"workbox-strategies": "^6.0.0-alpha.3" | ||
}, | ||
"gitHead": "45f41a2d2f9870c49837923bb5c5854917da3a08" | ||
"gitHead": "00ba07467b253751e874f53f424f2adb1c06e176" | ||
} |
// @ts-ignore | ||
try{self['workbox:google-analytics:6.0.0-alpha.1']&&_()}catch(e){} | ||
try{self['workbox:google-analytics:6.0.0-alpha.2']&&_()}catch(e){} |
@@ -96,3 +96,3 @@ /* | ||
if (process.env.NODE_ENV !== 'production') { | ||
logger.log(`Request for '${getFriendlyURL(url.href)}'` + | ||
logger.log(`Request for '${getFriendlyURL(url.href)}' ` + | ||
`has been replayed`); | ||
@@ -104,3 +104,3 @@ } | ||
if (process.env.NODE_ENV !== 'production') { | ||
logger.log(`Request for '${getFriendlyURL(url.href)}'` + | ||
logger.log(`Request for '${getFriendlyURL(url.href)}' ` + | ||
`failed to replay, putting it back in the queue.`); | ||
@@ -107,0 +107,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
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
132421