lightkeeper
Advanced tools
Comparing version 2.0.1-0 to 2.0.1-1
@@ -231,3 +231,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
if (!message) return; | ||
_this.send(message); | ||
_this.send({ errmsg: message }); | ||
}); | ||
@@ -247,3 +247,3 @@ | ||
if (!message) return; | ||
_this.send(message); | ||
_this.send({ errmsg: message }); | ||
}); | ||
@@ -250,0 +250,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pharos=t():e.pharos=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isNumber=function(e){return!isNaN(e)&&"number"==typeof e},t.isEmpty=function(e){return"object"===(void 0===e?"undefined":n(e))?"{}"===JSON.stringify(e):!e},t.build_query=function(e){var t=[];for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":n(o))&&(o=JSON.stringify(o)),t.push(encodeURIComponent(r)+"="+encodeURIComponent(o))}return t.join("&")},t.getPerformance=function(){var t=e.performance;return t||console.log("Browser doesn't support Performance API"),t},t.sendLog=function(t){t&&(e.sadLog=new Image,e.sadLog.onload=e.sadLog.onerror=function(){delete e.sadLog},e.sadLog.src=t)}}).call(t,n(0))},function(e,t,n){"use strict";(function(t){var r=n(3),o=new r;t.addEventListener("load",function(){var e=document.querySelector("script[data-siteid][data-host]");e&&(o.site_id=e.getAttribute("data-siteid"),o.host=e.getAttribute("data-host"))}),e.exports=o}).call(t,n(0))},function(e,t,n){"use strict";(function(t){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),u=n(4),s="info",c="addPerfData",f={};e.exports=function(){function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,e),this.site_id=n,this.host=r,this[s]={screen:t.screen.width+"x"+t.screen.height},this[c]=this.addPerf(),this.listenError(i)}return i(e,[{key:"listenError",value:function(e){var n=this,r=e.onError;t.addEventListener&&(t.addEventListener("error",function(e){if(e){var t=e.error&&e.error.stack||e.message;"function"==typeof r&&(t=r(e)),t&&n.send(t)}}),t.addEventListener("unhandledrejection",function(e){if(e){var t=e.reason;t instanceof Error&&(t=t.error&&t.error.stack||t.message),"function"==typeof r&&(t=r(e)),t&&n.send(t)}}))}},{key:"addPerf",value:function(){var e=this;return new Promise(function(n){return t.addEventListener("load",function(){return setTimeout(function(){e.add(u()),n(),e[c]=Promise.resolve()})})})}},{key:"monitor",value:function(e){var t=this;return this[c].then(function(){return t.send(e)})}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[s],t=this.host;/^(http|\/\/)/i.test(t)||(t=location.protocol+"//"+t);var n=t+"/pharos.gif?",r={site_id:this.site_id};for(var o in e)r[o]=e[o];a.sendLog(n+a.build_query(r)),this.clear()}},{key:"time",value:function(e){f[e]=Date.now()}},{key:"timeEnd",value:function(e){var t=Date.now();f[e]||(f[e]=t);var n=t-f[e];this.add(e,n),console.log(e+": "+n+"ms"),delete f[e]}},{key:"add",value:function(e,t){var n=e;a.isNumber(t)&&(n=r({},e,t));for(var o in n)a.isNumber(n[o])&&(this[s][o]=n[o]);return!0}},{key:"delete",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r++)delete this[s][t[r]];return!0}},{key:"clear",value:function(){var e={};for(var t in this[s])e[t]=this[s][t],this.delete(t);return e}},{key:"search",value:function(e){return this[s][e]}}]),e}()}).call(t,n(0))},function(e,t,n){"use strict";var r=n(1);e.exports=function(){var e=r.getPerformance();if(!e)return{};var t=e.timing,n={};return n.loadPage=t.loadEventEnd-t.navigationStart,n.domReady=t.domComplete-t.responseEnd,n.redirect=t.redirectEnd-t.redirectStart,n.lookupDomain=t.domainLookupEnd-t.domainLookupStart,n.ttfb=t.responseStart-t.navigationStart,n.request=t.responseEnd-t.requestStart,n.loadEvent=t.loadEventEnd-t.loadEventStart,n.appcache=t.domainLookupStart-t.fetchStart,n.unloadEvent=t.unloadEventEnd-t.unloadEventStart,n.connect=t.connectEnd-t.connectStart,n}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pharos=t():e.pharos=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isNumber=function(e){return!isNaN(e)&&"number"==typeof e},t.isEmpty=function(e){return"object"===(void 0===e?"undefined":n(e))?"{}"===JSON.stringify(e):!e},t.build_query=function(e){var t=[];for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":n(o))&&(o=JSON.stringify(o)),t.push(encodeURIComponent(r)+"="+encodeURIComponent(o))}return t.join("&")},t.getPerformance=function(){var t=e.performance;return t||console.log("Browser doesn't support Performance API"),t},t.sendLog=function(t){t&&(e.sadLog=new Image,e.sadLog.onload=e.sadLog.onerror=function(){delete e.sadLog},e.sadLog.src=t)}}).call(t,n(0))},function(e,t,n){"use strict";(function(t){var r=n(3),o=new r;t.addEventListener("load",function(){var e=document.querySelector("script[data-siteid][data-host]");e&&(o.site_id=e.getAttribute("data-siteid"),o.host=e.getAttribute("data-host"))}),e.exports=o}).call(t,n(0))},function(e,t,n){"use strict";(function(t){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),u=n(4),s="info",c="addPerfData",f={};e.exports=function(){function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,e),this.site_id=n,this.host=r,this[s]={screen:t.screen.width+"x"+t.screen.height},this[c]=this.addPerf(),this.listenError(i)}return i(e,[{key:"listenError",value:function(e){var n=this,r=e.onError;t.addEventListener&&(t.addEventListener("error",function(e){if(e){var t=e.error&&e.error.stack||e.message;"function"==typeof r&&(t=r(e)),t&&n.send({errmsg:t})}}),t.addEventListener("unhandledrejection",function(e){if(e){var t=e.reason;t instanceof Error&&(t=t.error&&t.error.stack||t.message),"function"==typeof r&&(t=r(e)),t&&n.send({errmsg:t})}}))}},{key:"addPerf",value:function(){var e=this;return new Promise(function(n){return t.addEventListener("load",function(){return setTimeout(function(){e.add(u()),n(),e[c]=Promise.resolve()})})})}},{key:"monitor",value:function(e){var t=this;return this[c].then(function(){return t.send(e)})}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[s],t=this.host;/^(http|\/\/)/i.test(t)||(t=location.protocol+"//"+t);var n=t+"/pharos.gif?",r={site_id:this.site_id};for(var o in e)r[o]=e[o];a.sendLog(n+a.build_query(r)),this.clear()}},{key:"time",value:function(e){f[e]=Date.now()}},{key:"timeEnd",value:function(e){var t=Date.now();f[e]||(f[e]=t);var n=t-f[e];this.add(e,n),console.log(e+": "+n+"ms"),delete f[e]}},{key:"add",value:function(e,t){var n=e;a.isNumber(t)&&(n=r({},e,t));for(var o in n)a.isNumber(n[o])&&(this[s][o]=n[o]);return!0}},{key:"delete",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r++)delete this[s][t[r]];return!0}},{key:"clear",value:function(){var e={};for(var t in this[s])e[t]=this[s][t],this.delete(t);return e}},{key:"search",value:function(e){return this[s][e]}}]),e}()}).call(t,n(0))},function(e,t,n){"use strict";var r=n(1);e.exports=function(){var e=r.getPerformance();if(!e)return{};var t=e.timing,n={};return n.loadPage=t.loadEventEnd-t.navigationStart,n.domReady=t.domComplete-t.responseEnd,n.redirect=t.redirectEnd-t.redirectStart,n.lookupDomain=t.domainLookupEnd-t.domainLookupStart,n.ttfb=t.responseStart-t.navigationStart,n.request=t.responseEnd-t.requestStart,n.loadEvent=t.loadEventEnd-t.loadEventStart,n.appcache=t.domainLookupStart-t.fetchStart,n.unloadEvent=t.unloadEventEnd-t.unloadEventStart,n.connect=t.connectEnd-t.connectStart,n}}])}); |
@@ -51,3 +51,3 @@ 'use strict'; | ||
if (!message) return; | ||
_this.send(message); | ||
_this.send({ errmsg: message }); | ||
}); | ||
@@ -67,3 +67,3 @@ | ||
if (!message) return; | ||
_this.send(message); | ||
_this.send({ errmsg: message }); | ||
}); | ||
@@ -70,0 +70,0 @@ } |
{ | ||
"name": "lightkeeper", | ||
"version": "2.0.1-0", | ||
"version": "2.0.1-1", | ||
"description": "Pharos data send script for Web.", | ||
@@ -5,0 +5,0 @@ "main": "lib/pharos.js", |
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
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
167726