From 04cc69d6c3d69c81b02e7bffffc3f7230cc3d3d4 Mon Sep 17 00:00:00 2001 From: Nikolay Feldman Date: Tue, 8 May 2018 23:37:00 -0700 Subject: [PATCH] 1.2.1 --- dist/simple-tracker.min.js | 2 +- dist/simple-tracker.min.map | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/simple-tracker.min.js b/dist/simple-tracker.min.js index 3e903a2..5d1c75f 100644 --- a/dist/simple-tracker.min.js +++ b/dist/simple-tracker.min.js @@ -1,4 +1,4 @@ -/*! simple-tracker - v1.2.0 | MIT +/*! simple-tracker - v1.2.1 | MIT * https://github.com/codeniko/simple-tracker */ !function(){"use strict";function e(e){function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}function n(t){var n=e.onerror;e.onerror=function(){t.apply(u,arguments),"function"==typeof n&&n.apply(e,arguments)}}function o(){return{url:e.location.href,userAgent:e.navigator.userAgent||null,platform:e.navigator.platform||null}}function i(){var e=h.cookie,t=e.indexOf(f);if(t>=0){var n=e.indexOf(";",t+1);return n=n<0?e.length:n,e.slice(t+p,n)}}function r(e){h.cookie=f+"="+e}function s(e){r(d=e||d||i()||t())}function a(t){if(l&&Object.keys(t).length>0)if(m&&(t.sessionId=d),g&&(t.context=u.clientContext),x)console.debug("SimpleTracker: POST "+l,t);else try{var n=new e.XMLHttpRequest;n.open("POST",l,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify(t))}catch(e){}}function c(){this.clientContext=o()}var l,d,u,f="trcksesh",p=f.length+1,h=e.document,v=!1,g=!0,m=!0,x=!1,y={};c.prototype={onerror:function(e,t,n,o,i){var r={message:e,lineno:n,colno:o,stack:i?i.stack:"n/a"};this.logException(r)},logEvent:function(e,t){var n={type:"event",event:e};if("object"==typeof t)for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);this.push(n)},logException:function(e){this.push({level:"error",type:"exception",exception:e})},logMessage:function(e,t){var n={type:"message",message:e};t&&(n.level=t),this.push(n)},logMetric:function(e,t){this.push({type:"metric",metric:e,value:t})},startTimer:function(t){var n=e.performance;n.now&&(y[t]&&x&&console.warn("Timing metric '"+t+"' already started"),x&&console.debug("timer started for:",t),y[t]=n.now())},stopTimer:function(t){var n=e.performance;if(n.now){var o=n.now(),i=y[t];if(void 0!==i){var r=Math.round(o-i);y[t]=void 0,x&&console.debug("timer stopped for:",t,"time="+r),this.logMetric(t,r)}else x&&console.warn("Timing metric '"+t+"' wasn't started")}},push:function(e){var t=typeof e;"object"!==t&&"string"!==t||("string"===t?e={text:e}:(void 0!==e.devMode&&(x=!!e.devMode,delete e.devMode),void 0!==e.attachClientContext&&(g=!!e.attachClientContext,delete e.attachClientContext),void 0!==e.attachSessionId&&(m=!!e.attachSessionId,delete e.attachSessionId),e.sessionId&&(s(e.sessionId),delete e.sessionId),e.endpoint&&(d||s(),l=e.endpoint,delete e.endpoint),void 0!==e.sendCaughtExceptions&&((v=!!e.sendCaughtExceptions)&&n(this.onerror),delete e.sendCaughtExceptions)),a(e))}};var w=e.tracker;if(w&&w.length){u=new c;var C=0,k=w.length;for(C=0;C