honeybadger-js
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -8,2 +8,8 @@ # Change Log | ||
## [1.0.4] - 2019-06-12 | ||
### Fixed | ||
- Fix a bug in `beforeNotify` logic where notice properties were not | ||
correctly passed to the handlers. All properties now [work as | ||
documented](https://docs.honeybadger.io/lib/javascript/guides/filtering-sensitive-data.html). | ||
## [1.0.3] - 2019-05-15 | ||
@@ -10,0 +16,0 @@ ### Fixed |
'use strict'; | ||
function builder() { | ||
var VERSION = '1.0.3', | ||
var VERSION = '1.0.4', | ||
NOTIFIER = { | ||
@@ -129,2 +129,16 @@ name: 'honeybadger.js', | ||
function objectIsEmpty(obj) { | ||
for (let k in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, k)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
function objectIsExtensible(obj) { | ||
if (typeof Object.isExtensible !== 'function') { return true; } | ||
return Object.isExtensible(obj); | ||
} | ||
// Client factory. | ||
@@ -265,23 +279,30 @@ var factory = (function(opts) { | ||
// Halt if err is empty. | ||
if (((function() { | ||
var k, results; | ||
results = []; | ||
for (k in err) { | ||
if (!Object.prototype.hasOwnProperty.call(err, k)) continue; | ||
results.push(k); | ||
} | ||
return results; | ||
})()).length === 0) { | ||
return false; | ||
} | ||
if (objectIsEmpty(err)) { return false; } | ||
let generator; | ||
if (generated) { | ||
err = merge(err, generated); | ||
err.stack = generated.stack; | ||
generator = generated.generator; | ||
} | ||
if (isIgnored(err, config('ignorePatterns'))) { return false; } | ||
err = merge(err, { | ||
name: err.name || 'Error', | ||
context: merge(self.context, err.context), | ||
url: err.url || document.URL, | ||
projectRoot: err.projectRoot || err.project_root || config('projectRoot', config('project_root', window.location.protocol + '//' + window.location.host)), | ||
environment: err.environment || config('environment'), | ||
component: err.component || config('component'), | ||
action: err.action || config('action'), | ||
revision: err.revision || config('revision') | ||
}); | ||
let stack_before_handlers = err.stack; | ||
if (checkHandlers(self.beforeNotifyHandlers, err)) { return false; } | ||
if (err.stack != stack_before_handlers) { | ||
// Stack changed, so it's not generated. | ||
generator = undefined; | ||
} | ||
if (isIgnored(err, config('ignorePatterns'))) { return false; } | ||
var data = cgiData(); | ||
@@ -297,13 +318,13 @@ if (typeof err.cookies === 'string') { | ||
'error': { | ||
'class': err.name || 'Error', | ||
'class': err.name, | ||
'message': err.message, | ||
'backtrace': err.stack, | ||
'generator': err.generator, | ||
'generator': generator, | ||
'fingerprint': err.fingerprint | ||
}, | ||
'request': { | ||
'url': err.url || document.URL, | ||
'component': err.component || config('component'), | ||
'action': err.action || config('action'), | ||
'context': merge(self.context, err.context), | ||
'url': err.url, | ||
'component': err.component, | ||
'action': err.action, | ||
'context': err.context, | ||
'cgi_data': data, | ||
@@ -313,5 +334,5 @@ 'params': err.params | ||
'server': { | ||
'project_root': err.projectRoot || err.project_root || config('projectRoot', config('project_root', window.location.protocol + '//' + window.location.host)), | ||
'environment_name': err.environment || config('environment'), | ||
'revision': err.revision || config('revision') | ||
'project_root': err.projectRoot, | ||
'environment_name': err.environment, | ||
'revision': err.revision | ||
} | ||
@@ -338,7 +359,2 @@ }; | ||
function objectIsExtensible(obj) { | ||
if (typeof Object.isExtensible !== 'function') { return true; } | ||
return Object.isExtensible(obj); | ||
} | ||
var preferCatch = true; | ||
@@ -345,0 +361,0 @@ // IE < 10 |
function builder() { | ||
var VERSION = '1.0.3', | ||
var VERSION = '1.0.4', | ||
NOTIFIER = { | ||
@@ -127,2 +127,16 @@ name: 'honeybadger.js', | ||
function objectIsEmpty(obj) { | ||
for (let k in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, k)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
function objectIsExtensible(obj) { | ||
if (typeof Object.isExtensible !== 'function') { return true; } | ||
return Object.isExtensible(obj); | ||
} | ||
// Client factory. | ||
@@ -263,23 +277,30 @@ var factory = (function(opts) { | ||
// Halt if err is empty. | ||
if (((function() { | ||
var k, results; | ||
results = []; | ||
for (k in err) { | ||
if (!Object.prototype.hasOwnProperty.call(err, k)) continue; | ||
results.push(k); | ||
} | ||
return results; | ||
})()).length === 0) { | ||
return false; | ||
} | ||
if (objectIsEmpty(err)) { return false; } | ||
let generator; | ||
if (generated) { | ||
err = merge(err, generated); | ||
err.stack = generated.stack; | ||
generator = generated.generator; | ||
} | ||
if (isIgnored(err, config('ignorePatterns'))) { return false; } | ||
err = merge(err, { | ||
name: err.name || 'Error', | ||
context: merge(self.context, err.context), | ||
url: err.url || document.URL, | ||
projectRoot: err.projectRoot || err.project_root || config('projectRoot', config('project_root', window.location.protocol + '//' + window.location.host)), | ||
environment: err.environment || config('environment'), | ||
component: err.component || config('component'), | ||
action: err.action || config('action'), | ||
revision: err.revision || config('revision') | ||
}); | ||
let stack_before_handlers = err.stack; | ||
if (checkHandlers(self.beforeNotifyHandlers, err)) { return false; } | ||
if (err.stack != stack_before_handlers) { | ||
// Stack changed, so it's not generated. | ||
generator = undefined; | ||
} | ||
if (isIgnored(err, config('ignorePatterns'))) { return false; } | ||
var data = cgiData(); | ||
@@ -295,13 +316,13 @@ if (typeof err.cookies === 'string') { | ||
'error': { | ||
'class': err.name || 'Error', | ||
'class': err.name, | ||
'message': err.message, | ||
'backtrace': err.stack, | ||
'generator': err.generator, | ||
'generator': generator, | ||
'fingerprint': err.fingerprint | ||
}, | ||
'request': { | ||
'url': err.url || document.URL, | ||
'component': err.component || config('component'), | ||
'action': err.action || config('action'), | ||
'context': merge(self.context, err.context), | ||
'url': err.url, | ||
'component': err.component, | ||
'action': err.action, | ||
'context': err.context, | ||
'cgi_data': data, | ||
@@ -311,5 +332,5 @@ 'params': err.params | ||
'server': { | ||
'project_root': err.projectRoot || err.project_root || config('projectRoot', config('project_root', window.location.protocol + '//' + window.location.host)), | ||
'environment_name': err.environment || config('environment'), | ||
'revision': err.revision || config('revision') | ||
'project_root': err.projectRoot, | ||
'environment_name': err.environment, | ||
'revision': err.revision | ||
} | ||
@@ -336,7 +357,2 @@ }; | ||
function objectIsExtensible(obj) { | ||
if (typeof Object.isExtensible !== 'function') { return true; } | ||
return Object.isExtensible(obj); | ||
} | ||
var preferCatch = true; | ||
@@ -343,0 +359,0 @@ // IE < 10 |
@@ -22,3 +22,3 @@ (function (global, factory) { | ||
function builder() { | ||
var VERSION = '1.0.3', | ||
var VERSION = '1.0.4', | ||
NOTIFIER = { | ||
@@ -180,2 +180,20 @@ name: 'honeybadger.js', | ||
return false; | ||
} | ||
function objectIsEmpty(obj) { | ||
for (var k in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, k)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
function objectIsExtensible(obj) { | ||
if (typeof Object.isExtensible !== 'function') { | ||
return true; | ||
} | ||
return Object.isExtensible(obj); | ||
} // Client factory. | ||
@@ -352,21 +370,34 @@ | ||
send(currentPayload); | ||
} // Halt if err is empty. | ||
} | ||
if (objectIsEmpty(err)) { | ||
return false; | ||
} | ||
if (function () { | ||
var k, results; | ||
results = []; | ||
var generator; | ||
for (k in err) { | ||
if (!Object.prototype.hasOwnProperty.call(err, k)) continue; | ||
results.push(k); | ||
} | ||
if (generated) { | ||
err.stack = generated.stack; | ||
generator = generated.generator; | ||
} | ||
return results; | ||
}().length === 0) { | ||
err = merge(err, { | ||
name: err.name || 'Error', | ||
context: merge(self.context, err.context), | ||
url: err.url || document.URL, | ||
projectRoot: err.projectRoot || err.project_root || config('projectRoot', config('project_root', window.location.protocol + '//' + window.location.host)), | ||
environment: err.environment || config('environment'), | ||
component: err.component || config('component'), | ||
action: err.action || config('action'), | ||
revision: err.revision || config('revision') | ||
}); | ||
var stack_before_handlers = err.stack; | ||
if (checkHandlers(self.beforeNotifyHandlers, err)) { | ||
return false; | ||
} | ||
if (generated) { | ||
err = merge(err, generated); | ||
if (err.stack != stack_before_handlers) { | ||
// Stack changed, so it's not generated. | ||
generator = undefined; | ||
} | ||
@@ -378,6 +409,2 @@ | ||
if (checkHandlers(self.beforeNotifyHandlers, err)) { | ||
return false; | ||
} | ||
var data = cgiData(); | ||
@@ -394,13 +421,13 @@ | ||
'error': { | ||
'class': err.name || 'Error', | ||
'class': err.name, | ||
'message': err.message, | ||
'backtrace': err.stack, | ||
'generator': err.generator, | ||
'generator': generator, | ||
'fingerprint': err.fingerprint | ||
}, | ||
'request': { | ||
'url': err.url || document.URL, | ||
'component': err.component || config('component'), | ||
'action': err.action || config('action'), | ||
'context': merge(self.context, err.context), | ||
'url': err.url, | ||
'component': err.component, | ||
'action': err.action, | ||
'context': err.context, | ||
'cgi_data': data, | ||
@@ -410,5 +437,5 @@ 'params': err.params | ||
'server': { | ||
'project_root': err.projectRoot || err.project_root || config('projectRoot', config('project_root', window.location.protocol + '//' + window.location.host)), | ||
'environment_name': err.environment || config('environment'), | ||
'revision': err.revision || config('revision') | ||
'project_root': err.projectRoot, | ||
'environment_name': err.environment, | ||
'revision': err.revision | ||
} | ||
@@ -434,10 +461,2 @@ }; | ||
function objectIsExtensible(obj) { | ||
if (typeof Object.isExtensible !== 'function') { | ||
return true; | ||
} | ||
return Object.isExtensible(obj); | ||
} | ||
var preferCatch = true; // IE < 10 | ||
@@ -444,0 +463,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Honeybadger=t()}(this,function(){"use strict";function H(e){return(H="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})(e)}var e=function(){var m,w,j="1.0.3",E={name:"honeybadger.js",url:"https://github.com/honeybadger-io/honeybadger-js",version:j,language:"javascript"},k=!1,_=!1;function x(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r}function S(e,t){var r=x(e,t);return e.context&&t.context&&(r.context=x(e.context,t.context)),r}function T(e){return!!m&&m.name===e.name&&m.message===e.message&&m.stack===e.stack}function O(e){return e.stacktrace||e.stack||void 0}return function(e){var o=_,t=[],c=[],s={context:{},beforeNotifyHandlers:[],errorsSent:0};if("object"===H(e))for(var r in e)s[r]=e[r];function u(){var e=window.console;if(e){var t=Array.prototype.slice.call(arguments);t.unshift("[Honeybadger]"),e.log.apply(e,t)}}function f(){if(l("debug"))return u.apply(this,arguments)}function l(e,t){var r=s[e];return void 0===r&&(r=s[e.toLowerCase()]),"false"===r&&(r=!1),void 0!==r?r:t}function p(){return!o&&l("onerror",!0)}function n(e,t){try{var r=new XMLHttpRequest;r.open("POST","http"+(l("ssl",!0)?"s":"")+"://"+l("host","api.honeybadger.io")+"/v1/notices/js",l("async",!0)),r.setRequestHeader("X-API-Key",e),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("Accept","text/json, application/json"),r.send(JSON.stringify(function e(t,r){var n,o,i,a;if(i={},r||(r=0),r>=l("max_depth",8))return"[MAX DEPTH REACHED]";for(n in t)o=t[n],Object.prototype.hasOwnProperty.call(t,n)&&null!=n&&null!=o&&((/function|symbol/.test(H(a=o))||"object"===H(a)&&void 0===a.hasOwnProperty)&&(o=Object.prototype.toString.call(o)),i[n]="object"===H(o)?e(o,r+1):o);return i}(t)))}catch(e){u("Unable to send error report: error while initializing request",e,t)}}function d(e){if(m=w=null,l("disabled",!1))return f("Dropping notice: honeybadger.js is disabled",e),!1;var t,r=l("apiKey",l("api_key"));return r?(t=l("maxErrors"))&&s.errorsSent>=t?(f("Dropping notice: max errors exceeded",e),!1):(s.errorsSent++,n(r,e),!0):(u("Unable to send error report: no API key has been configured"),!1)}function y(r,e){if(r||(r={}),"[object Error]"===Object.prototype.toString.call(r)){var t=r;r=x(r,{name:t.name,message:t.message,stack:O(t)})}if("object"!==H(r)){var n=String(r);r={message:n}}if(T(r))return!1;if(w&&k&&d(w),0===function(){var e,t;for(e in t=[],r)Object.prototype.hasOwnProperty.call(r,e)&&t.push(e);return t}().length)return!1;if(e&&(r=x(r,e)),function(e,t){var r=e.message;for(var n in t)if(r.match(t[n]))return!0;return!1}(r,l("ignorePatterns")))return!1;if(function(e,t){var r,n;for(r=0,n=e.length;r<n;r++)if(!1===(0,e[r])(t))return!0;return!1}(s.beforeNotifyHandlers,r))return!1;var o,i=((o={}).HTTP_USER_AGENT=navigator.userAgent,document.referrer.match(/\S/)&&(o.HTTP_REFERER=document.referrer),o);"string"==typeof r.cookies?i.HTTP_COOKIE=r.cookies:"object"===H(r.cookies)&&(i.HTTP_COOKIE=function(e){if("object"===H(e)){var t=[];for(var r in e)t.push(r+"="+e[r]);return t.join(";")}}(r.cookies));var a={notifier:E,error:{class:r.name||"Error",message:r.message,backtrace:r.stack,generator:r.generator,fingerprint:r.fingerprint},request:{url:r.url||document.URL,component:r.component||l("component"),action:r.action||l("action"),context:x(s.context,r.context),cgi_data:i,params:r.params},server:{project_root:r.projectRoot||r.project_root||l("projectRoot",l("project_root",window.location.protocol+"//"+window.location.host)),environment_name:r.environment||l("environment"),revision:r.revision||l("revision")}};return w=a,m=r,k?(f("Deferring notice",r,a),window.setTimeout(function(){T(r)&&d(a)})):(f("Queuing notice",r,a),c.push(a)),r}var i=!0;if(window.atob||(i=!1),window.ErrorEvent)try{0===new window.ErrorEvent("").colno&&(i=!1)}catch(e){}function a(t,r){try{return"function"!=typeof t?t:(e=t,"function"!=typeof Object.isExtensible||Object.isExtensible(e)?(t.___hb||(t.___hb=function(){var e=p();if(!(i&&(e||r)||r&&!e))return t.apply(this,arguments);try{return t.apply(this,arguments)}catch(e){throw y(e),e}}),t.___hb.___hb=t.___hb,t.___hb):t)}catch(e){return t}var e}s.notify=function(e,t,r){if(e||(e={}),"[object Error]"===Object.prototype.toString.call(e)){var n=e;e=x(e,{name:n.name,message:n.message,stack:O(n)})}return"object"!==H(e)&&(e={message:String(e)}),t&&"object"!==H(t)&&(t={name:String(t)}),t&&(e=S(e,t)),"object"===H(r)&&(e=S(e,r)),y(e,function(e){var t;if(e&&(t=O(e)))return{stack:t,generator:void 0};try{throw new Error("")}catch(e){if(t=O(e))return{stack:t,generator:"throw"}}t=["<call-stack>"];for(var r=arguments.callee;r&&t.length<10;){/function(?:\s+([\w$]+))+\s*\(/.test(r.toString())?t.push(RegExp.$1||"<anonymous>"):t.push("<anonymous>");try{r=r.caller}catch(e){break}}return{stack:t.join("\n"),generator:"walk"}}(e))},s.wrap=function(e){return a(e,!0)},s.setContext=function(e){return"object"===H(e)&&(s.context=x(s.context,e)),s},s.resetContext=function(e){return"object"===H(e)?s.context=x({},e):s.context={},s},s.configure=function(e){for(var t in e)s[t]=e[t];return s},s.beforeNotify=function(e){return s.beforeNotifyHandlers.push(e),s};var v=[].indexOf||function(e){for(var t=0,r=this.length;t<r;t++)if(t in this&&this[t]===e)return t;return-1};function g(e,t,r){if(!o&&e&&t&&r){var n=e[t];e[t]=r(n)}}s.reset=function(){for(var e in s.context={},s.beforeNotifyHandlers=[],s)-1==v.call(t,e)&&(s[e]=void 0);return s.resetMaxErrors(),s},s.resetMaxErrors=function(){return s.errorsSent=0},s.getVersion=function(){return j};var h=function(n){return function(e,t){if("function"!=typeof e)return n(e,t);var r=Array.prototype.slice.call(arguments,2);return e=a(e),n(function(){e.apply(null,r)},t)}};for(var r in g(window,"setTimeout",h),g(window,"setInterval",h),"EventTarget Window Node ApplicationCache AudioTrackList ChannelMergerNode CryptoOperation EventSource FileReader HTMLUnknownElement IDBDatabase IDBRequest IDBTransaction KeyOperation MediaController MessagePort ModalWindow Notification SVGElementInstance Screen TextTrack TextTrackCue TextTrackList WebSocket WebSocketWorker Worker XMLHttpRequest XMLHttpRequestEventTarget XMLHttpRequestUpload".replace(/\w+/g,function(e){var t=window[e]&&window[e].prototype;t&&t.hasOwnProperty&&t.hasOwnProperty("addEventListener")&&(g(t,"addEventListener",function(o){return function(e,t,r,n){try{t&&null!=t.handleEvent&&(t.handleEvent=a(t.handleEvent))}catch(e){u(e)}return o.call(this,e,a(t),r,n)}}),g(t,"removeEventListener",function(o){return function(e,t,r,n){return o.call(this,e,t,r,n),o.call(this,e,a(t),r,n)}}))}),g(window,"onerror",function(i){return function(e,t,r,n,o){return function(e,t,r,n,o){if(f("window.onerror callback invoked",arguments),!m&&p())if(0===r&&/Script error\.?/.test(e))u("Ignoring cross-domain script error: enable CORS to track these types of errors",arguments);else{var i=[e,"\n at ? (",t||"unknown",":",r||0,":",n||0,")"].join("");if(o){var a={stack:O(o)};return a.stack||(a={stack:i}),y(o,a)}y({name:"window.onerror",message:e,stack:i})}}(e,t,r,n,o),!("function"!=typeof i||!l("_onerror_call_orig",!0))&&i.apply(this,arguments)}}),_=!0,s)t.push(r);if(f("Initializing honeybadger.js "+j),/complete|interactive|loaded/.test(document.readyState))k=!0,f("honeybadger.js 1.0.3 ready");else{f("Installing ready handler");var b=function(){var e;for(k=!0,f("honeybadger.js 1.0.3 ready");e=c.pop();)d(e)};document.addEventListener?document.addEventListener("DOMContentLoaded",b,!0):window.attachEvent("onload",b)}return s}}(),t=e();return t.factory=e,t}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Honeybadger=t()}(this,function(){"use strict";function R(e){return(R="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})(e)}var e=function(){var b,w,j="1.0.4",k={name:"honeybadger.js",url:"https://github.com/honeybadger-io/honeybadger-js",version:j,language:"javascript"},E=!1,x=!1;function _(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function S(e,t){var n=_(e,t);return e.context&&t.context&&(n.context=_(e.context,t.context)),n}function T(e){return!!b&&b.name===e.name&&b.message===e.message&&b.stack===e.stack}function O(e){return e.stacktrace||e.stack||void 0}return function(e){var o=x,t=[],u=[],f={context:{},beforeNotifyHandlers:[],errorsSent:0};if("object"===R(e))for(var n in e)f[n]=e[n];function c(){var e=window.console;if(e){var t=Array.prototype.slice.call(arguments);t.unshift("[Honeybadger]"),e.log.apply(e,t)}}function l(){if(p("debug"))return c.apply(this,arguments)}function p(e,t){var n=f[e];return void 0===n&&(n=f[e.toLowerCase()]),"false"===n&&(n=!1),void 0!==n?n:t}function s(){return!o&&p("onerror",!0)}function r(e,t){try{var n=new XMLHttpRequest;n.open("POST","http"+(p("ssl",!0)?"s":"")+"://"+p("host","api.honeybadger.io")+"/v1/notices/js",p("async",!0)),n.setRequestHeader("X-API-Key",e),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Accept","text/json, application/json"),n.send(JSON.stringify(function e(t,n){var r,o,i,a;if(i={},n||(n=0),n>=p("max_depth",8))return"[MAX DEPTH REACHED]";for(r in t)o=t[r],Object.prototype.hasOwnProperty.call(t,r)&&null!=r&&null!=o&&((/function|symbol/.test(R(a=o))||"object"===R(a)&&void 0===a.hasOwnProperty)&&(o=Object.prototype.toString.call(o)),i[r]="object"===R(o)?e(o,n+1):o);return i}(t)))}catch(e){c("Unable to send error report: error while initializing request",e,t)}}function d(e){if(b=w=null,p("disabled",!1))return l("Dropping notice: honeybadger.js is disabled",e),!1;var t,n=p("apiKey",p("api_key"));return n?(t=p("maxErrors"))&&f.errorsSent>=t?(l("Dropping notice: max errors exceeded",e),!1):(f.errorsSent++,r(n,e),!0):(c("Unable to send error report: no API key has been configured"),!1)}function v(e,t){if(e||(e={}),"[object Error]"===Object.prototype.toString.call(e)){var n=e;e=_(e,{name:n.name,message:n.message,stack:O(n)})}if("object"!==R(e)){var r=String(e);e={message:r}}if(T(e))return!1;if(w&&E&&d(w),function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(e))return!1;var o;t&&(e.stack=t.stack,o=t.generator);var i=(e=_(e,{name:e.name||"Error",context:_(f.context,e.context),url:e.url||document.URL,projectRoot:e.projectRoot||e.project_root||p("projectRoot",p("project_root",window.location.protocol+"//"+window.location.host)),environment:e.environment||p("environment"),component:e.component||p("component"),action:e.action||p("action"),revision:e.revision||p("revision")})).stack;if(function(e,t){var n,r;for(n=0,r=e.length;n<r;n++)if(!1===(0,e[n])(t))return!0;return!1}(f.beforeNotifyHandlers,e))return!1;if(e.stack!=i&&(o=void 0),function(e,t){var n=e.message;for(var r in t)if(n.match(t[r]))return!0;return!1}(e,p("ignorePatterns")))return!1;var a,c=((a={}).HTTP_USER_AGENT=navigator.userAgent,document.referrer.match(/\S/)&&(a.HTTP_REFERER=document.referrer),a);"string"==typeof e.cookies?c.HTTP_COOKIE=e.cookies:"object"===R(e.cookies)&&(c.HTTP_COOKIE=function(e){if("object"===R(e)){var t=[];for(var n in e)t.push(n+"="+e[n]);return t.join(";")}}(e.cookies));var s={notifier:k,error:{class:e.name,message:e.message,backtrace:e.stack,generator:o,fingerprint:e.fingerprint},request:{url:e.url,component:e.component,action:e.action,context:e.context,cgi_data:c,params:e.params},server:{project_root:e.projectRoot,environment_name:e.environment,revision:e.revision}};return w=s,b=e,E?(l("Deferring notice",e,s),window.setTimeout(function(){T(e)&&d(s)})):(l("Queuing notice",e,s),u.push(s)),e}var i=!0;if(window.atob||(i=!1),window.ErrorEvent)try{0===new window.ErrorEvent("").colno&&(i=!1)}catch(e){}function a(t,n){try{return"function"!=typeof t?t:(e=t,"function"!=typeof Object.isExtensible||Object.isExtensible(e)?(t.___hb||(t.___hb=function(){var e=s();if(!(i&&(e||n)||n&&!e))return t.apply(this,arguments);try{return t.apply(this,arguments)}catch(e){throw v(e),e}}),t.___hb.___hb=t.___hb,t.___hb):t)}catch(e){return t}var e}f.notify=function(e,t,n){if(e||(e={}),"[object Error]"===Object.prototype.toString.call(e)){var r=e;e=_(e,{name:r.name,message:r.message,stack:O(r)})}return"object"!==R(e)&&(e={message:String(e)}),t&&"object"!==R(t)&&(t={name:String(t)}),t&&(e=S(e,t)),"object"===R(n)&&(e=S(e,n)),v(e,function(e){var t;if(e&&(t=O(e)))return{stack:t,generator:void 0};try{throw new Error("")}catch(e){if(t=O(e))return{stack:t,generator:"throw"}}t=["<call-stack>"];for(var n=arguments.callee;n&&t.length<10;){/function(?:\s+([\w$]+))+\s*\(/.test(n.toString())?t.push(RegExp.$1||"<anonymous>"):t.push("<anonymous>");try{n=n.caller}catch(e){break}}return{stack:t.join("\n"),generator:"walk"}}(e))},f.wrap=function(e){return a(e,!0)},f.setContext=function(e){return"object"===R(e)&&(f.context=_(f.context,e)),f},f.resetContext=function(e){return"object"===R(e)?f.context=_({},e):f.context={},f},f.configure=function(e){for(var t in e)f[t]=e[t];return f},f.beforeNotify=function(e){return f.beforeNotifyHandlers.push(e),f};var y=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};function g(e,t,n){if(!o&&e&&t&&n){var r=e[t];e[t]=n(r)}}f.reset=function(){for(var e in f.context={},f.beforeNotifyHandlers=[],f)-1==y.call(t,e)&&(f[e]=void 0);return f.resetMaxErrors(),f},f.resetMaxErrors=function(){return f.errorsSent=0},f.getVersion=function(){return j};var m=function(r){return function(e,t){if("function"!=typeof e)return r(e,t);var n=Array.prototype.slice.call(arguments,2);return e=a(e),r(function(){e.apply(null,n)},t)}};for(var n in g(window,"setTimeout",m),g(window,"setInterval",m),"EventTarget Window Node ApplicationCache AudioTrackList ChannelMergerNode CryptoOperation EventSource FileReader HTMLUnknownElement IDBDatabase IDBRequest IDBTransaction KeyOperation MediaController MessagePort ModalWindow Notification SVGElementInstance Screen TextTrack TextTrackCue TextTrackList WebSocket WebSocketWorker Worker XMLHttpRequest XMLHttpRequestEventTarget XMLHttpRequestUpload".replace(/\w+/g,function(e){var t=window[e]&&window[e].prototype;t&&t.hasOwnProperty&&t.hasOwnProperty("addEventListener")&&(g(t,"addEventListener",function(o){return function(e,t,n,r){try{t&&null!=t.handleEvent&&(t.handleEvent=a(t.handleEvent))}catch(e){c(e)}return o.call(this,e,a(t),n,r)}}),g(t,"removeEventListener",function(o){return function(e,t,n,r){return o.call(this,e,t,n,r),o.call(this,e,a(t),n,r)}}))}),g(window,"onerror",function(i){return function(e,t,n,r,o){return function(e,t,n,r,o){if(l("window.onerror callback invoked",arguments),!b&&s())if(0===n&&/Script error\.?/.test(e))c("Ignoring cross-domain script error: enable CORS to track these types of errors",arguments);else{var i=[e,"\n at ? (",t||"unknown",":",n||0,":",r||0,")"].join("");if(o){var a={stack:O(o)};return a.stack||(a={stack:i}),v(o,a)}v({name:"window.onerror",message:e,stack:i})}}(e,t,n,r,o),!("function"!=typeof i||!p("_onerror_call_orig",!0))&&i.apply(this,arguments)}}),x=!0,f)t.push(n);if(l("Initializing honeybadger.js "+j),/complete|interactive|loaded/.test(document.readyState))E=!0,l("honeybadger.js 1.0.4 ready");else{l("Installing ready handler");var h=function(){var e;for(E=!0,l("honeybadger.js 1.0.4 ready");e=u.pop();)d(e)};document.addEventListener?document.addEventListener("DOMContentLoaded",h,!0):window.attachEvent("onload",h)}return f}}(),t=e();return t.factory=e,t}); | ||
//# sourceMappingURL=honeybadger.min.js.map |
{ | ||
"name": "honeybadger-js", | ||
"description": "A JavaScript library for integrating apps with the Honeybadger Rails Error Notifier.", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
@@ -48,3 +48,3 @@ "homepage": "https://github.com/honeybadger-io/honeybadger-js", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
"rollup-plugin-commonjs": "^10.0.0", | ||
"rollup-plugin-node-resolve": "^5.0.0", | ||
@@ -51,0 +51,0 @@ "rollup-plugin-replace": "^2.1.1", |
@@ -43,2 +43,3 @@ # Honeybadger Client-Side Javascript Library | ||
export HONEYBADGER_JS_S3_BUCKET=honeybadger-js | ||
export HONEYBADGER_DISTRIBUTION_ID=cloudfront-id | ||
``` | ||
@@ -45,0 +46,0 @@ |
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
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
144841
1763
63