Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

honeybadger-js

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

honeybadger-js - npm Package Compare versions

Comparing version 1.0.4 to 2.0.0-beta.0

4

CHANGELOG.md

@@ -8,2 +8,6 @@ # Change Log

## [2.0.0-beta.0] - 2019-07-01
### Added
- Report unhandled promise rejections using `window.onunhandledrejection`. PR #140 by @ryanoglesby08
## [1.0.4] - 2019-06-12

@@ -10,0 +14,0 @@ ### Fixed

'use strict';
function builder() {
var VERSION = '1.0.4',
var VERSION = '2.0.0-beta.0',
NOTIFIER = {

@@ -185,2 +185,7 @@ name: 'honeybadger.js',

function onUnhandledRejectionEnabled() {
if (notSingleton) { return false; }
return config('onunhandledrejection', true);
}
function baseURL() {

@@ -575,2 +580,45 @@ return 'http' + ((config('ssl', true) && 's') || '') + '://' + config('host', 'api.honeybadger.io');

instrument(window, 'onunhandledrejection', function(original) {
// See https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event
function onunhandledrejection(promiseRejectionEvent) {
debug('window.onunhandledrejection callback invoked', arguments);
// Skip if the error is already being sent.
if (currentErr) { return; }
if (!onUnhandledRejectionEnabled()) { return; }
let { reason } = promiseRejectionEvent;
if (reason instanceof Error) {
// simulate v8 stack
let fileName = reason.fileName || 'unknown';
let lineNumber = reason.lineNumber || 0;
let stackFallback = `${reason.message}\n at ? (${fileName}:${lineNumber})`;
let stack = stackTrace(reason) || stackFallback;
notify({
name: reason.name,
message: `UnhandledPromiseRejectionWarning: ${reason}`,
stack
});
return;
}
let message = typeof reason === 'string' ? reason : JSON.stringify(reason);
notify({
name: 'window.onunhandledrejection',
message: `UnhandledPromiseRejectionWarning: ${message}`,
});
}
return function(promiseRejectionEvent) {
onunhandledrejection(promiseRejectionEvent);
if (typeof original === 'function') {
original.apply(this, arguments);
}
}
});
function incrementErrorsCount() {

@@ -577,0 +625,0 @@ return self.errorsSent++;

function builder() {
var VERSION = '1.0.4',
var VERSION = '2.0.0-beta.0',
NOTIFIER = {

@@ -183,2 +183,7 @@ name: 'honeybadger.js',

function onUnhandledRejectionEnabled() {
if (notSingleton) { return false; }
return config('onunhandledrejection', true);
}
function baseURL() {

@@ -573,2 +578,45 @@ return 'http' + ((config('ssl', true) && 's') || '') + '://' + config('host', 'api.honeybadger.io');

instrument(window, 'onunhandledrejection', function(original) {
// See https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event
function onunhandledrejection(promiseRejectionEvent) {
debug('window.onunhandledrejection callback invoked', arguments);
// Skip if the error is already being sent.
if (currentErr) { return; }
if (!onUnhandledRejectionEnabled()) { return; }
let { reason } = promiseRejectionEvent;
if (reason instanceof Error) {
// simulate v8 stack
let fileName = reason.fileName || 'unknown';
let lineNumber = reason.lineNumber || 0;
let stackFallback = `${reason.message}\n at ? (${fileName}:${lineNumber})`;
let stack = stackTrace(reason) || stackFallback;
notify({
name: reason.name,
message: `UnhandledPromiseRejectionWarning: ${reason}`,
stack
});
return;
}
let message = typeof reason === 'string' ? reason : JSON.stringify(reason);
notify({
name: 'window.onunhandledrejection',
message: `UnhandledPromiseRejectionWarning: ${message}`,
});
}
return function(promiseRejectionEvent) {
onunhandledrejection(promiseRejectionEvent);
if (typeof original === 'function') {
original.apply(this, arguments);
}
}
});
function incrementErrorsCount() {

@@ -575,0 +623,0 @@ return self.errorsSent++;

@@ -22,3 +22,3 @@ (function (global, factory) {

function builder() {
var VERSION = '1.0.4',
var VERSION = '2.0.0-beta.0',
NOTIFIER = {

@@ -259,2 +259,10 @@ name: 'honeybadger.js',

function onUnhandledRejectionEnabled() {
if (notSingleton) {
return false;
}
return config('onunhandledrejection', true);
}
function baseURL() {

@@ -729,3 +737,47 @@ return 'http' + (config('ssl', true) && 's' || '') + '://' + config('host', 'api.honeybadger.io');

});
instrument(window, 'onunhandledrejection', function (original) {
// See https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event
function onunhandledrejection(promiseRejectionEvent) {
debug('window.onunhandledrejection callback invoked', arguments); // Skip if the error is already being sent.
if (currentErr) {
return;
}
if (!onUnhandledRejectionEnabled()) {
return;
}
var reason = promiseRejectionEvent.reason;
if (reason instanceof Error) {
// simulate v8 stack
var fileName = reason.fileName || 'unknown';
var lineNumber = reason.lineNumber || 0;
var stackFallback = "".concat(reason.message, "\n at ? (").concat(fileName, ":").concat(lineNumber, ")");
var stack = stackTrace(reason) || stackFallback;
notify({
name: reason.name,
message: "UnhandledPromiseRejectionWarning: ".concat(reason),
stack: stack
});
return;
}
var message = typeof reason === 'string' ? reason : JSON.stringify(reason);
notify({
name: 'window.onunhandledrejection',
message: "UnhandledPromiseRejectionWarning: ".concat(message)
});
}
return function (promiseRejectionEvent) {
onunhandledrejection(promiseRejectionEvent);
if (typeof original === 'function') {
original.apply(this, arguments);
}
};
});
function incrementErrorsCount() {

@@ -732,0 +784,0 @@ return self.errorsSent++;

2

dist/honeybadger.min.js

@@ -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 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});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).Honeybadger=n()}(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="2.0.0-beta.0",k={name:"honeybadger.js",url:"https://github.com/honeybadger-io/honeybadger-js",version:j,language:"javascript"},E=!1,x=!1;function _(e,n){var t={};for(var r in e)t[r]=e[r];for(var r in n)t[r]=n[r];return t}function S(e,n){var t=_(e,n);return e.context&&n.context&&(t.context=_(e.context,n.context)),t}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 c=x,n=[],u=[],f={context:{},beforeNotifyHandlers:[],errorsSent:0};if("object"===R(e))for(var t in e)f[t]=e[t];function s(){var e=window.console;if(e){var n=Array.prototype.slice.call(arguments);n.unshift("[Honeybadger]"),e.log.apply(e,n)}}function l(){if(p("debug"))return s.apply(this,arguments)}function p(e,n){var t=f[e];return void 0===t&&(t=f[e.toLowerCase()]),"false"===t&&(t=!1),void 0!==t?t:n}function d(){return!c&&p("onerror",!0)}function r(e,n){try{var t=new XMLHttpRequest;t.open("POST","http"+(p("ssl",!0)?"s":"")+"://"+p("host","api.honeybadger.io")+"/v1/notices/js",p("async",!0)),t.setRequestHeader("X-API-Key",e),t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Accept","text/json, application/json"),t.send(JSON.stringify(function e(n,t){var r,o,i,a;if(i={},t||(t=0),t>=p("max_depth",8))return"[MAX DEPTH REACHED]";for(r in n)o=n[r],Object.prototype.hasOwnProperty.call(n,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,t+1):o);return i}(n)))}catch(e){s("Unable to send error report: error while initializing request",e,n)}}function v(e){if(b=w=null,p("disabled",!1))return l("Dropping notice: honeybadger.js is disabled",e),!1;var n,t=p("apiKey",p("api_key"));return t?(n=p("maxErrors"))&&f.errorsSent>=n?(l("Dropping notice: max errors exceeded",e),!1):(f.errorsSent++,r(t,e),!0):(s("Unable to send error report: no API key has been configured"),!1)}function y(e,n){if(e||(e={}),"[object Error]"===Object.prototype.toString.call(e)){var t=e;e=_(e,{name:t.name,message:t.message,stack:O(t)})}if("object"!==R(e)){var r=String(e);e={message:r}}if(T(e))return!1;if(w&&E&&v(w),function(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!1;return!0}(e))return!1;var o;n&&(e.stack=n.stack,o=n.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,n){var t,r;for(t=0,r=e.length;t<r;t++)if(!1===(0,e[t])(n))return!0;return!1}(f.beforeNotifyHandlers,e))return!1;if(e.stack!=i&&(o=void 0),function(e,n){var t=e.message;for(var r in n)if(t.match(n[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 n=[];for(var t in e)n.push(t+"="+e[t]);return n.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)&&v(s)})):(l("Queuing notice",e,s),u.push(s)),e}var o=!0;if(window.atob||(o=!1),window.ErrorEvent)try{0===new window.ErrorEvent("").colno&&(o=!1)}catch(e){}function i(n,t){try{return"function"!=typeof n?n:(e=n,"function"!=typeof Object.isExtensible||Object.isExtensible(e)?(n.___hb||(n.___hb=function(){var e=d();if(!(o&&(e||t)||t&&!e))return n.apply(this,arguments);try{return n.apply(this,arguments)}catch(e){throw y(e),e}}),n.___hb.___hb=n.___hb,n.___hb):n)}catch(e){return n}var e}f.notify=function(e,n,t){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)}),n&&"object"!==R(n)&&(n={name:String(n)}),n&&(e=S(e,n)),"object"===R(t)&&(e=S(e,t)),y(e,function(e){var n;if(e&&(n=O(e)))return{stack:n,generator:void 0};try{throw new Error("")}catch(e){if(n=O(e))return{stack:n,generator:"throw"}}n=["<call-stack>"];for(var t=arguments.callee;t&&n.length<10;){/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())?n.push(RegExp.$1||"<anonymous>"):n.push("<anonymous>");try{t=t.caller}catch(e){break}}return{stack:n.join("\n"),generator:"walk"}}(e))},f.wrap=function(e){return i(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 n in e)f[n]=e[n];return f},f.beforeNotify=function(e){return f.beforeNotifyHandlers.push(e),f};var a=[].indexOf||function(e){for(var n=0,t=this.length;n<t;n++)if(n in this&&this[n]===e)return n;return-1};function m(e,n,t){if(!c&&e&&n&&t){var r=e[n];e[n]=t(r)}}f.reset=function(){for(var e in f.context={},f.beforeNotifyHandlers=[],f)-1==a.call(n,e)&&(f[e]=void 0);return f.resetMaxErrors(),f},f.resetMaxErrors=function(){return f.errorsSent=0},f.getVersion=function(){return j};var g=function(r){return function(e,n){if("function"!=typeof e)return r(e,n);var t=Array.prototype.slice.call(arguments,2);return e=i(e),r(function(){e.apply(null,t)},n)}};for(var t in m(window,"setTimeout",g),m(window,"setInterval",g),"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 n=window[e]&&window[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(m(n,"addEventListener",function(o){return function(e,n,t,r){try{n&&null!=n.handleEvent&&(n.handleEvent=i(n.handleEvent))}catch(e){s(e)}return o.call(this,e,i(n),t,r)}}),m(n,"removeEventListener",function(o){return function(e,n,t,r){return o.call(this,e,n,t,r),o.call(this,e,i(n),t,r)}}))}),m(window,"onerror",function(i){return function(e,n,t,r,o){return function(e,n,t,r,o){if(l("window.onerror callback invoked",arguments),!b&&d())if(0===t&&/Script error\.?/.test(e))s("Ignoring cross-domain script error: enable CORS to track these types of errors",arguments);else{var i=[e,"\n at ? (",n||"unknown",":",t||0,":",r||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,n,t,r,o),!("function"!=typeof i||!p("_onerror_call_orig",!0))&&i.apply(this,arguments)}}),m(window,"onunhandledrejection",function(n){function t(e){if(l("window.onunhandledrejection callback invoked",arguments),!b&&!c&&p("onunhandledrejection",!0)){var n=e.reason;if(n instanceof Error){var t=n.fileName||"unknown",r=n.lineNumber||0,o="".concat(n.message,"\n at ? (").concat(t,":").concat(r,")"),i=O(n)||o;y({name:n.name,message:"UnhandledPromiseRejectionWarning: ".concat(n),stack:i})}else{var a="string"==typeof n?n:JSON.stringify(n);y({name:"window.onunhandledrejection",message:"UnhandledPromiseRejectionWarning: ".concat(a)})}}}return function(e){t(e),"function"==typeof n&&n.apply(this,arguments)}}),x=!0,f)n.push(t);if(l("Initializing honeybadger.js "+j),/complete|interactive|loaded/.test(document.readyState))E=!0,l("honeybadger.js "+j+" ready");else{l("Installing ready handler");var h=function(){var e;for(E=!0,l("honeybadger.js "+j+" ready");e=u.pop();)v(e)};document.addEventListener?document.addEventListener("DOMContentLoaded",h,!0):window.attachEvent("onload",h)}return f}}(),n=e();return n.factory=e,n});
//# sourceMappingURL=honeybadger.min.js.map
{
"name": "honeybadger-js",
"description": "A JavaScript library for integrating apps with the Honeybadger Rails Error Notifier.",
"version": "1.0.4",
"version": "2.0.0-beta.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/honeybadger-io/honeybadger-js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc