@snowplow/browser-plugin-link-click-tracking
Advanced tools
Comparing version 4.0.3 to 4.0.4
/*! | ||
* Link Click tracking for Snowplow v4.0.3 (http://bit.ly/sp-js) | ||
* Link Click tracking for Snowplow v4.0.4 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -221,3 +221,3 @@ * Licensed under BSD-3-Clause | ||
context: resolveDynamicContext(context, target), | ||
}); | ||
}, [tracker]); | ||
} | ||
@@ -238,3 +238,3 @@ else if (event.type === 'mousedown') { | ||
context: resolveDynamicContext(context, target), | ||
}); | ||
}, [tracker]); | ||
} | ||
@@ -241,0 +241,0 @@ delete _configuration[tracker].lastButton; |
/*! | ||
* Link Click tracking for Snowplow v4.0.3 (http://bit.ly/sp-js) | ||
* Link Click tracking for Snowplow v4.0.4 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -44,3 +44,3 @@ * Licensed under BSD-3-Clause | ||
/*! | ||
* Core functionality for Snowplow JavaScript trackers v4.0.3 (http://bit.ly/sp-js) | ||
* Core functionality for Snowplow JavaScript trackers v4.0.4 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -338,3 +338,3 @@ * Licensed under BSD-3-Clause | ||
/*! | ||
* Core functionality for Snowplow Browser trackers v4.0.3 (http://bit.ly/sp-js) | ||
* Core functionality for Snowplow Browser trackers v4.0.4 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -813,3 +813,3 @@ * Licensed under BSD-3-Clause | ||
context: resolveDynamicContext(context, target), | ||
}); | ||
}, [tracker]); | ||
} | ||
@@ -830,3 +830,3 @@ else if (event.type === 'mousedown') { | ||
context: resolveDynamicContext(context, target), | ||
}); | ||
}, [tracker]); | ||
} | ||
@@ -833,0 +833,0 @@ delete _configuration[tracker].lastButton; |
/*! | ||
* Link Click tracking for Snowplow v4.0.3 (http://bit.ly/sp-js) | ||
* Link Click tracking for Snowplow v4.0.4 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -7,3 +7,3 @@ * Licensed under BSD-3-Clause | ||
"use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowLinkClickTracking={})}(this,(function(e){function n(e,n,t){if(t||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function t(e){for(var n,t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return null!==(n=null==e?void 0:e.map((function(e){if("function"!=typeof e)return e;try{return e.apply(void 0,t)}catch(e){}})).filter(Boolean))&&void 0!==n?n:[]}function o(e){var n={targetUrl:e.targetUrl,elementId:e.elementId,elementClasses:e.elementClasses,elementTarget:e.elementTarget,elementContent:e.elementContent},t=void 0;for(var o in void 0===t&&(t={}),e={},n)(t[o]||null!=n[o])&&(e[o]=n[o]);return o=function(){var e,n={},t=[],o=[],r=[],i=function(e,t){null!=t&&""!==t&&(n[e]=t)};return{add:i,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i(n,e[n])},addJson:function(e,n,r){var i;if(i=r)e:{if(null!=r&&(r.constructor==={}.constructor||r.constructor===[].constructor))for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)){i=!0;break e}i=!1}i&&(e={keyIfEncoded:e,keyIfNotEncoded:n,json:r},o.push(e),t.push(e))},addContextEntity:function(e){r.push(e)},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n},build:function(){return null==e||e(this,o,r),n}}}(),e={schema:"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",data:{schema:"iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",data:e}},o.add("e","ue"),o.addJson("ue_px","ue_pr",e),o}function r(e,n,t,o){return e.addEventListener?(e.addEventListener(n,t,o),!0):e.attachEvent?e.attachEvent("on"+n,t):void(e["on"+n]=t)}function i(e,n,t,o,r,i,l){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=n?n:"")+(t?"; Expires="+new Date(+new Date+1e3*t).toUTCString():"")+(o?"; Path="+o:"")+(r?"; Domain="+r:"")+(i?"; SameSite="+i:"")+(l?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function l(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=Object.prototype.hasOwnProperty.call(e,"allowlist"),t=function(e){var n={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++)n[e[t]]=!0}return n}(e);return function(e,n){return e.hasOwnProperty("filter")&&e.filter?e.filter:n}(e,(function(e){e:{var o=0;for(e=e.className.match(/\S+/g)||[];o<e.length;o++)if(t[e[o]]){o=!0;break e}o=!1}return o===n}))}function c(e){void 0===e&&(e=Object.keys(g)),e.forEach((function(e){g[e]&&m[e]&&(window.removeEventListener("click",m[e],!0),window.removeEventListener("mouseup",m[e],!0),window.removeEventListener("mousedown",m[e],!0))}))}function a(e,n){void 0===n&&(n=Object.keys(g)),function(e,n,t){try{var o=null!=e?e:Object.keys(n);e=[];for(var r=0;r<o.length;r++){var i=o[r];n.hasOwnProperty(i)?e.push(n[i]):d.warn(i+" not configured")}e.forEach(t)}catch(e){d.error("Function failed",e)}}(n,g,(function(n){var t,r,i;if("element"in e){var l=null!==(i=null!==(t=e.trackContent)&&void 0!==t?t:null===(r=h[n.id])||void 0===r?void 0:r.linkTrackingContent)&&void 0!==i&&i;t=function(e,n){void 0===n&&(n=!1);var t=e.hostname||function(e){var n=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return n?n[1]:e}(e.href),r=e.href.replace(t,(function(e){return e.toLowerCase()}));if(!w.test(r)){t=e.id;var i=e.className.match(/\S+/g)||[],l=e.target;return n=n?e.innerHTML:void 0,r||null==y||y.warn("Link click target URL empty",e),o({targetUrl:r||"about:invalid",elementId:t,elementClasses:i,elementTarget:l,elementContent:n})}}(e.element,l)}else t=o(e);t&&n.core.track(t,e.context,e.timestamp)})),p.flush()}function u(e,n){var o=h[e].linkTrackingContext,r=h[e].linkTrackingFilter,i=(n=n||window.event).which||n.button;e:{var l=n.composed?n.composedPath()[0]:n.target||n.srcElement;if(l instanceof Element){if("function"==typeof l.closest){l=l.closest(k);break e}for(;l;){var c=l.tagName.toLowerCase();if(-1!==v.indexOf(c))break e;l=l.parentElement}}l=null}!l||null==l.href||r&&!r(l)||("click"===n.type?a({element:l,context:t(o,l)}):"mousedown"===n.type?1===i||2===i?(h[e].lastButton=i,h[e].lastTarget=l):delete h[e].lastButton:"mouseup"===n.type&&(i===h[e].lastButton&&l===h[e].lastTarget&&a({element:l,context:t(o,l)}),delete h[e].lastButton,delete h[e].lastTarget))}var s,f;"function"==typeof SuppressedError&&SuppressedError,(f=s||(s={}))[f.none=0]="none",f[f.error=1]="error",f[f.warn=2]="warn",f[f.debug=3]="debug",f[f.info=4]="info";var d=function(e){return void 0===e&&(e=s.warn),{setLogLevel:function(n){e=s[n]?n:s.warn},warn:function(t,o){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e>=s.warn&&"undefined"!=typeof console&&(i="Snowplow: "+t,o?console.warn.apply(console,n([i+"\n",o],r,!1)):console.warn.apply(console,n([i],r,!1)))},error:function(t,o){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e>=s.error&&"undefined"!=typeof console&&(i="Snowplow: "+t+"\n",o?console.error.apply(console,n([i+"\n",o],r,!1)):console.error.apply(console,n([i],r,!1)))},debug:function(t){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];e>=s.debug&&"undefined"!=typeof console&&console.debug.apply(console,n(["Snowplow: "+t],o,!1))},info:function(t){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];e>=s.info&&"undefined"!=typeof console&&console.info.apply(console,n(["Snowplow: "+t],o,!1))}}}(),p=function(){function e(e){return n[e]||(n[e]=function(e){function n(){void 0!==t&&(clearTimeout(t),t=void 0),l||(l=!0,void 0!==o&&i(e,o[0],o[1],o[2],o[3],o[4],o[5]))}var t,o,r,l=!0;return{getValue:function(){var n;return o&&(!r||r>new Date)&&null!==(n=o[0])&&void 0!==n?n:i(e)},setValue:function(e,i,c,a,u,s){return o=[e,i,c,a,u,s],l=!1,void 0===t&&(t=setTimeout((function(){t=void 0,n()}),10)),r=new Date(Date.now()+1e3*Math.min(.05,null!=i?i:.05)),!0},deleteValue:function(n,r,c,a){o=void 0,l=!0,void 0!==t&&(clearTimeout(t),t=void 0),i(e,"",-1,n,r,c,a)},flush:n}}(e)),n[e]}var n={};return{getCookie:function(n){return e(n).getValue()},setCookie:function(n,t,o,r,i,l,c){return e(n).setValue(t,o,r,i,l,c)},deleteCookie:function(n,t,o,r,i){e(n).deleteValue(t,o,r,i)},clearCache:function(){n={}},flush:function(){for(var e=0,t=Object.values(n);e<t.length;e++)t[e].flush()}}}(),v=["a","area"],k=v.join(", "),w=/^(javascript|vbscript|jscript|mocha|livescript|ecmascript):/i,g={},m={},h={},y=void 0;e.LinkClickTrackingPlugin=function(){return{activateBrowserPlugin:function(e){g[e.id]=e},logger:function(e){y=e}}},e.disableLinkClickTracking=c,e.enableLinkClickTracking=function(e,n){void 0===e&&(e={}),void 0===n&&(n=Object.keys(g)),c(n),n.forEach((function(n){if(g[n]){var t=void 0===e?{}:e;h[n]={linkTrackingContent:t.trackContent,linkTrackingContext:t.context,linkTrackingPseudoClicks:t.pseudoClicks,linkTrackingFilter:l(t.options)},m[n]=m[n]||u.bind(null,n),h[n].linkTrackingPseudoClicks?(r(window,"mouseup",m[n],!0),r(window,"mousedown",m[n],!0)):r(window,"click",m[n],!0)}}))},e.refreshLinkClickTracking=function(e){null==y||y.warn("refreshLinkClickTracking is deprecated in v4 and has no effect")},e.trackLinkClick=a,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
"use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowLinkClickTracking={})}(this,(function(e){function n(e,n,t){if(t||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function t(e){for(var n,t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return null!==(n=null==e?void 0:e.map((function(e){if("function"!=typeof e)return e;try{return e.apply(void 0,t)}catch(e){}})).filter(Boolean))&&void 0!==n?n:[]}function o(e){var n={targetUrl:e.targetUrl,elementId:e.elementId,elementClasses:e.elementClasses,elementTarget:e.elementTarget,elementContent:e.elementContent},t=void 0;for(var o in void 0===t&&(t={}),e={},n)(t[o]||null!=n[o])&&(e[o]=n[o]);return o=function(){var e,n={},t=[],o=[],r=[],i=function(e,t){null!=t&&""!==t&&(n[e]=t)};return{add:i,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i(n,e[n])},addJson:function(e,n,r){var i;if(i=r)e:{if(null!=r&&(r.constructor==={}.constructor||r.constructor===[].constructor))for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)){i=!0;break e}i=!1}i&&(e={keyIfEncoded:e,keyIfNotEncoded:n,json:r},o.push(e),t.push(e))},addContextEntity:function(e){r.push(e)},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n},build:function(){return null==e||e(this,o,r),n}}}(),e={schema:"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",data:{schema:"iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",data:e}},o.add("e","ue"),o.addJson("ue_px","ue_pr",e),o}function r(e,n,t,o){return e.addEventListener?(e.addEventListener(n,t,o),!0):e.attachEvent?e.attachEvent("on"+n,t):void(e["on"+n]=t)}function i(e,n,t,o,r,i,l){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=n?n:"")+(t?"; Expires="+new Date(+new Date+1e3*t).toUTCString():"")+(o?"; Path="+o:"")+(r?"; Domain="+r:"")+(i?"; SameSite="+i:"")+(l?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function l(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=Object.prototype.hasOwnProperty.call(e,"allowlist"),t=function(e){var n={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++)n[e[t]]=!0}return n}(e);return function(e,n){return e.hasOwnProperty("filter")&&e.filter?e.filter:n}(e,(function(e){e:{var o=0;for(e=e.className.match(/\S+/g)||[];o<e.length;o++)if(t[e[o]]){o=!0;break e}o=!1}return o===n}))}function c(e){void 0===e&&(e=Object.keys(g)),e.forEach((function(e){g[e]&&m[e]&&(window.removeEventListener("click",m[e],!0),window.removeEventListener("mouseup",m[e],!0),window.removeEventListener("mousedown",m[e],!0))}))}function a(e,n){void 0===n&&(n=Object.keys(g)),function(e,n,t){try{var o=null!=e?e:Object.keys(n);e=[];for(var r=0;r<o.length;r++){var i=o[r];n.hasOwnProperty(i)?e.push(n[i]):d.warn(i+" not configured")}e.forEach(t)}catch(e){d.error("Function failed",e)}}(n,g,(function(n){var t,r,i;if("element"in e){var l=null!==(i=null!==(t=e.trackContent)&&void 0!==t?t:null===(r=h[n.id])||void 0===r?void 0:r.linkTrackingContent)&&void 0!==i&&i;t=function(e,n){void 0===n&&(n=!1);var t=e.hostname||function(e){var n=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return n?n[1]:e}(e.href),r=e.href.replace(t,(function(e){return e.toLowerCase()}));if(!w.test(r)){t=e.id;var i=e.className.match(/\S+/g)||[],l=e.target;return n=n?e.innerHTML:void 0,r||null==y||y.warn("Link click target URL empty",e),o({targetUrl:r||"about:invalid",elementId:t,elementClasses:i,elementTarget:l,elementContent:n})}}(e.element,l)}else t=o(e);t&&n.core.track(t,e.context,e.timestamp)})),p.flush()}function u(e,n){var o=h[e].linkTrackingContext,r=h[e].linkTrackingFilter,i=(n=n||window.event).which||n.button;e:{var l=n.composed?n.composedPath()[0]:n.target||n.srcElement;if(l instanceof Element){if("function"==typeof l.closest){l=l.closest(k);break e}for(;l;){var c=l.tagName.toLowerCase();if(-1!==v.indexOf(c))break e;l=l.parentElement}}l=null}!l||null==l.href||r&&!r(l)||("click"===n.type?a({element:l,context:t(o,l)},[e]):"mousedown"===n.type?1===i||2===i?(h[e].lastButton=i,h[e].lastTarget=l):delete h[e].lastButton:"mouseup"===n.type&&(i===h[e].lastButton&&l===h[e].lastTarget&&a({element:l,context:t(o,l)},[e]),delete h[e].lastButton,delete h[e].lastTarget))}var s,f;"function"==typeof SuppressedError&&SuppressedError,(f=s||(s={}))[f.none=0]="none",f[f.error=1]="error",f[f.warn=2]="warn",f[f.debug=3]="debug",f[f.info=4]="info";var d=function(e){return void 0===e&&(e=s.warn),{setLogLevel:function(n){e=s[n]?n:s.warn},warn:function(t,o){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e>=s.warn&&"undefined"!=typeof console&&(i="Snowplow: "+t,o?console.warn.apply(console,n([i+"\n",o],r,!1)):console.warn.apply(console,n([i],r,!1)))},error:function(t,o){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e>=s.error&&"undefined"!=typeof console&&(i="Snowplow: "+t+"\n",o?console.error.apply(console,n([i+"\n",o],r,!1)):console.error.apply(console,n([i],r,!1)))},debug:function(t){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];e>=s.debug&&"undefined"!=typeof console&&console.debug.apply(console,n(["Snowplow: "+t],o,!1))},info:function(t){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];e>=s.info&&"undefined"!=typeof console&&console.info.apply(console,n(["Snowplow: "+t],o,!1))}}}(),p=function(){function e(e){return n[e]||(n[e]=function(e){function n(){void 0!==t&&(clearTimeout(t),t=void 0),l||(l=!0,void 0!==o&&i(e,o[0],o[1],o[2],o[3],o[4],o[5]))}var t,o,r,l=!0;return{getValue:function(){var n;return o&&(!r||r>new Date)&&null!==(n=o[0])&&void 0!==n?n:i(e)},setValue:function(e,i,c,a,u,s){return o=[e,i,c,a,u,s],l=!1,void 0===t&&(t=setTimeout((function(){t=void 0,n()}),10)),r=new Date(Date.now()+1e3*Math.min(.05,null!=i?i:.05)),!0},deleteValue:function(n,r,c,a){o=void 0,l=!0,void 0!==t&&(clearTimeout(t),t=void 0),i(e,"",-1,n,r,c,a)},flush:n}}(e)),n[e]}var n={};return{getCookie:function(n){return e(n).getValue()},setCookie:function(n,t,o,r,i,l,c){return e(n).setValue(t,o,r,i,l,c)},deleteCookie:function(n,t,o,r,i){e(n).deleteValue(t,o,r,i)},clearCache:function(){n={}},flush:function(){for(var e=0,t=Object.values(n);e<t.length;e++)t[e].flush()}}}(),v=["a","area"],k=v.join(", "),w=/^(javascript|vbscript|jscript|mocha|livescript|ecmascript):/i,g={},m={},h={},y=void 0;e.LinkClickTrackingPlugin=function(){return{activateBrowserPlugin:function(e){g[e.id]=e},logger:function(e){y=e}}},e.disableLinkClickTracking=c,e.enableLinkClickTracking=function(e,n){void 0===e&&(e={}),void 0===n&&(n=Object.keys(g)),c(n),n.forEach((function(n){if(g[n]){var t=void 0===e?{}:e;h[n]={linkTrackingContent:t.trackContent,linkTrackingContext:t.context,linkTrackingPseudoClicks:t.pseudoClicks,linkTrackingFilter:l(t.options)},m[n]=m[n]||u.bind(null,n),h[n].linkTrackingPseudoClicks?(r(window,"mouseup",m[n],!0),r(window,"mousedown",m[n],!0)):r(window,"click",m[n],!0)}}))},e.refreshLinkClickTracking=function(e){null==y||y.warn("refreshLinkClickTracking is deprecated in v4 and has no effect")},e.trackLinkClick=a,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.umd.min.js.map |
{ | ||
"name": "@snowplow/browser-plugin-link-click-tracking", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"description": "Link Click tracking for Snowplow", | ||
@@ -22,4 +22,4 @@ "homepage": "http://bit.ly/sp-js", | ||
"tslib": "^2.3.1", | ||
"@snowplow/browser-tracker-core": "4.0.3", | ||
"@snowplow/tracker-core": "4.0.3" | ||
"@snowplow/browser-tracker-core": "4.0.4", | ||
"@snowplow/tracker-core": "4.0.4" | ||
}, | ||
@@ -50,3 +50,3 @@ "devDependencies": { | ||
"peerDependencies": { | ||
"@snowplow/browser-tracker": "~4.0.3" | ||
"@snowplow/browser-tracker": "~4.0.4" | ||
}, | ||
@@ -53,0 +53,0 @@ "scripts": { |
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
760121
- Removed@snowplow/browser-tracker-core@4.0.3(transitive)
- Removed@snowplow/tracker-core@4.0.3(transitive)
Updated@snowplow/tracker-core@4.0.4