@microsoft/applicationinsights-common 3.0.6-nightly3.2311-01 → 3.0.6-nightly3.2311-02
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.
- package/browser/es5/applicationinsights-common.cjs.js +358 -14
- package/browser/es5/applicationinsights-common.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-common.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-common.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.js +360 -16
- package/browser/es5/applicationinsights-common.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-common.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.integrity.json +25 -25
- package/browser/es5/applicationinsights-common.js +360 -16
- package/browser/es5/applicationinsights-common.js.map +1 -1
- package/browser/es5/applicationinsights-common.min.js +2 -2
- package/browser/es5/applicationinsights-common.min.js.map +1 -1
- package/dist/es5/applicationinsights-common.js +358 -14
- package/dist/es5/applicationinsights-common.js.map +1 -1
- package/dist/es5/applicationinsights-common.min.js +2 -2
- package/dist/es5/applicationinsights-common.min.js.map +1 -1
- package/dist-es5/ConnectionStringParser.js +1 -1
- package/dist-es5/Constants.js +1 -1
- package/dist-es5/DomHelperFuncs.js +1 -1
- package/dist-es5/Enums.js +1 -1
- package/dist-es5/HelperFuncs.js +1 -1
- package/dist-es5/Interfaces/ConnectionString.js +1 -1
- package/dist-es5/Interfaces/Context/IApplication.js +1 -1
- package/dist-es5/Interfaces/Context/IDevice.js +1 -1
- package/dist-es5/Interfaces/Context/IInternal.js +1 -1
- package/dist-es5/Interfaces/Context/ILocation.js +1 -1
- package/dist-es5/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-es5/Interfaces/Context/ISample.js +1 -1
- package/dist-es5/Interfaces/Context/ISession.js +1 -1
- package/dist-es5/Interfaces/Context/ISessionManager.js +1 -1
- package/dist-es5/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-es5/Interfaces/Context/IUser.js +1 -1
- package/dist-es5/Interfaces/Context/IWeb.js +1 -1
- package/dist-es5/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-es5/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-es5/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-es5/Interfaces/Contracts/IBase.js +1 -1
- package/dist-es5/Interfaces/Contracts/IData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-es5/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-es5/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-es5/Interfaces/IAppInsights.js +1 -1
- package/dist-es5/Interfaces/IConfig.js +1 -1
- package/dist-es5/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-es5/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-es5/Interfaces/IEventTelemetry.js +1 -1
- package/dist-es5/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-es5/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPartC.js +1 -1
- package/dist-es5/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-es5/Interfaces/IRequestContext.js +1 -1
- package/dist-es5/Interfaces/IStorageBuffer.js +1 -1
- package/dist-es5/Interfaces/ITelemetryContext.js +1 -1
- package/dist-es5/Interfaces/IThrottleMgr.js +1 -1
- package/dist-es5/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-es5/Interfaces/PartAExtensions.js +1 -1
- package/dist-es5/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-es5/Offline.js +138 -0
- package/dist-es5/Offline.js.map +1 -0
- package/dist-es5/RequestResponseHeaders.js +1 -1
- package/dist-es5/StorageHelperFuncs.js +3 -3
- package/dist-es5/StorageHelperFuncs.js.map +1 -1
- package/dist-es5/Telemetry/Common/Data.js +1 -1
- package/dist-es5/Telemetry/Common/DataPoint.js +1 -1
- package/dist-es5/Telemetry/Common/DataSanitizer.js +1 -1
- package/dist-es5/Telemetry/Common/Envelope.js +1 -1
- package/dist-es5/Telemetry/Event.js +1 -1
- package/dist-es5/Telemetry/Exception.js +4 -4
- package/dist-es5/Telemetry/Exception.js.map +1 -1
- package/dist-es5/Telemetry/Metric.js +1 -1
- package/dist-es5/Telemetry/PageView.js +1 -1
- package/dist-es5/Telemetry/PageViewPerformance.js +1 -1
- package/dist-es5/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-es5/Telemetry/Trace.js +1 -1
- package/dist-es5/TelemetryItemCreator.js +1 -1
- package/dist-es5/ThrottleMgr.js +3 -3
- package/dist-es5/ThrottleMgr.js.map +1 -1
- package/dist-es5/UrlHelperFuncs.js +1 -1
- package/dist-es5/Util.js +1 -1
- package/dist-es5/__DynamicConstants.js +2 -1
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/applicationinsights-common.js +2 -1
- package/dist-es5/applicationinsights-common.js.map +1 -1
- package/package.json +2 -2
- package/types/applicationinsights-common.d.ts +42 -1
- package/types/applicationinsights-common.namespaced.d.ts +42 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.0.6-nightly3.2311-
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.0.6-nightly3.2311-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -689,7 +689,7 @@
|
|
|
689
689
|
var _DYN_WATCH = "watch";
|
|
690
690
|
var _DYN_LOGGER = "logger";
|
|
691
691
|
var _DYN_APPLY = "apply";
|
|
692
|
-
var _DYN_PUSH = "push";
|
|
692
|
+
var _DYN_PUSH$1 = "push";
|
|
693
693
|
var _DYN_SPLICE = "splice";
|
|
694
694
|
var _DYN_HDLR = "hdlr";
|
|
695
695
|
var _DYN_CANCEL = "cancel";
|
|
@@ -702,8 +702,11 @@
|
|
|
702
702
|
var _DYN_DIAG_LOG = "diagLog";
|
|
703
703
|
var _DYN_USER_AGENT = "userAgent";
|
|
704
704
|
var _DYN_SPLIT$1 = "split";
|
|
705
|
+
var _DYN_NODE_TYPE = "nodeType";
|
|
705
706
|
var _DYN_REPLACE = "replace";
|
|
706
707
|
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
708
|
+
var _DYN_TYPE = "type";
|
|
709
|
+
var _DYN_HANDLER = "handler";
|
|
707
710
|
var _DYN_TRACE_ID = "traceId";
|
|
708
711
|
var _DYN_SPAN_ID = "spanId";
|
|
709
712
|
var _DYN_TRACE_FLAGS = "traceFlags";
|
|
@@ -1220,13 +1223,62 @@
|
|
|
1220
1223
|
return result;
|
|
1221
1224
|
}
|
|
1222
1225
|
|
|
1223
|
-
var version = '3.0.6-nightly3.2311-
|
|
1226
|
+
var version = '3.0.6-nightly3.2311-02';
|
|
1224
1227
|
var instanceName = "." + newId(6);
|
|
1225
1228
|
var _dataUid = 0;
|
|
1229
|
+
function _canAcceptData(target) {
|
|
1230
|
+
return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]);
|
|
1231
|
+
}
|
|
1232
|
+
function _getCache(data, target) {
|
|
1233
|
+
var theCache = target[data.id];
|
|
1234
|
+
if (!theCache) {
|
|
1235
|
+
theCache = {};
|
|
1236
|
+
try {
|
|
1237
|
+
if (_canAcceptData(target)) {
|
|
1238
|
+
objDefine(target, data.id, {
|
|
1239
|
+
e: false,
|
|
1240
|
+
v: theCache
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
catch (e) {
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
return theCache;
|
|
1248
|
+
}
|
|
1226
1249
|
function createUniqueNamespace(name, includeVersion) {
|
|
1227
1250
|
if (includeVersion === void 0) { includeVersion = false; }
|
|
1228
1251
|
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName);
|
|
1229
1252
|
}
|
|
1253
|
+
function createElmNodeData(name) {
|
|
1254
|
+
var data = {
|
|
1255
|
+
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version),
|
|
1256
|
+
accept: function (target) {
|
|
1257
|
+
return _canAcceptData(target);
|
|
1258
|
+
},
|
|
1259
|
+
get: function (target, name, defValue, addDefault) {
|
|
1260
|
+
var theCache = target[data.id];
|
|
1261
|
+
if (!theCache) {
|
|
1262
|
+
if (addDefault) {
|
|
1263
|
+
theCache = _getCache(data, target);
|
|
1264
|
+
theCache[normalizeJsName(name)] = defValue;
|
|
1265
|
+
}
|
|
1266
|
+
return defValue;
|
|
1267
|
+
}
|
|
1268
|
+
return theCache[normalizeJsName(name)];
|
|
1269
|
+
},
|
|
1270
|
+
kill: function (target, name) {
|
|
1271
|
+
if (target && target[name]) {
|
|
1272
|
+
try {
|
|
1273
|
+
delete target[name];
|
|
1274
|
+
}
|
|
1275
|
+
catch (e) {
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
return data;
|
|
1281
|
+
}
|
|
1230
1282
|
|
|
1231
1283
|
function _isConfigDefaults(value) {
|
|
1232
1284
|
return (value && isObject(value) && (value.isVal || value.fb || objHasOwn(value, "v") || objHasOwn(value, "mrg") || objHasOwn(value, "ref") || value.set));
|
|
@@ -1449,7 +1501,7 @@
|
|
|
1449
1501
|
trk: function (handler) {
|
|
1450
1502
|
if (handler && handler.fn) {
|
|
1451
1503
|
if (arrIndexOf(detail.h, handler) === -1) {
|
|
1452
|
-
detail.h[_DYN_PUSH ](handler);
|
|
1504
|
+
detail.h[_DYN_PUSH$1 ](handler);
|
|
1453
1505
|
}
|
|
1454
1506
|
state.trk(handler, detail);
|
|
1455
1507
|
}
|
|
@@ -1661,7 +1713,7 @@
|
|
|
1661
1713
|
_useHandler(handler, handler.fn);
|
|
1662
1714
|
}
|
|
1663
1715
|
catch (e) {
|
|
1664
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
1716
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
1665
1717
|
}
|
|
1666
1718
|
}
|
|
1667
1719
|
}
|
|
@@ -1671,7 +1723,7 @@
|
|
|
1671
1723
|
_notifyWatchers();
|
|
1672
1724
|
}
|
|
1673
1725
|
catch (e) {
|
|
1674
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
1726
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
1675
1727
|
}
|
|
1676
1728
|
}
|
|
1677
1729
|
if (watcherFailures_1[_DYN_LENGTH$1 ] > 0) {
|
|
@@ -1693,7 +1745,7 @@
|
|
|
1693
1745
|
for (var idx = 0; idx < detail.h[_DYN_LENGTH$1 ]; idx++) {
|
|
1694
1746
|
var handler = detail.h[idx];
|
|
1695
1747
|
if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {
|
|
1696
|
-
_waitingHandlers[_DYN_PUSH ](handler);
|
|
1748
|
+
_waitingHandlers[_DYN_PUSH$1 ](handler);
|
|
1697
1749
|
}
|
|
1698
1750
|
}
|
|
1699
1751
|
}
|
|
@@ -1702,7 +1754,7 @@
|
|
|
1702
1754
|
if (handler) {
|
|
1703
1755
|
var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];
|
|
1704
1756
|
if (arrIndexOf(details, detail) === -1) {
|
|
1705
|
-
details[_DYN_PUSH ](detail);
|
|
1757
|
+
details[_DYN_PUSH$1 ](detail);
|
|
1706
1758
|
}
|
|
1707
1759
|
}
|
|
1708
1760
|
}
|
|
@@ -1990,14 +2042,14 @@
|
|
|
1990
2042
|
}
|
|
1991
2043
|
if (logMessage) {
|
|
1992
2044
|
if (severity <= _loggingLevelTelemetry) {
|
|
1993
|
-
_self.queue[_DYN_PUSH ](message);
|
|
2045
|
+
_self.queue[_DYN_PUSH$1 ](message);
|
|
1994
2046
|
_messageCount++;
|
|
1995
2047
|
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
1996
2048
|
}
|
|
1997
2049
|
if (_messageCount === _maxInternalMessageLimit) {
|
|
1998
2050
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
1999
2051
|
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
2000
|
-
_self.queue[_DYN_PUSH ](throttleMessage);
|
|
2052
|
+
_self.queue[_DYN_PUSH$1 ](throttleMessage);
|
|
2001
2053
|
if (severity === 1 ) {
|
|
2002
2054
|
_self.errorToConsole(throttleLimitMessage);
|
|
2003
2055
|
}
|
|
@@ -2169,6 +2221,180 @@
|
|
|
2169
2221
|
return traceParent;
|
|
2170
2222
|
}
|
|
2171
2223
|
|
|
2224
|
+
var strOnPrefix = "on";
|
|
2225
|
+
var strAttachEvent = "attachEvent";
|
|
2226
|
+
var strAddEventHelper = "addEventListener";
|
|
2227
|
+
var strDetachEvent = "detachEvent";
|
|
2228
|
+
var strRemoveEventListener = "removeEventListener";
|
|
2229
|
+
var strEvents = "events";
|
|
2230
|
+
createUniqueNamespace("aiEvtPageHide");
|
|
2231
|
+
createUniqueNamespace("aiEvtPageShow");
|
|
2232
|
+
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
2233
|
+
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
2234
|
+
var _guid = 1;
|
|
2235
|
+
var elmNodeData = createElmNodeData("events");
|
|
2236
|
+
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
2237
|
+
function _normalizeNamespace(name) {
|
|
2238
|
+
if (name && name[_DYN_REPLACE ]) {
|
|
2239
|
+
return name[_DYN_REPLACE ](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g, STR_EMPTY);
|
|
2240
|
+
}
|
|
2241
|
+
return name;
|
|
2242
|
+
}
|
|
2243
|
+
function _getEvtNamespace(eventName, evtNamespace) {
|
|
2244
|
+
var _a;
|
|
2245
|
+
if (evtNamespace) {
|
|
2246
|
+
var theNamespace_1 = STR_EMPTY;
|
|
2247
|
+
if (isArray(evtNamespace)) {
|
|
2248
|
+
theNamespace_1 = STR_EMPTY;
|
|
2249
|
+
arrForEach(evtNamespace, function (name) {
|
|
2250
|
+
name = _normalizeNamespace(name);
|
|
2251
|
+
if (name) {
|
|
2252
|
+
if (name[0] !== ".") {
|
|
2253
|
+
name = "." + name;
|
|
2254
|
+
}
|
|
2255
|
+
theNamespace_1 += name;
|
|
2256
|
+
}
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
else {
|
|
2260
|
+
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
2261
|
+
}
|
|
2262
|
+
if (theNamespace_1) {
|
|
2263
|
+
if (theNamespace_1[0] !== ".") {
|
|
2264
|
+
theNamespace_1 = "." + theNamespace_1;
|
|
2265
|
+
}
|
|
2266
|
+
eventName = (eventName || STR_EMPTY) + theNamespace_1;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY) || []);
|
|
2270
|
+
return _a = {},
|
|
2271
|
+
_a[_DYN_TYPE ] = parsedEvent[1],
|
|
2272
|
+
_a.ns = ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY)[_DYN_SPLIT$1 ](".").sort()).join("."),
|
|
2273
|
+
_a;
|
|
2274
|
+
}
|
|
2275
|
+
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
2276
|
+
if (addDefault === void 0) { addDefault = true; }
|
|
2277
|
+
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
2278
|
+
var registeredEvents = aiEvts[evtName];
|
|
2279
|
+
if (!registeredEvents) {
|
|
2280
|
+
registeredEvents = aiEvts[evtName] = [];
|
|
2281
|
+
}
|
|
2282
|
+
return registeredEvents;
|
|
2283
|
+
}
|
|
2284
|
+
function _doDetach(obj, evtName, handlerRef, useCapture) {
|
|
2285
|
+
if (obj && evtName && evtName[_DYN_TYPE ]) {
|
|
2286
|
+
if (obj[strRemoveEventListener]) {
|
|
2287
|
+
obj[strRemoveEventListener](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
2288
|
+
}
|
|
2289
|
+
else if (obj[strDetachEvent]) {
|
|
2290
|
+
obj[strDetachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
2295
|
+
var result = false;
|
|
2296
|
+
if (obj && evtName && evtName[_DYN_TYPE ] && handlerRef) {
|
|
2297
|
+
if (obj[strAddEventHelper]) {
|
|
2298
|
+
obj[strAddEventHelper](evtName[_DYN_TYPE ], handlerRef, useCapture);
|
|
2299
|
+
result = true;
|
|
2300
|
+
}
|
|
2301
|
+
else if (obj[strAttachEvent]) {
|
|
2302
|
+
obj[strAttachEvent](strOnPrefix + evtName[_DYN_TYPE ], handlerRef);
|
|
2303
|
+
result = true;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
return result;
|
|
2307
|
+
}
|
|
2308
|
+
function _doUnregister(target, events, evtName, unRegFn) {
|
|
2309
|
+
var idx = events[_DYN_LENGTH$1 ];
|
|
2310
|
+
while (idx--) {
|
|
2311
|
+
var theEvent = events[idx];
|
|
2312
|
+
if (theEvent) {
|
|
2313
|
+
if (!evtName.ns || evtName.ns === theEvent.evtName.ns) {
|
|
2314
|
+
if (!unRegFn || unRegFn(theEvent)) {
|
|
2315
|
+
_doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture);
|
|
2316
|
+
events[_DYN_SPLICE ](idx, 1);
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
function _unregisterEvents(target, evtName, unRegFn) {
|
|
2323
|
+
if (evtName[_DYN_TYPE ]) {
|
|
2324
|
+
_doUnregister(target, _getRegisteredEvents(target, evtName[_DYN_TYPE ]), evtName, unRegFn);
|
|
2325
|
+
}
|
|
2326
|
+
else {
|
|
2327
|
+
var eventCache = elmNodeData.get(target, strEvents, {});
|
|
2328
|
+
objForEachKey(eventCache, function (evtType, events) {
|
|
2329
|
+
_doUnregister(target, events, evtName, unRegFn);
|
|
2330
|
+
});
|
|
2331
|
+
if (objKeys(eventCache)[_DYN_LENGTH$1 ] === 0) {
|
|
2332
|
+
elmNodeData.kill(target, strEvents);
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
function mergeEvtNamespace(theNamespace, namespaces) {
|
|
2337
|
+
var newNamespaces;
|
|
2338
|
+
if (namespaces) {
|
|
2339
|
+
if (isArray(namespaces)) {
|
|
2340
|
+
newNamespaces = [theNamespace].concat(namespaces);
|
|
2341
|
+
}
|
|
2342
|
+
else {
|
|
2343
|
+
newNamespaces = [theNamespace, namespaces];
|
|
2344
|
+
}
|
|
2345
|
+
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT$1 ](".");
|
|
2346
|
+
}
|
|
2347
|
+
else {
|
|
2348
|
+
newNamespaces = theNamespace;
|
|
2349
|
+
}
|
|
2350
|
+
return newNamespaces;
|
|
2351
|
+
}
|
|
2352
|
+
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2353
|
+
var _a;
|
|
2354
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2355
|
+
var result = false;
|
|
2356
|
+
if (target) {
|
|
2357
|
+
try {
|
|
2358
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
2359
|
+
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
2360
|
+
if (result && elmNodeData.accept(target)) {
|
|
2361
|
+
var registeredEvent = (_a = {
|
|
2362
|
+
guid: _guid++,
|
|
2363
|
+
evtName: evtName
|
|
2364
|
+
},
|
|
2365
|
+
_a[_DYN_HANDLER ] = handlerRef,
|
|
2366
|
+
_a.capture = useCapture,
|
|
2367
|
+
_a);
|
|
2368
|
+
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH$1 ](registeredEvent);
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
catch (e) {
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
return result;
|
|
2375
|
+
}
|
|
2376
|
+
function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2377
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
2378
|
+
if (target) {
|
|
2379
|
+
try {
|
|
2380
|
+
var evtName_1 = _getEvtNamespace(eventName, evtNamespace);
|
|
2381
|
+
var found_1 = false;
|
|
2382
|
+
_unregisterEvents(target, evtName_1, function (regEvent) {
|
|
2383
|
+
if ((evtName_1.ns && !handlerRef) || regEvent[_DYN_HANDLER ] === handlerRef) {
|
|
2384
|
+
found_1 = true;
|
|
2385
|
+
return true;
|
|
2386
|
+
}
|
|
2387
|
+
return false;
|
|
2388
|
+
});
|
|
2389
|
+
if (!found_1) {
|
|
2390
|
+
_doDetach(target, evtName_1, handlerRef, useCapture);
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
catch (e) {
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2172
2398
|
var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
2173
2399
|
var SampleRate = "sampleRate";
|
|
2174
2400
|
var ProcessLegacy = "ProcessLegacy";
|
|
@@ -2195,6 +2421,7 @@
|
|
|
2195
2421
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
2196
2422
|
var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
|
|
2197
2423
|
var _DYN_TO_STRING = "toString";
|
|
2424
|
+
var _DYN_PUSH = "push";
|
|
2198
2425
|
var _DYN_REMOVE_ITEM = "removeItem";
|
|
2199
2426
|
var _DYN_NAME = "name";
|
|
2200
2427
|
var _DYN_MESSAGE = "message";
|
|
@@ -2686,7 +2913,7 @@
|
|
|
2686
2913
|
var keys = [];
|
|
2687
2914
|
if (utlCanUseSessionStorage()) {
|
|
2688
2915
|
objForEachKey(getInst("sessionStorage"), function (key) {
|
|
2689
|
-
keys
|
|
2916
|
+
keys[_DYN_PUSH ](key);
|
|
2690
2917
|
});
|
|
2691
2918
|
}
|
|
2692
2919
|
return keys;
|
|
@@ -2846,7 +3073,7 @@
|
|
|
2846
3073
|
else {
|
|
2847
3074
|
if (!!saveUnsentMsg) {
|
|
2848
3075
|
var queue = _getQueueByKey(msgID);
|
|
2849
|
-
queue
|
|
3076
|
+
queue[_DYN_PUSH ]({
|
|
2850
3077
|
msgID: msgID,
|
|
2851
3078
|
message: message,
|
|
2852
3079
|
severity: severity
|
|
@@ -3225,7 +3452,7 @@
|
|
|
3225
3452
|
entry += "@" + lines[lp + 1];
|
|
3226
3453
|
lp++;
|
|
3227
3454
|
}
|
|
3228
|
-
stack
|
|
3455
|
+
stack[_DYN_PUSH ](entry);
|
|
3229
3456
|
}
|
|
3230
3457
|
return {
|
|
3231
3458
|
src: errorMessage,
|
|
@@ -3308,7 +3535,7 @@
|
|
|
3308
3535
|
if (_StackFrame.regex.test(theFrame)) {
|
|
3309
3536
|
var parsedFrame = new _StackFrame(theFrame, level_1++);
|
|
3310
3537
|
totalSizeInBytes_1 += parsedFrame[_DYN_SIZE_IN_BYTES ];
|
|
3311
|
-
parsedStack
|
|
3538
|
+
parsedStack[_DYN_PUSH ](parsedFrame);
|
|
3312
3539
|
}
|
|
3313
3540
|
});
|
|
3314
3541
|
var exceptionParsedStackThreshold = 32 * 1024;
|
|
@@ -3996,6 +4223,122 @@
|
|
|
3996
4223
|
return event;
|
|
3997
4224
|
}
|
|
3998
4225
|
|
|
4226
|
+
function _disableEvents(target, evtNamespace) {
|
|
4227
|
+
eventOff(target, null, null, evtNamespace);
|
|
4228
|
+
}
|
|
4229
|
+
function createOfflineListener(parentEvtNamespace) {
|
|
4230
|
+
var _document = getDocument();
|
|
4231
|
+
var _navigator = getNavigator();
|
|
4232
|
+
var _isListening = false;
|
|
4233
|
+
var listenerList = [];
|
|
4234
|
+
var rState = 1 ;
|
|
4235
|
+
if (_navigator && !isNullOrUndefined(_navigator.onLine) && !_navigator.onLine) {
|
|
4236
|
+
rState = 2 ;
|
|
4237
|
+
}
|
|
4238
|
+
var uState = 0 ;
|
|
4239
|
+
var _currentState = calCurrentState();
|
|
4240
|
+
var _evtNamespace = mergeEvtNamespace(createUniqueNamespace("OfflineListener"), parentEvtNamespace);
|
|
4241
|
+
try {
|
|
4242
|
+
if (_enableEvents(getWindow())) {
|
|
4243
|
+
_isListening = true;
|
|
4244
|
+
}
|
|
4245
|
+
if (_document) {
|
|
4246
|
+
var target = _document.body || _document;
|
|
4247
|
+
if (target.ononline) {
|
|
4248
|
+
if (_enableEvents(target)) {
|
|
4249
|
+
_isListening = true;
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
4254
|
+
catch (e) {
|
|
4255
|
+
_isListening = false;
|
|
4256
|
+
}
|
|
4257
|
+
function _enableEvents(target) {
|
|
4258
|
+
var enabled = false;
|
|
4259
|
+
if (target) {
|
|
4260
|
+
enabled = eventOn(target, "online", _setOnline, _evtNamespace);
|
|
4261
|
+
if (enabled) {
|
|
4262
|
+
eventOn(target, "offline", _setOffline, _evtNamespace);
|
|
4263
|
+
}
|
|
4264
|
+
}
|
|
4265
|
+
return enabled;
|
|
4266
|
+
}
|
|
4267
|
+
function _isOnline() {
|
|
4268
|
+
return _currentState;
|
|
4269
|
+
}
|
|
4270
|
+
function calCurrentState() {
|
|
4271
|
+
if (uState === 2 || rState === 2 ) {
|
|
4272
|
+
return false;
|
|
4273
|
+
}
|
|
4274
|
+
return true;
|
|
4275
|
+
}
|
|
4276
|
+
function listnerNoticeCheck() {
|
|
4277
|
+
var newState = calCurrentState();
|
|
4278
|
+
if (_currentState !== newState) {
|
|
4279
|
+
_currentState = newState;
|
|
4280
|
+
arrForEach(listenerList, function (callback) {
|
|
4281
|
+
var offlineState = {
|
|
4282
|
+
isOnline: _currentState,
|
|
4283
|
+
rState: rState,
|
|
4284
|
+
uState: uState
|
|
4285
|
+
};
|
|
4286
|
+
try {
|
|
4287
|
+
callback(offlineState);
|
|
4288
|
+
}
|
|
4289
|
+
catch (e) {
|
|
4290
|
+
}
|
|
4291
|
+
});
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
function setOnlineState(newState) {
|
|
4295
|
+
uState = newState;
|
|
4296
|
+
listnerNoticeCheck();
|
|
4297
|
+
}
|
|
4298
|
+
function _setOnline() {
|
|
4299
|
+
rState = 1 ;
|
|
4300
|
+
listnerNoticeCheck();
|
|
4301
|
+
}
|
|
4302
|
+
function _setOffline() {
|
|
4303
|
+
rState = 2 ;
|
|
4304
|
+
listnerNoticeCheck();
|
|
4305
|
+
}
|
|
4306
|
+
function _unload() {
|
|
4307
|
+
var win = getWindow();
|
|
4308
|
+
if (win && _isListening) {
|
|
4309
|
+
_disableEvents(win, _evtNamespace);
|
|
4310
|
+
if (_document) {
|
|
4311
|
+
var target = _document.body || _document;
|
|
4312
|
+
if (!isUndefined(target.ononline)) {
|
|
4313
|
+
_disableEvents(target, _evtNamespace);
|
|
4314
|
+
}
|
|
4315
|
+
}
|
|
4316
|
+
_isListening = false;
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
function addListener(callback) {
|
|
4320
|
+
listenerList[_DYN_PUSH ](callback);
|
|
4321
|
+
return {
|
|
4322
|
+
rm: function () {
|
|
4323
|
+
var index = listenerList.indexOf(callback);
|
|
4324
|
+
if (index > -1) {
|
|
4325
|
+
return listenerList.splice(index, 1);
|
|
4326
|
+
}
|
|
4327
|
+
else {
|
|
4328
|
+
return;
|
|
4329
|
+
}
|
|
4330
|
+
}
|
|
4331
|
+
};
|
|
4332
|
+
}
|
|
4333
|
+
return {
|
|
4334
|
+
isOnline: _isOnline,
|
|
4335
|
+
isListening: function () { return _isListening; },
|
|
4336
|
+
unload: _unload,
|
|
4337
|
+
addListener: addListener,
|
|
4338
|
+
setOnlineState: setOnlineState
|
|
4339
|
+
};
|
|
4340
|
+
}
|
|
4341
|
+
|
|
3999
4342
|
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
4000
4343
|
var BreezeChannelIdentifier = "AppInsightsChannelPlugin";
|
|
4001
4344
|
var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics";
|
|
@@ -4035,6 +4378,7 @@
|
|
|
4035
4378
|
exports.correlationIdSetPrefix = correlationIdSetPrefix;
|
|
4036
4379
|
exports.createDistributedTraceContextFromTrace = createDistributedTraceContextFromTrace;
|
|
4037
4380
|
exports.createDomEvent = createDomEvent;
|
|
4381
|
+
exports.createOfflineListener = createOfflineListener;
|
|
4038
4382
|
exports.createTelemetryItem = createTelemetryItem;
|
|
4039
4383
|
exports.createTraceParent = createTraceParent;
|
|
4040
4384
|
exports.dataSanitizeException = dataSanitizeException;
|