@honeybadger-io/js 5.1.5-alpha-3 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -800,7 +800,7 @@
800
800
  var notifier = {
801
801
  name: 'honeybadger-js',
802
802
  url: 'https://github.com/honeybadger-io/honeybadger-js',
803
- version: '5.1.5-alpha'
803
+ version: '5.2.0'
804
804
  };
805
805
  // Split at commas and spaces
806
806
  var TAG_SEPARATOR = /,|\s+/;
@@ -1022,12 +1022,16 @@
1022
1022
  revision: notice.revision || this.config.revision,
1023
1023
  tags: uniqueTags,
1024
1024
  });
1025
- if (typeof notice.stack !== 'string' || !notice.stack.trim()) {
1026
- notice.stack = (0, util_1$6.generateStackTrace)();
1027
- notice.backtrace = (0, util_1$6.makeBacktrace)(notice.stack, true, this.logger);
1028
- }
1029
- else {
1030
- notice.backtrace = (0, util_1$6.makeBacktrace)(notice.stack, false, this.logger);
1025
+ // If we're passed a custom backtrace array, use it
1026
+ // Otherwise we make one.
1027
+ if (!Array.isArray(notice.backtrace) || !notice.backtrace.length) {
1028
+ if (typeof notice.stack !== 'string' || !notice.stack.trim()) {
1029
+ notice.stack = (0, util_1$6.generateStackTrace)();
1030
+ notice.backtrace = (0, util_1$6.makeBacktrace)(notice.stack, true, this.logger);
1031
+ }
1032
+ else {
1033
+ notice.backtrace = (0, util_1$6.makeBacktrace)(notice.stack, false, this.logger);
1034
+ }
1031
1035
  }
1032
1036
  return notice;
1033
1037
  };
@@ -1540,9 +1544,6 @@
1540
1544
  if (!breadcrumbsEnabled('dom')) {
1541
1545
  return;
1542
1546
  }
1543
- if (typeof _window.addEventListener !== 'function') {
1544
- return;
1545
- }
1546
1547
  _window.addEventListener('click', function (event) {
1547
1548
  var message, selector, text;
1548
1549
  try {
@@ -1567,7 +1568,7 @@
1567
1568
  event: event
1568
1569
  }
1569
1570
  });
1570
- }, _window.location ? true : false); // In CloudFlare workers useCapture must be false. window.location is a hacky way to detect it.
1571
+ }, _window.location ? true : false); // In CloudFlare workers useCapture must be false. window.locaiton is a hacky way to detect it.
1571
1572
  })();
1572
1573
  // Breadcrumbs: instrument XMLHttpRequest
1573
1574
  (function () {
@@ -1575,9 +1576,8 @@
1575
1576
  return;
1576
1577
  }
1577
1578
  // Some environments may not support XMLHttpRequest.
1578
- if (typeof XMLHttpRequest === 'undefined') {
1579
+ if (typeof XMLHttpRequest === 'undefined')
1579
1580
  return;
1580
- }
1581
1581
  // -- On xhr.open: capture initial metadata
1582
1582
  instrument$2(XMLHttpRequest.prototype, 'open', function (original) {
1583
1583
  return function () {
@@ -1723,9 +1723,6 @@
1723
1723
  recordUrlChange(lastHref, _window.location.href);
1724
1724
  });
1725
1725
  }
1726
- if (typeof _window.history === 'undefined') {
1727
- return;
1728
- }
1729
1726
  // https://developer.mozilla.org/en-US/docs/Web/API/History/pushState
1730
1727
  // https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
1731
1728
  function historyWrapper(original) {
@@ -2114,9 +2111,7 @@
2114
2111
  HTTP_REFERER: undefined,
2115
2112
  HTTP_COOKIE: undefined
2116
2113
  };
2117
- if (typeof navigator !== 'undefined' && navigator.userAgent) {
2118
- cgiData.HTTP_USER_AGENT = navigator.userAgent;
2119
- }
2114
+ cgiData.HTTP_USER_AGENT = navigator.userAgent;
2120
2115
  if (typeof document !== 'undefined' && document.referrer.match(/\S/)) {
2121
2116
  cgiData.HTTP_REFERER = document.referrer;
2122
2117
  }