@microsoft/applicationinsights-dependencies-js 2.8.0-beta.2203-08 → 2.8.0-beta.2203-11
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/applicationinsights-dependencies-js.integrity.json +9 -9
- package/browser/applicationinsights-dependencies-js.js +159 -113
- package/browser/applicationinsights-dependencies-js.js.map +1 -1
- package/browser/applicationinsights-dependencies-js.min.js +2 -2
- package/browser/applicationinsights-dependencies-js.min.js.map +1 -1
- package/dist/applicationinsights-dependencies-js.api.json +1 -1
- package/dist/applicationinsights-dependencies-js.d.ts +1 -1
- package/dist/applicationinsights-dependencies-js.js +159 -113
- package/dist/applicationinsights-dependencies-js.js.map +1 -1
- package/dist/applicationinsights-dependencies-js.min.js +2 -2
- package/dist/applicationinsights-dependencies-js.min.js.map +1 -1
- package/dist/applicationinsights-dependencies-js.rollup.d.ts +1 -1
- package/dist-esm/TraceParent.js +1 -1
- package/dist-esm/ajax.js +149 -111
- package/dist-esm/ajax.js.map +1 -1
- package/dist-esm/ajaxRecord.js +1 -1
- package/dist-esm/ajaxUtils.js +1 -1
- package/dist-esm/applicationinsights-dependencies-js.js +1 -1
- package/package.json +4 -4
- package/src/ajax.ts +175 -125
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights XHR dependencies plugin, 2.8.0-beta.2203-
|
|
2
|
+
* Microsoft Application Insights XHR dependencies plugin, 2.8.0-beta.2203-11
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
package/dist-esm/TraceParent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Dependencies Plugin, 2.8.0-beta.2203-
|
|
2
|
+
* Application Insights JavaScript SDK - Dependencies Plugin, 2.8.0-beta.2203-11
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import { generateW3CId } from "@microsoft/applicationinsights-core-js";
|
package/dist-esm/ajax.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Dependencies Plugin, 2.8.0-beta.2203-
|
|
2
|
+
* Application Insights JavaScript SDK - Dependencies Plugin, 2.8.0-beta.2203-11
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
import { __assignFn as __assign, __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
|
8
8
|
import { RequestHeaders, CorrelationIdHelper, TelemetryItemCreator, RemoteDependencyData, dateTimeUtilsNow, DisabledPropertyName, PropertiesPluginIdentifier, isInternalApplicationInsightsEndpoint } from "@microsoft/applicationinsights-common";
|
|
9
|
-
import { isNullOrUndefined, arrForEach, isString, strTrim, isFunction, LoggingSeverity, _InternalMessageId, BaseTelemetryPlugin, getLocation, getGlobal, strPrototype, InstrumentFunc, InstrumentProto, getPerformance, objForEachKey, generateW3CId, getIEVersion, dumpObj, isXhrSupported, eventOn, mergeEvtNamespace, createUniqueNamespace } from "@microsoft/applicationinsights-core-js";
|
|
9
|
+
import { isNullOrUndefined, arrForEach, isString, strTrim, isFunction, LoggingSeverity, _InternalMessageId, BaseTelemetryPlugin, getLocation, getGlobal, strPrototype, InstrumentFunc, InstrumentProto, getPerformance, objForEachKey, generateW3CId, getIEVersion, dumpObj, isXhrSupported, eventOn, mergeEvtNamespace, createUniqueNamespace, createProcessTelemetryContext } from "@microsoft/applicationinsights-core-js";
|
|
10
10
|
import { ajaxRecord } from "./ajaxRecord";
|
|
11
11
|
import { Traceparent } from "./TraceParent";
|
|
12
12
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
@@ -15,6 +15,7 @@ var strDiagLog = "diagLog";
|
|
|
15
15
|
var strAjaxData = "ajaxData";
|
|
16
16
|
var strThrowInternal = "throwInternal";
|
|
17
17
|
var strFetch = "fetch";
|
|
18
|
+
var strTrackDependencyDataInternal = "trackDependencyDataInternal"; // Using string to help with minification
|
|
18
19
|
// Using a global value so that to handle same iKey with multiple app insights instances (mostly for testing)
|
|
19
20
|
var _markCount = 0;
|
|
20
21
|
/** @Ignore */
|
|
@@ -110,77 +111,41 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
110
111
|
var _this = _super.call(this) || this;
|
|
111
112
|
_this.identifier = AjaxMonitor.identifier;
|
|
112
113
|
_this.priority = 120;
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var _enableAjaxErrorStatusText = false;
|
|
121
|
-
var _trackAjaxAttempts = 0;
|
|
114
|
+
var _fetchInitialized; // fetch monitoring initialized
|
|
115
|
+
var _xhrInitialized; // XHR monitoring initialized
|
|
116
|
+
var _currentWindowHost;
|
|
117
|
+
var _config;
|
|
118
|
+
var _enableRequestHeaderTracking;
|
|
119
|
+
var _enableAjaxErrorStatusText;
|
|
120
|
+
var _trackAjaxAttempts;
|
|
122
121
|
var _context;
|
|
123
122
|
var _isUsingW3CHeaders;
|
|
124
123
|
var _isUsingAIHeaders;
|
|
125
124
|
var _markPrefix;
|
|
126
|
-
var _enableAjaxPerfTracking
|
|
127
|
-
var _maxAjaxCallsPerView
|
|
128
|
-
var _enableResponseHeaderTracking
|
|
129
|
-
var _disabledUrls
|
|
125
|
+
var _enableAjaxPerfTracking;
|
|
126
|
+
var _maxAjaxCallsPerView;
|
|
127
|
+
var _enableResponseHeaderTracking;
|
|
128
|
+
var _disabledUrls;
|
|
129
|
+
var _disableAjaxTracking;
|
|
130
|
+
var _disableFetchTracking;
|
|
130
131
|
var _excludeRequestFromAutoTrackingPatterns;
|
|
131
132
|
var _addRequestContext;
|
|
132
133
|
var _evtNamespace;
|
|
133
134
|
dynamicProto(AjaxMonitor, _this, function (_self, _base) {
|
|
134
135
|
var _addHook = _base._addHook;
|
|
136
|
+
_initDefaults();
|
|
135
137
|
_self.initialize = function (config, core, extensions, pluginChain) {
|
|
136
138
|
if (!_self.isInitialized()) {
|
|
137
139
|
_base.initialize(config, core, extensions, pluginChain);
|
|
138
|
-
var ctx_1 = _self._getTelCtx();
|
|
139
|
-
var defaultConfig = AjaxMonitor.getDefaultConfig();
|
|
140
|
-
objForEachKey(defaultConfig, function (field, value) {
|
|
141
|
-
_config[field] = ctx_1.getConfig(AjaxMonitor.identifier, field, value);
|
|
142
|
-
});
|
|
143
140
|
_evtNamespace = mergeEvtNamespace(createUniqueNamespace("ajax"), core && core.evtNamespace && core.evtNamespace());
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
_enableAjaxErrorStatusText = _config.enableAjaxErrorStatusText;
|
|
147
|
-
_enableAjaxPerfTracking = _config.enableAjaxPerfTracking;
|
|
148
|
-
_maxAjaxCallsPerView = _config.maxAjaxCallsPerView;
|
|
149
|
-
_enableResponseHeaderTracking = _config.enableResponseHeaderTracking;
|
|
150
|
-
_excludeRequestFromAutoTrackingPatterns = _config.excludeRequestFromAutoTrackingPatterns;
|
|
151
|
-
_addRequestContext = _config.addRequestContext;
|
|
152
|
-
_isUsingAIHeaders = distributedTracingMode === 0 /* AI */ || distributedTracingMode === 1 /* AI_AND_W3C */;
|
|
153
|
-
_isUsingW3CHeaders = distributedTracingMode === 1 /* AI_AND_W3C */ || distributedTracingMode === 2 /* W3C */;
|
|
154
|
-
if (_enableAjaxPerfTracking) {
|
|
155
|
-
var iKey = config.instrumentationKey || "unkwn";
|
|
156
|
-
if (iKey.length > 5) {
|
|
157
|
-
_markPrefix = AJAX_MONITOR_PREFIX + iKey.substring(iKey.length - 5) + ".";
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
_markPrefix = AJAX_MONITOR_PREFIX + iKey + ".";
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (_config.disableAjaxTracking === false) {
|
|
164
|
-
_instrumentXhr();
|
|
165
|
-
}
|
|
141
|
+
_populateDefaults(config);
|
|
142
|
+
_instrumentXhr();
|
|
166
143
|
_instrumentFetch();
|
|
167
|
-
|
|
168
|
-
var propExt = void 0, extIx = 0;
|
|
169
|
-
while (!propExt && extIx < extensions.length) {
|
|
170
|
-
if (extensions[extIx] && extensions[extIx].identifier === PropertiesPluginIdentifier) {
|
|
171
|
-
propExt = extensions[extIx];
|
|
172
|
-
}
|
|
173
|
-
extIx++;
|
|
174
|
-
}
|
|
175
|
-
if (propExt) {
|
|
176
|
-
_context = propExt.context; // we could move IPropertiesPlugin to common as well
|
|
177
|
-
}
|
|
178
|
-
}
|
|
144
|
+
_populateContext();
|
|
179
145
|
}
|
|
180
146
|
};
|
|
181
147
|
_self._doTeardown = function () {
|
|
182
|
-
|
|
183
|
-
_xhrInitialized = false;
|
|
148
|
+
_initDefaults();
|
|
184
149
|
};
|
|
185
150
|
_self.trackDependencyData = function (dependency, properties) {
|
|
186
151
|
_self[strTrackDependencyDataInternal](dependency, properties);
|
|
@@ -270,6 +235,65 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
270
235
|
}
|
|
271
236
|
++_trackAjaxAttempts;
|
|
272
237
|
};
|
|
238
|
+
function _initDefaults() {
|
|
239
|
+
var location = getLocation();
|
|
240
|
+
_fetchInitialized = false; // fetch monitoring initialized
|
|
241
|
+
_xhrInitialized = false; // XHR monitoring initialized
|
|
242
|
+
_currentWindowHost = location && location.host && location.host.toLowerCase();
|
|
243
|
+
_config = AjaxMonitor.getEmptyConfig();
|
|
244
|
+
_enableRequestHeaderTracking = false;
|
|
245
|
+
_enableAjaxErrorStatusText = false;
|
|
246
|
+
_trackAjaxAttempts = 0;
|
|
247
|
+
_context = null;
|
|
248
|
+
_isUsingW3CHeaders = false;
|
|
249
|
+
_isUsingAIHeaders = false;
|
|
250
|
+
_markPrefix = null;
|
|
251
|
+
_enableAjaxPerfTracking = false;
|
|
252
|
+
_maxAjaxCallsPerView = 0;
|
|
253
|
+
_enableResponseHeaderTracking = false;
|
|
254
|
+
_disabledUrls = {};
|
|
255
|
+
_disableAjaxTracking = false;
|
|
256
|
+
_disableFetchTracking = true;
|
|
257
|
+
_excludeRequestFromAutoTrackingPatterns = null;
|
|
258
|
+
_addRequestContext = null;
|
|
259
|
+
_evtNamespace = null;
|
|
260
|
+
}
|
|
261
|
+
function _populateDefaults(config) {
|
|
262
|
+
var ctx = createProcessTelemetryContext(null, config, _self.core);
|
|
263
|
+
// Reset to the empty config
|
|
264
|
+
_config = AjaxMonitor.getEmptyConfig();
|
|
265
|
+
var defaultConfig = AjaxMonitor.getDefaultConfig();
|
|
266
|
+
objForEachKey(defaultConfig, function (field, value) {
|
|
267
|
+
_config[field] = ctx.getConfig(AjaxMonitor.identifier, field, value);
|
|
268
|
+
});
|
|
269
|
+
var distributedTracingMode = _config.distributedTracingMode;
|
|
270
|
+
_enableRequestHeaderTracking = _config.enableRequestHeaderTracking;
|
|
271
|
+
_enableAjaxErrorStatusText = _config.enableAjaxErrorStatusText;
|
|
272
|
+
_enableAjaxPerfTracking = _config.enableAjaxPerfTracking;
|
|
273
|
+
_maxAjaxCallsPerView = _config.maxAjaxCallsPerView;
|
|
274
|
+
_enableResponseHeaderTracking = _config.enableResponseHeaderTracking;
|
|
275
|
+
_excludeRequestFromAutoTrackingPatterns = _config.excludeRequestFromAutoTrackingPatterns;
|
|
276
|
+
_addRequestContext = _config.addRequestContext;
|
|
277
|
+
_isUsingAIHeaders = distributedTracingMode === 0 /* AI */ || distributedTracingMode === 1 /* AI_AND_W3C */;
|
|
278
|
+
_isUsingW3CHeaders = distributedTracingMode === 1 /* AI_AND_W3C */ || distributedTracingMode === 2 /* W3C */;
|
|
279
|
+
if (_enableAjaxPerfTracking) {
|
|
280
|
+
var iKey = config.instrumentationKey || "unkwn";
|
|
281
|
+
if (iKey.length > 5) {
|
|
282
|
+
_markPrefix = AJAX_MONITOR_PREFIX + iKey.substring(iKey.length - 5) + ".";
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
_markPrefix = AJAX_MONITOR_PREFIX + iKey + ".";
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
_disableAjaxTracking = !!_config.disableAjaxTracking;
|
|
289
|
+
_disableFetchTracking = !!_config.disableFetchTracking;
|
|
290
|
+
}
|
|
291
|
+
function _populateContext() {
|
|
292
|
+
var propExt = _self.core.getPlugin(PropertiesPluginIdentifier);
|
|
293
|
+
if (propExt) {
|
|
294
|
+
_context = propExt.plugin.context; // we could move IPropertiesPlugin to common as well
|
|
295
|
+
}
|
|
296
|
+
}
|
|
273
297
|
// discard the header if it's defined as ignoreHeaders in ICorrelationConfig
|
|
274
298
|
function _canIncludeHeaders(header) {
|
|
275
299
|
var rlt = true;
|
|
@@ -291,12 +315,13 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
291
315
|
}
|
|
292
316
|
var global = getGlobal();
|
|
293
317
|
var isPolyfill = fetch.polyfill;
|
|
294
|
-
if (
|
|
318
|
+
if (!_disableFetchTracking && !_fetchInitialized) {
|
|
295
319
|
_addHook(InstrumentFunc(global, strFetch, {
|
|
320
|
+
ns: _evtNamespace,
|
|
296
321
|
// Add request hook
|
|
297
322
|
req: function (callDetails, input, init) {
|
|
298
323
|
var fetchData;
|
|
299
|
-
if (_fetchInitialized &&
|
|
324
|
+
if (!_disableFetchTracking && _fetchInitialized &&
|
|
300
325
|
!_isDisabledRequest(null, input, init) &&
|
|
301
326
|
// If we have a polyfil and XHR instrumented then let XHR report otherwise we get duplicates
|
|
302
327
|
!(isPolyfill && _xhrInitialized)) {
|
|
@@ -310,32 +335,34 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
310
335
|
}
|
|
311
336
|
},
|
|
312
337
|
rsp: function (callDetails, input) {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
338
|
+
if (!_disableFetchTracking) {
|
|
339
|
+
var fetchData_1 = callDetails.ctx().data;
|
|
340
|
+
if (fetchData_1) {
|
|
341
|
+
// Replace the result with the new promise from this code
|
|
342
|
+
callDetails.rslt = callDetails.rslt.then(function (response) {
|
|
343
|
+
_reportFetchMetrics(callDetails, (response || {}).status, input, response, fetchData_1, function () {
|
|
344
|
+
var ajaxResponse = {
|
|
345
|
+
statusText: response.statusText,
|
|
346
|
+
headerMap: null,
|
|
347
|
+
correlationContext: _getFetchCorrelationContext(response)
|
|
348
|
+
};
|
|
349
|
+
if (_enableResponseHeaderTracking) {
|
|
350
|
+
var responseHeaderMap_1 = {};
|
|
351
|
+
response.headers.forEach(function (value, name) {
|
|
352
|
+
if (_canIncludeHeaders(name)) {
|
|
353
|
+
responseHeaderMap_1[name] = value;
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
ajaxResponse.headerMap = responseHeaderMap_1;
|
|
357
|
+
}
|
|
358
|
+
return ajaxResponse;
|
|
359
|
+
});
|
|
360
|
+
return response;
|
|
361
|
+
})["catch"](function (reason) {
|
|
362
|
+
_reportFetchMetrics(callDetails, 0, input, null, fetchData_1, null, { error: reason.message });
|
|
363
|
+
throw reason;
|
|
333
364
|
});
|
|
334
|
-
|
|
335
|
-
})["catch"](function (reason) {
|
|
336
|
-
_reportFetchMetrics(callDetails, 0, input, null, fetchData, null, { error: reason.message });
|
|
337
|
-
throw reason;
|
|
338
|
-
});
|
|
365
|
+
}
|
|
339
366
|
}
|
|
340
367
|
},
|
|
341
368
|
// Create an error callback to report any hook errors
|
|
@@ -351,6 +378,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
351
378
|
// the workaround is to add a polyfill property to your fetch implementation before initializing
|
|
352
379
|
// App Insights
|
|
353
380
|
_addHook(InstrumentFunc(global, strFetch, {
|
|
381
|
+
ns: _evtNamespace,
|
|
354
382
|
req: function (callDetails, input, init) {
|
|
355
383
|
// Just call so that we record any disabled URL
|
|
356
384
|
_isDisabledRequest(null, input, init);
|
|
@@ -367,61 +395,71 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
367
395
|
_addHook(InstrumentProto(target, funcName, callbacks));
|
|
368
396
|
}
|
|
369
397
|
function _instrumentXhr() {
|
|
370
|
-
if (_supportsAjaxMonitoring(_self) && !_xhrInitialized) {
|
|
398
|
+
if (_supportsAjaxMonitoring(_self) && !_disableAjaxTracking && !_xhrInitialized) {
|
|
371
399
|
// Instrument open
|
|
372
400
|
_hookProto(XMLHttpRequest, "open", {
|
|
401
|
+
ns: _evtNamespace,
|
|
373
402
|
req: function (args, method, url, async) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
if (!
|
|
378
|
-
|
|
379
|
-
|
|
403
|
+
if (!_disableAjaxTracking) {
|
|
404
|
+
var xhr = args.inst;
|
|
405
|
+
var ajaxData = xhr[strAjaxData];
|
|
406
|
+
if (!_isDisabledRequest(xhr, url) && _isMonitoredXhrInstance(xhr, true)) {
|
|
407
|
+
if (!ajaxData || !ajaxData.xhrMonitoringState.openDone) {
|
|
408
|
+
// Only create a single ajaxData (even when multiple AI instances are running)
|
|
409
|
+
_openHandler(xhr, method, url, async);
|
|
410
|
+
}
|
|
411
|
+
// always attach to the on ready state change (required for handling multiple instances)
|
|
412
|
+
_attachToOnReadyStateChange(xhr);
|
|
380
413
|
}
|
|
381
|
-
// always attach to the on ready state change (required for handling multiple instances)
|
|
382
|
-
_attachToOnReadyStateChange(xhr);
|
|
383
414
|
}
|
|
384
415
|
},
|
|
385
416
|
hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")
|
|
386
417
|
});
|
|
387
418
|
// Instrument send
|
|
388
419
|
_hookProto(XMLHttpRequest, "send", {
|
|
420
|
+
ns: _evtNamespace,
|
|
389
421
|
req: function (args, context) {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
422
|
+
if (!_disableAjaxTracking) {
|
|
423
|
+
var xhr = args.inst;
|
|
424
|
+
var ajaxData = xhr[strAjaxData];
|
|
425
|
+
if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState.sendDone) {
|
|
426
|
+
_createMarkId("xhr", ajaxData);
|
|
427
|
+
ajaxData.requestSentTime = dateTimeUtilsNow();
|
|
428
|
+
_self.includeCorrelationHeaders(ajaxData, undefined, undefined, xhr);
|
|
429
|
+
ajaxData.xhrMonitoringState.sendDone = true;
|
|
430
|
+
}
|
|
397
431
|
}
|
|
398
432
|
},
|
|
399
433
|
hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxSend, "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")
|
|
400
434
|
});
|
|
401
435
|
// Instrument abort
|
|
402
436
|
_hookProto(XMLHttpRequest, "abort", {
|
|
437
|
+
ns: _evtNamespace,
|
|
403
438
|
req: function (args) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
ajaxData.
|
|
408
|
-
|
|
439
|
+
if (!_disableAjaxTracking) {
|
|
440
|
+
var xhr = args.inst;
|
|
441
|
+
var ajaxData = xhr[strAjaxData];
|
|
442
|
+
if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState.abortDone) {
|
|
443
|
+
ajaxData.aborted = 1;
|
|
444
|
+
ajaxData.xhrMonitoringState.abortDone = true;
|
|
445
|
+
}
|
|
409
446
|
}
|
|
410
447
|
},
|
|
411
448
|
hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxAbort, "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")
|
|
412
449
|
});
|
|
413
450
|
// Instrument setRequestHeader
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
451
|
+
_hookProto(XMLHttpRequest, "setRequestHeader", {
|
|
452
|
+
ns: _evtNamespace,
|
|
453
|
+
req: function (args, header, value) {
|
|
454
|
+
if (!_disableAjaxTracking && _enableRequestHeaderTracking) {
|
|
417
455
|
var xhr = args.inst;
|
|
418
456
|
if (_isMonitoredXhrInstance(xhr) && _canIncludeHeaders(header)) {
|
|
419
457
|
xhr[strAjaxData].requestHeaders[header] = value;
|
|
420
458
|
}
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxSetRequestHeader, "Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")
|
|
462
|
+
});
|
|
425
463
|
_xhrInitialized = true;
|
|
426
464
|
}
|
|
427
465
|
}
|