From ab61c1948d5f0c2e1dfae1b7727325f1d306a0b0 Mon Sep 17 00:00:00 2001 From: Nikolay Feldman Date: Sun, 6 May 2018 21:15:41 -0700 Subject: [PATCH] 1.1.1 --- dist/simple-tracker.min.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/simple-tracker.min.js b/dist/simple-tracker.min.js index 6d7cddb..f7b4118 100644 --- a/dist/simple-tracker.min.js +++ b/dist/simple-tracker.min.js @@ -1,4 +1,4 @@ -/*! simple-tracker - v1.1.0 | MIT +/*! simple-tracker - v1.1.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(d,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 r(){var e=v.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 i(e){v.cookie=f+"="+e}function s(e){i(u=e||u||r()||t())}function a(t){if(l&&Object.keys(t).length>0)if(t.sessionId=u,h&&(t.context=d.clientContext),m)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,u,d,f="trcksesh",p=f.length+1,v=e.document,g=!1,h=!0,m=!1,x={};c.prototype={onerror:function(e,t,n,o,r){var i={message:e,lineno:n,colno:o,stack:r?r.stack:"n/a"};this.logException(i)},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&&(x[t]&&m&&console.warn("Timing metric '"+t+"' already started"),m&&console.debug("timer started for:",t),x[t]=n.now())},stopTimer:function(t){var n=e.performance;if(n.now){var o=n.now(),r=x[t];if(void 0!==r){var i=Math.round(o-r);x[t]=void 0,m&&console.debug("timer stopped for:",t,"time="+i),this.logMetric(t,i)}else m&&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&&(m=!!e.devMode,delete e.devMode),void 0!==e.attachClientContext&&(h=!!e.attachClientContext,delete e.attachClientContext),e.sessionId&&(s(e.sessionId),delete e.sessionId),e.endpoint&&(u||s(),l=e.endpoint,delete e.endpoint),void 0!==e.sendCaughtExceptions&&((g=!!e.sendCaughtExceptions)&&n(this.onerror),delete e.sendCaughtExceptions)),a(e))}};var y=e.tracker;if(y&&y.length){d=new c;var w=0,C=y.length;for(w=0;w