@microsoft/applicationinsights-dependencies-js 2.8.0-beta.2203-08 → 2.8.0-beta.2203-09

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights XHR dependencies plugin, 2.8.0-beta.2203-08
2
+ * Microsoft Application Insights XHR dependencies plugin, 2.8.0-beta.2203-09
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Dependencies Plugin, 2.8.0-beta.2203-08
2
+ * Application Insights JavaScript SDK - Dependencies Plugin, 2.8.0-beta.2203-09
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -1734,6 +1734,8 @@
1734
1734
  var strEvents = "events";
1735
1735
  createUniqueNamespace("aiEvtPageHide");
1736
1736
  createUniqueNamespace("aiEvtPageShow");
1737
+ var rRemoveEmptyNs = /\.[\.]+/g;
1738
+ var rRemoveTrailingEmptyNs = /[\.]+$/;
1737
1739
  var _guid = 1;
1738
1740
  var elmNodeData = createElmNodeData("events");
1739
1741
  var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
@@ -1771,7 +1773,7 @@
1771
1773
  var parsedEvent = (eventNamespace.exec(eventName) || []);
1772
1774
  return {
1773
1775
  type: parsedEvent[1],
1774
- ns: ((parsedEvent[2] || "").split(".").sort()).join(".")
1776
+ ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
1775
1777
  };
1776
1778
  }
1777
1779
  function _getRegisteredEvents(target, evtName, addDefault) {
@@ -1806,6 +1808,7 @@
1806
1808
  else {
1807
1809
  newNamespaces = [theNamespace, namespaces];
1808
1810
  }
1811
+ newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split(".");
1809
1812
  }
1810
1813
  else {
1811
1814
  newNamespaces = theNamespace;
@@ -2990,6 +2993,7 @@
2990
2993
  var isPolyfill = fetch.polyfill;
2991
2994
  if (_config.disableFetchTracking === false) {
2992
2995
  _addHook(InstrumentFunc(global, strFetch, {
2996
+ ns: _evtNamespace,
2993
2997
  req: function (callDetails, input, init) {
2994
2998
  var fetchData;
2995
2999
  if (_fetchInitialized &&
@@ -3038,6 +3042,7 @@
3038
3042
  }
3039
3043
  else if (isPolyfill) {
3040
3044
  _addHook(InstrumentFunc(global, strFetch, {
3045
+ ns: _evtNamespace,
3041
3046
  req: function (callDetails, input, init) {
3042
3047
  _isDisabledRequest(null, input, init);
3043
3048
  }
@@ -3053,6 +3058,7 @@
3053
3058
  function _instrumentXhr() {
3054
3059
  if (_supportsAjaxMonitoring(_self) && !_xhrInitialized) {
3055
3060
  _hookProto(XMLHttpRequest, "open", {
3061
+ ns: _evtNamespace,
3056
3062
  req: function (args, method, url, async) {
3057
3063
  var xhr = args.inst;
3058
3064
  var ajaxData = xhr[strAjaxData];
@@ -3066,6 +3072,7 @@
3066
3072
  hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")
3067
3073
  });
3068
3074
  _hookProto(XMLHttpRequest, "send", {
3075
+ ns: _evtNamespace,
3069
3076
  req: function (args, context) {
3070
3077
  var xhr = args.inst;
3071
3078
  var ajaxData = xhr[strAjaxData];