workbox-google-analytics
Advanced tools
Comparing version 5.0.0-rc.1 to 5.0.0-rc.2
"use strict"; | ||
// @ts-ignore | ||
try { | ||
self['workbox:google-analytics:5.0.0-rc.1'] && _(); | ||
self['workbox:google-analytics:5.0.0-rc.2'] && _(); | ||
} | ||
catch (e) { } |
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self['workbox:google-analytics:5.0.0-rc.1'] && _(); | ||
self['workbox:google-analytics:5.0.0-rc.2'] && _(); | ||
} catch (e) {} | ||
@@ -44,4 +44,4 @@ | ||
* | ||
* @param {Object} config See workbox.googleAnalytics.initialize. | ||
* @return {Function} The requestWillDequeu callback function. | ||
* @param {Object} config See {@link module:workbox-google-analytics.initialize}. | ||
* @return {Function} The requestWillDequeue callback function. | ||
* | ||
@@ -212,3 +212,3 @@ * @private | ||
* | ||
* @memberof workbox.googleAnalytics | ||
* @memberof module:workbox-google-analytics | ||
*/ | ||
@@ -215,0 +215,0 @@ |
@@ -1,2 +0,2 @@ | ||
this.workbox=this.workbox||{},this.workbox.googleAnalytics=function(t,e,o,n,a,c,w,r,s){"use strict";try{self["workbox:google-analytics:5.0.0-rc.1"]&&_()}catch(t){}const i=/^\/(\w+\/)?collect/,l=t=>async({queue:e})=>{let o;for(;o=await e.shiftRequest();){const{request:n,timestamp:a}=o,c=new URL(n.url);try{const w="POST"===n.method?new URLSearchParams(await n.clone().text()):c.searchParams,r=a-(Number(w.get("qt"))||0),s=Date.now()-r;if(w.set("qt",String(s)),t.parameterOverrides)for(const e of Object.keys(t.parameterOverrides)){const o=t.parameterOverrides[e];w.set(e,o)}"function"==typeof t.hitFilter&&t.hitFilter.call(null,w),await fetch(new Request(c.origin+c.pathname,{body:w.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(t){throw await e.unshiftRequest(o),t}}},g=t=>{const e=({url:t})=>"www.google-analytics.com"===t.hostname&&i.test(t.pathname),o=new s.NetworkOnly({plugins:[t]});return[new c.Route(e,o,"GET"),new c.Route(e,o,"POST")]},m=t=>{const e=new r.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.google-analytics.com"===t.hostname&&"/analytics.js"===t.pathname,e,"GET")},u=t=>{const e=new r.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.googletagmanager.com"===t.hostname&&"/gtag/js"===t.pathname,e,"GET")},h=t=>{const e=new r.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.googletagmanager.com"===t.hostname&&"/gtm.js"===t.pathname,e,"GET")};return t.initialize=((t={})=>{const n=o.cacheNames.getGoogleAnalyticsName(t.cacheName),a=new e.BackgroundSyncPlugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:l(t)}),c=[h(n),m(n),u(n),...g(a)],r=new w.Router;for(const t of c)r.registerRoute(t);r.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,a,c,w,r,s){"use strict";try{self["workbox:google-analytics:5.0.0-rc.2"]&&_()}catch(t){}const i=/^\/(\w+\/)?collect/,l=t=>async({queue:e})=>{let o;for(;o=await e.shiftRequest();){const{request:n,timestamp:a}=o,c=new URL(n.url);try{const w="POST"===n.method?new URLSearchParams(await n.clone().text()):c.searchParams,r=a-(Number(w.get("qt"))||0),s=Date.now()-r;if(w.set("qt",String(s)),t.parameterOverrides)for(const e of Object.keys(t.parameterOverrides)){const o=t.parameterOverrides[e];w.set(e,o)}"function"==typeof t.hitFilter&&t.hitFilter.call(null,w),await fetch(new Request(c.origin+c.pathname,{body:w.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(t){throw await e.unshiftRequest(o),t}}},g=t=>{const e=({url:t})=>"www.google-analytics.com"===t.hostname&&i.test(t.pathname),o=new s.NetworkOnly({plugins:[t]});return[new c.Route(e,o,"GET"),new c.Route(e,o,"POST")]},m=t=>{const e=new r.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.google-analytics.com"===t.hostname&&"/analytics.js"===t.pathname,e,"GET")},u=t=>{const e=new r.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.googletagmanager.com"===t.hostname&&"/gtag/js"===t.pathname,e,"GET")},h=t=>{const e=new r.NetworkFirst({cacheName:t});return new c.Route(({url:t})=>"www.googletagmanager.com"===t.hostname&&"/gtm.js"===t.pathname,e,"GET")};return t.initialize=((t={})=>{const n=o.cacheNames.getGoogleAnalyticsName(t.cacheName),a=new e.BackgroundSyncPlugin("workbox-google-analytics",{maxRetentionTime:2880,onSync:l(t)}),c=[h(n),m(n),u(n),...g(a)],r=new w.Router;for(const t of c)r.registerRoute(t);r.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 |
import { initialize } from './initialize.js'; | ||
import './_version.js'; | ||
/** | ||
* @namespace workbox.googleAnalytics | ||
* @module workbox-google-analytics | ||
*/ | ||
export { initialize, }; |
@@ -11,4 +11,4 @@ /* | ||
/** | ||
* @namespace workbox.googleAnalytics | ||
* @module workbox-google-analytics | ||
*/ | ||
export { initialize, }; |
@@ -23,5 +23,5 @@ import './_version.js'; | ||
* | ||
* @memberof workbox.googleAnalytics | ||
* @memberof module:workbox-google-analytics | ||
*/ | ||
declare const initialize: (options?: GoogleAnalyticsInitializeOptions) => void; | ||
export { initialize, }; |
@@ -24,4 +24,4 @@ /* | ||
* | ||
* @param {Object} config See workbox.googleAnalytics.initialize. | ||
* @return {Function} The requestWillDequeu callback function. | ||
* @param {Object} config See {@link module:workbox-google-analytics.initialize}. | ||
* @return {Function} The requestWillDequeue callback function. | ||
* | ||
@@ -163,3 +163,3 @@ * @private | ||
* | ||
* @memberof workbox.googleAnalytics | ||
* @memberof module:workbox-google-analytics | ||
*/ | ||
@@ -166,0 +166,0 @@ const initialize = (options = {}) => { |
{ | ||
"name": "workbox-google-analytics", | ||
"version": "5.0.0-rc.1", | ||
"version": "5.0.0-rc.2", | ||
"license": "MIT", | ||
@@ -33,8 +33,8 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-background-sync": "^5.0.0-rc.1", | ||
"workbox-core": "^5.0.0-rc.1", | ||
"workbox-routing": "^5.0.0-rc.1", | ||
"workbox-strategies": "^5.0.0-rc.1" | ||
"workbox-background-sync": "^5.0.0-rc.2", | ||
"workbox-core": "^5.0.0-rc.2", | ||
"workbox-routing": "^5.0.0-rc.2", | ||
"workbox-strategies": "^5.0.0-rc.2" | ||
}, | ||
"gitHead": "f03f71e50507e13d82d4e0a875cc49ba4501aff3" | ||
"gitHead": "89904768b2210e59c830dd380cf88a06e1c26a2b" | ||
} |
// @ts-ignore | ||
try{self['workbox:google-analytics:5.0.0-rc.1']&&_()}catch(e){} | ||
try{self['workbox:google-analytics:5.0.0-rc.2']&&_()}catch(e){} |
@@ -14,3 +14,3 @@ /* | ||
/** | ||
* @namespace workbox.googleAnalytics | ||
* @module workbox-google-analytics | ||
*/ | ||
@@ -17,0 +17,0 @@ |
@@ -44,4 +44,4 @@ /* | ||
* | ||
* @param {Object} config See workbox.googleAnalytics.initialize. | ||
* @return {Function} The requestWillDequeu callback function. | ||
* @param {Object} config See {@link module:workbox-google-analytics.initialize}. | ||
* @return {Function} The requestWillDequeue callback function. | ||
* | ||
@@ -208,3 +208,3 @@ * @private | ||
* | ||
* @memberof workbox.googleAnalytics | ||
* @memberof module:workbox-google-analytics | ||
*/ | ||
@@ -211,0 +211,0 @@ const initialize = (options: GoogleAnalyticsInitializeOptions = {}) => { |
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
157730