@microsoft/applicationinsights-clickanalytics-js 2.8.0-beta.2203-01 → 2.8.0-beta.2203-04
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/{ai.clck.2.8.0-beta.2203-01.cjs.js → ai.clck.2.8.0-beta.2203-04.cjs.js} +663 -212
- package/browser/ai.clck.2.8.0-beta.2203-04.cjs.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-04.cjs.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-04.cjs.min.js.map +1 -0
- package/browser/{ai.clck.2.8.0-beta.2203-01.gbl.js → ai.clck.2.8.0-beta.2203-04.gbl.js} +663 -212
- package/browser/ai.clck.2.8.0-beta.2203-04.gbl.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-04.gbl.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-04.gbl.min.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-04.integrity.json +66 -0
- package/browser/{ai.clck.2.8.0-beta.2203-01.js → ai.clck.2.8.0-beta.2203-04.js} +663 -212
- package/browser/ai.clck.2.8.0-beta.2203-04.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-04.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-04.min.js.map +1 -0
- package/browser/ai.clck.2.cjs.js +662 -211
- package/browser/ai.clck.2.cjs.js.map +1 -1
- package/browser/ai.clck.2.cjs.min.js +2 -2
- package/browser/ai.clck.2.cjs.min.js.map +1 -1
- package/browser/ai.clck.2.gbl.js +662 -211
- package/browser/ai.clck.2.gbl.js.map +1 -1
- package/browser/ai.clck.2.gbl.min.js +2 -2
- package/browser/ai.clck.2.gbl.min.js.map +1 -1
- package/browser/ai.clck.2.js +662 -211
- package/browser/ai.clck.2.js.map +1 -1
- package/browser/ai.clck.2.min.js +2 -2
- package/browser/ai.clck.2.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.d.ts +1 -1
- package/dist/applicationinsights-clickanalytics-js.js +662 -211
- package/dist/applicationinsights-clickanalytics-js.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.min.js +2 -2
- package/dist/applicationinsights-clickanalytics-js.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.rollup.d.ts +1 -1
- package/dist-esm/Behaviours.js +1 -1
- package/dist-esm/ClickAnalyticsPlugin.js +2 -2
- package/dist-esm/ClickAnalyticsPlugin.js.map +1 -1
- package/dist-esm/DataCollector.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/Interfaces/Datamodel.js +1 -1
- package/dist-esm/applicationinsights-clickanalytics-js.js +1 -1
- package/dist-esm/common/Utils.js +1 -1
- package/dist-esm/events/PageAction.js +1 -1
- package/dist-esm/events/WebEvent.js +1 -1
- package/dist-esm/handlers/AutoCaptureHandler.js +1 -1
- package/dist-esm/handlers/DomContentHandler.js +1 -1
- package/package.json +4 -4
- package/src/ClickAnalyticsPlugin.ts +1 -1
- package/browser/ai.clck.2.8.0-beta.2203-01.cjs.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-01.cjs.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2203-01.cjs.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-01.gbl.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-01.gbl.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2203-01.gbl.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-01.integrity.json +0 -66
- package/browser/ai.clck.2.8.0-beta.2203-01.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-01.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2203-01.min.js.map +0 -1
package/browser/ai.clck.2.gbl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 2.8.0-beta.2203-
|
|
2
|
+
* Application Insights JavaScript SDK - Click Analytics, 2.8.0-beta.2203-04
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
this.Microsoft = this.Microsoft || {};
|
|
@@ -333,108 +333,26 @@ this.Microsoft = this.Microsoft || {};
|
|
|
333
333
|
};
|
|
334
334
|
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
335
335
|
|
|
336
|
-
var
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
var
|
|
342
|
-
|
|
343
|
-
BrowserCannotReadLocalStorage: 1,
|
|
344
|
-
BrowserCannotReadSessionStorage: 2,
|
|
345
|
-
BrowserCannotWriteLocalStorage: 3,
|
|
346
|
-
BrowserCannotWriteSessionStorage: 4,
|
|
347
|
-
BrowserFailedRemovalFromLocalStorage: 5,
|
|
348
|
-
BrowserFailedRemovalFromSessionStorage: 6,
|
|
349
|
-
CannotSendEmptyTelemetry: 7,
|
|
350
|
-
ClientPerformanceMathError: 8,
|
|
351
|
-
ErrorParsingAISessionCookie: 9,
|
|
352
|
-
ErrorPVCalc: 10,
|
|
353
|
-
ExceptionWhileLoggingError: 11,
|
|
354
|
-
FailedAddingTelemetryToBuffer: 12,
|
|
355
|
-
FailedMonitorAjaxAbort: 13,
|
|
356
|
-
FailedMonitorAjaxDur: 14,
|
|
357
|
-
FailedMonitorAjaxOpen: 15,
|
|
358
|
-
FailedMonitorAjaxRSC: 16,
|
|
359
|
-
FailedMonitorAjaxSend: 17,
|
|
360
|
-
FailedMonitorAjaxGetCorrelationHeader: 18,
|
|
361
|
-
FailedToAddHandlerForOnBeforeUnload: 19,
|
|
362
|
-
FailedToSendQueuedTelemetry: 20,
|
|
363
|
-
FailedToReportDataLoss: 21,
|
|
364
|
-
FlushFailed: 22,
|
|
365
|
-
MessageLimitPerPVExceeded: 23,
|
|
366
|
-
MissingRequiredFieldSpecification: 24,
|
|
367
|
-
NavigationTimingNotSupported: 25,
|
|
368
|
-
OnError: 26,
|
|
369
|
-
SessionRenewalDateIsZero: 27,
|
|
370
|
-
SenderNotInitialized: 28,
|
|
371
|
-
StartTrackEventFailed: 29,
|
|
372
|
-
StopTrackEventFailed: 30,
|
|
373
|
-
StartTrackFailed: 31,
|
|
374
|
-
StopTrackFailed: 32,
|
|
375
|
-
TelemetrySampledAndNotSent: 33,
|
|
376
|
-
TrackEventFailed: 34,
|
|
377
|
-
TrackExceptionFailed: 35,
|
|
378
|
-
TrackMetricFailed: 36,
|
|
379
|
-
TrackPVFailed: 37,
|
|
380
|
-
TrackPVFailedCalc: 38,
|
|
381
|
-
TrackTraceFailed: 39,
|
|
382
|
-
TransmissionFailed: 40,
|
|
383
|
-
FailedToSetStorageBuffer: 41,
|
|
384
|
-
FailedToRestoreStorageBuffer: 42,
|
|
385
|
-
InvalidBackendResponse: 43,
|
|
386
|
-
FailedToFixDepricatedValues: 44,
|
|
387
|
-
InvalidDurationValue: 45,
|
|
388
|
-
TelemetryEnvelopeInvalid: 46,
|
|
389
|
-
CreateEnvelopeError: 47,
|
|
390
|
-
CannotSerializeObject: 48,
|
|
391
|
-
CannotSerializeObjectNonSerializable: 49,
|
|
392
|
-
CircularReferenceDetected: 50,
|
|
393
|
-
ClearAuthContextFailed: 51,
|
|
394
|
-
ExceptionTruncated: 52,
|
|
395
|
-
IllegalCharsInName: 53,
|
|
396
|
-
ItemNotInArray: 54,
|
|
397
|
-
MaxAjaxPerPVExceeded: 55,
|
|
398
|
-
MessageTruncated: 56,
|
|
399
|
-
NameTooLong: 57,
|
|
400
|
-
SampleRateOutOfRange: 58,
|
|
401
|
-
SetAuthContextFailed: 59,
|
|
402
|
-
SetAuthContextFailedAccountName: 60,
|
|
403
|
-
StringValueTooLong: 61,
|
|
404
|
-
StartCalledMoreThanOnce: 62,
|
|
405
|
-
StopCalledWithoutStart: 63,
|
|
406
|
-
TelemetryInitializerFailed: 64,
|
|
407
|
-
TrackArgumentsNotSpecified: 65,
|
|
408
|
-
UrlTooLong: 66,
|
|
409
|
-
SessionStorageBufferFull: 67,
|
|
410
|
-
CannotAccessCookie: 68,
|
|
411
|
-
IdTooLong: 69,
|
|
412
|
-
InvalidEvent: 70,
|
|
413
|
-
FailedMonitorAjaxSetRequestHeader: 71,
|
|
414
|
-
SendBrowserInfoOnUserInit: 72,
|
|
415
|
-
PluginException: 73,
|
|
416
|
-
NotificationException: 74,
|
|
417
|
-
SnippetScriptLoadFailure: 99,
|
|
418
|
-
InvalidInstrumentationKey: 100,
|
|
419
|
-
CannotParseAiBlobValue: 101,
|
|
420
|
-
InvalidContentBlob: 102,
|
|
421
|
-
TrackPageActionEventFailed: 103,
|
|
422
|
-
FailedAddingCustomDefinedRequestContext: 104,
|
|
423
|
-
InMemoryStorageBufferFull: 105
|
|
424
|
-
};
|
|
336
|
+
var strEmpty = "";
|
|
337
|
+
var strSetNextPlugin = "setNextPlugin";
|
|
338
|
+
var strIsInitialized = "isInitialized";
|
|
339
|
+
var strTeardown = "teardown";
|
|
340
|
+
var strCore = "core";
|
|
341
|
+
var strDisabled = "disabled";
|
|
342
|
+
var strDoTeardown = "_doTeardown";
|
|
425
343
|
|
|
426
|
-
var strOnPrefix = "on";
|
|
427
|
-
var strAttachEvent = "attachEvent";
|
|
428
|
-
var strAddEventHelper = "addEventListener";
|
|
429
344
|
var strToString = "toString";
|
|
430
345
|
var str__Proto = "__proto__";
|
|
431
346
|
var strConstructor = "constructor";
|
|
432
|
-
var _objDefineProperty = ObjDefineProperty;
|
|
347
|
+
var _objDefineProperty$1 = ObjDefineProperty;
|
|
433
348
|
var _objFreeze = ObjClass.freeze;
|
|
434
349
|
var _isArray = Array.isArray;
|
|
435
350
|
var _objToString = ObjProto[strToString];
|
|
436
351
|
var _fnToString = ObjHasOwnProperty[strToString];
|
|
437
352
|
var _objFunctionString = _fnToString.call(ObjClass);
|
|
353
|
+
var rCamelCase = /-([a-z])/g;
|
|
354
|
+
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
355
|
+
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
438
356
|
var _objGetPrototypeOf = Object["getPrototypeOf"];
|
|
439
357
|
function _getObjProto(target) {
|
|
440
358
|
if (target) {
|
|
@@ -463,24 +381,18 @@ this.Microsoft = this.Microsoft || {};
|
|
|
463
381
|
function isFunction(value) {
|
|
464
382
|
return !!(value && typeof value === strShimFunction);
|
|
465
383
|
}
|
|
466
|
-
function
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
477
|
-
result = true;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
catch (e) {
|
|
481
|
-
}
|
|
384
|
+
function normalizeJsName(name) {
|
|
385
|
+
var value = name;
|
|
386
|
+
if (value && isString(value)) {
|
|
387
|
+
value = value.replace(rCamelCase, function (_all, letter) {
|
|
388
|
+
return letter.toUpperCase();
|
|
389
|
+
});
|
|
390
|
+
value = value.replace(rNormalizeInvalid, "_");
|
|
391
|
+
value = value.replace(rLeadingNumeric, function (_all, match) {
|
|
392
|
+
return "_" + match;
|
|
393
|
+
});
|
|
482
394
|
}
|
|
483
|
-
return
|
|
395
|
+
return value;
|
|
484
396
|
}
|
|
485
397
|
function objForEachKey(target, callbackfn) {
|
|
486
398
|
if (target) {
|
|
@@ -491,6 +403,12 @@ this.Microsoft = this.Microsoft || {};
|
|
|
491
403
|
}
|
|
492
404
|
}
|
|
493
405
|
}
|
|
406
|
+
function strContains(value, search) {
|
|
407
|
+
if (value && search) {
|
|
408
|
+
return value.indexOf(search) !== -1;
|
|
409
|
+
}
|
|
410
|
+
return false;
|
|
411
|
+
}
|
|
494
412
|
var isArray = _isArray || _isArrayPoly;
|
|
495
413
|
function _isArrayPoly(obj) {
|
|
496
414
|
return !!(obj && _objToString.call(obj) === "[object Array]");
|
|
@@ -498,6 +416,9 @@ this.Microsoft = this.Microsoft || {};
|
|
|
498
416
|
function isError(obj) {
|
|
499
417
|
return !!(obj && _objToString.call(obj) === "[object Error]");
|
|
500
418
|
}
|
|
419
|
+
function isString(value) {
|
|
420
|
+
return typeof value === "string";
|
|
421
|
+
}
|
|
501
422
|
function isBoolean(value) {
|
|
502
423
|
return typeof value === "boolean";
|
|
503
424
|
}
|
|
@@ -532,7 +453,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
532
453
|
}
|
|
533
454
|
}
|
|
534
455
|
function objDefineAccessors(target, prop, getProp, setProp) {
|
|
535
|
-
if (_objDefineProperty) {
|
|
456
|
+
if (_objDefineProperty$1) {
|
|
536
457
|
try {
|
|
537
458
|
var descriptor = {
|
|
538
459
|
enumerable: true,
|
|
@@ -544,7 +465,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
544
465
|
if (setProp) {
|
|
545
466
|
descriptor.set = setProp;
|
|
546
467
|
}
|
|
547
|
-
_objDefineProperty(target, prop, descriptor);
|
|
468
|
+
_objDefineProperty$1(target, prop, descriptor);
|
|
548
469
|
return true;
|
|
549
470
|
}
|
|
550
471
|
catch (e) {
|
|
@@ -564,7 +485,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
564
485
|
if (isError(object)) {
|
|
565
486
|
return object.name;
|
|
566
487
|
}
|
|
567
|
-
return
|
|
488
|
+
return strEmpty;
|
|
568
489
|
}
|
|
569
490
|
function setValue(target, field, value, valChk, srcChk) {
|
|
570
491
|
var theValue = value;
|
|
@@ -577,6 +498,47 @@ this.Microsoft = this.Microsoft || {};
|
|
|
577
498
|
}
|
|
578
499
|
return theValue;
|
|
579
500
|
}
|
|
501
|
+
function throwError(message) {
|
|
502
|
+
throw new Error(message);
|
|
503
|
+
}
|
|
504
|
+
function _createProxyFunction(source, funcName) {
|
|
505
|
+
var srcFunc = null;
|
|
506
|
+
var src = null;
|
|
507
|
+
if (isFunction(source)) {
|
|
508
|
+
srcFunc = source;
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
src = source;
|
|
512
|
+
}
|
|
513
|
+
return function () {
|
|
514
|
+
var originalArguments = arguments;
|
|
515
|
+
if (srcFunc) {
|
|
516
|
+
src = srcFunc();
|
|
517
|
+
}
|
|
518
|
+
if (src) {
|
|
519
|
+
return src[funcName].apply(src, originalArguments);
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
|
|
524
|
+
if (overwriteTarget === void 0) { overwriteTarget = true; }
|
|
525
|
+
if (target && name && source) {
|
|
526
|
+
if (overwriteTarget || isUndefined(target[name])) {
|
|
527
|
+
target[name] = _createProxyFunction(source, theFunc);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function createEnumStyle(values) {
|
|
532
|
+
var enumClass = {};
|
|
533
|
+
objForEachKey(values, function (field, value) {
|
|
534
|
+
enumClass[field] = value;
|
|
535
|
+
if (!isUndefined(enumClass[value])) {
|
|
536
|
+
throwError("[" + value + "] exists for " + field);
|
|
537
|
+
}
|
|
538
|
+
enumClass[value] = field;
|
|
539
|
+
});
|
|
540
|
+
return objFreeze(enumClass);
|
|
541
|
+
}
|
|
580
542
|
function objExtend(obj, obj2, obj3, obj4, obj5, obj6) {
|
|
581
543
|
var theArgs = arguments;
|
|
582
544
|
var extended = theArgs[0] || {};
|
|
@@ -624,10 +586,17 @@ this.Microsoft = this.Microsoft || {};
|
|
|
624
586
|
|
|
625
587
|
var strWindow = "window";
|
|
626
588
|
var strDocument = "document";
|
|
589
|
+
var strNavigator = "navigator";
|
|
627
590
|
var strLocation = "location";
|
|
628
591
|
var strConsole = "console";
|
|
629
592
|
var strPerformance = "performance";
|
|
630
593
|
var strJSON = "JSON";
|
|
594
|
+
var strCrypto = "crypto";
|
|
595
|
+
var strMsCrypto = "msCrypto";
|
|
596
|
+
var strMsie = "msie";
|
|
597
|
+
var strTrident = "trident/";
|
|
598
|
+
var _isTrident = null;
|
|
599
|
+
var _navUserAgentCheck = null;
|
|
631
600
|
var _enableMocks = false;
|
|
632
601
|
function getGlobalInst(name) {
|
|
633
602
|
var gbl = getGlobal();
|
|
@@ -657,6 +626,15 @@ this.Microsoft = this.Microsoft || {};
|
|
|
657
626
|
}
|
|
658
627
|
return getGlobalInst(strDocument);
|
|
659
628
|
}
|
|
629
|
+
function hasNavigator() {
|
|
630
|
+
return Boolean(typeof navigator === strShimObject && navigator);
|
|
631
|
+
}
|
|
632
|
+
function getNavigator() {
|
|
633
|
+
if (hasNavigator()) {
|
|
634
|
+
return navigator;
|
|
635
|
+
}
|
|
636
|
+
return getGlobalInst(strNavigator);
|
|
637
|
+
}
|
|
660
638
|
function getLocation(checkForMock) {
|
|
661
639
|
if (checkForMock && _enableMocks) {
|
|
662
640
|
var mockLocation = getGlobalInst("__mockLocation");
|
|
@@ -687,9 +665,24 @@ this.Microsoft = this.Microsoft || {};
|
|
|
687
665
|
}
|
|
688
666
|
return null;
|
|
689
667
|
}
|
|
668
|
+
function getCrypto() {
|
|
669
|
+
return getGlobalInst(strCrypto);
|
|
670
|
+
}
|
|
671
|
+
function getMsCrypto() {
|
|
672
|
+
return getGlobalInst(strMsCrypto);
|
|
673
|
+
}
|
|
674
|
+
function isIE() {
|
|
675
|
+
var nav = getNavigator();
|
|
676
|
+
if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {
|
|
677
|
+
_navUserAgentCheck = nav.userAgent;
|
|
678
|
+
var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase();
|
|
679
|
+
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
680
|
+
}
|
|
681
|
+
return _isTrident;
|
|
682
|
+
}
|
|
690
683
|
function dumpObj(object) {
|
|
691
684
|
var objectTypeDump = Object[strShimPrototype].toString.call(object);
|
|
692
|
-
var propertyValueDump =
|
|
685
|
+
var propertyValueDump = strEmpty;
|
|
693
686
|
if (objectTypeDump === "[object Error]") {
|
|
694
687
|
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
695
688
|
}
|
|
@@ -722,9 +715,9 @@ this.Microsoft = this.Microsoft || {};
|
|
|
722
715
|
var strWarnToConsole = "warnToConsole";
|
|
723
716
|
function _sanitizeDiagnosticText(text) {
|
|
724
717
|
if (text) {
|
|
725
|
-
return "\"" + text.replace(/\"/g,
|
|
718
|
+
return "\"" + text.replace(/\"/g, strEmpty) + "\"";
|
|
726
719
|
}
|
|
727
|
-
return
|
|
720
|
+
return strEmpty;
|
|
728
721
|
}
|
|
729
722
|
function _logToConsole(func, message) {
|
|
730
723
|
var theConsole = getConsole();
|
|
@@ -746,12 +739,12 @@ this.Microsoft = this.Microsoft || {};
|
|
|
746
739
|
_self.message =
|
|
747
740
|
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
748
741
|
msgId;
|
|
749
|
-
var strProps =
|
|
742
|
+
var strProps = strEmpty;
|
|
750
743
|
if (hasJSON()) {
|
|
751
744
|
strProps = getJSON().stringify(properties);
|
|
752
745
|
}
|
|
753
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) :
|
|
754
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) :
|
|
746
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) +
|
|
747
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty);
|
|
755
748
|
_self.message += diagnosticText;
|
|
756
749
|
}
|
|
757
750
|
_InternalLogMessage.dataType = "MessageData";
|
|
@@ -781,7 +774,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
781
774
|
throw message;
|
|
782
775
|
}
|
|
783
776
|
else {
|
|
784
|
-
var logFunc = severity ===
|
|
777
|
+
var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole;
|
|
785
778
|
if (!isUndefined(message.message)) {
|
|
786
779
|
var logLevel = _self.consoleLoggingLevel();
|
|
787
780
|
if (isUserAct) {
|
|
@@ -799,7 +792,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
799
792
|
_self.logInternalMessage(severity, message);
|
|
800
793
|
}
|
|
801
794
|
else {
|
|
802
|
-
_debugExtMsg("throw" + (severity ===
|
|
795
|
+
_debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
|
|
803
796
|
}
|
|
804
797
|
}
|
|
805
798
|
};
|
|
@@ -831,13 +824,13 @@ this.Microsoft = this.Microsoft || {};
|
|
|
831
824
|
if (severity <= _self.telemetryLoggingLevel()) {
|
|
832
825
|
_self.queue.push(message);
|
|
833
826
|
_messageCount++;
|
|
834
|
-
_debugExtMsg((severity ===
|
|
827
|
+
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
835
828
|
}
|
|
836
829
|
if (_messageCount === _self.maxInternalMessageLimit()) {
|
|
837
830
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
838
|
-
var throttleMessage = new _InternalLogMessage(
|
|
831
|
+
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
839
832
|
_self.queue.push(throttleMessage);
|
|
840
|
-
if (severity ===
|
|
833
|
+
if (severity === 1 ) {
|
|
841
834
|
_self.errorToConsole(throttleLimitMessage);
|
|
842
835
|
}
|
|
843
836
|
else {
|
|
@@ -979,6 +972,151 @@ this.Microsoft = this.Microsoft || {};
|
|
|
979
972
|
return func();
|
|
980
973
|
}
|
|
981
974
|
|
|
975
|
+
var UInt32Mask = 0x100000000;
|
|
976
|
+
var MaxUInt32 = 0xffffffff;
|
|
977
|
+
var _mwcSeeded = false;
|
|
978
|
+
var _mwcW = 123456789;
|
|
979
|
+
var _mwcZ = 987654321;
|
|
980
|
+
function _mwcSeed(seedValue) {
|
|
981
|
+
if (seedValue < 0) {
|
|
982
|
+
seedValue >>>= 0;
|
|
983
|
+
}
|
|
984
|
+
_mwcW = (123456789 + seedValue) & MaxUInt32;
|
|
985
|
+
_mwcZ = (987654321 - seedValue) & MaxUInt32;
|
|
986
|
+
_mwcSeeded = true;
|
|
987
|
+
}
|
|
988
|
+
function _autoSeedMwc() {
|
|
989
|
+
try {
|
|
990
|
+
var now = dateNow() & 0x7fffffff;
|
|
991
|
+
_mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
|
|
992
|
+
}
|
|
993
|
+
catch (e) {
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
function random32(signed) {
|
|
997
|
+
var value = 0;
|
|
998
|
+
var c = getCrypto() || getMsCrypto();
|
|
999
|
+
if (c && c.getRandomValues) {
|
|
1000
|
+
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
|
|
1001
|
+
}
|
|
1002
|
+
if (value === 0 && isIE()) {
|
|
1003
|
+
if (!_mwcSeeded) {
|
|
1004
|
+
_autoSeedMwc();
|
|
1005
|
+
}
|
|
1006
|
+
value = mwcRandom32() & MaxUInt32;
|
|
1007
|
+
}
|
|
1008
|
+
if (value === 0) {
|
|
1009
|
+
value = Math.floor((UInt32Mask * Math.random()) | 0);
|
|
1010
|
+
}
|
|
1011
|
+
if (!signed) {
|
|
1012
|
+
value >>>= 0;
|
|
1013
|
+
}
|
|
1014
|
+
return value;
|
|
1015
|
+
}
|
|
1016
|
+
function mwcRandom32(signed) {
|
|
1017
|
+
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
1018
|
+
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
1019
|
+
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
|
|
1020
|
+
if (!signed) {
|
|
1021
|
+
value >>>= 0;
|
|
1022
|
+
}
|
|
1023
|
+
return value;
|
|
1024
|
+
}
|
|
1025
|
+
function newId(maxLength) {
|
|
1026
|
+
if (maxLength === void 0) { maxLength = 22; }
|
|
1027
|
+
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1028
|
+
var number = random32() >>> 0;
|
|
1029
|
+
var chars = 0;
|
|
1030
|
+
var result = strEmpty;
|
|
1031
|
+
while (result.length < maxLength) {
|
|
1032
|
+
chars++;
|
|
1033
|
+
result += base64chars.charAt(number & 0x3F);
|
|
1034
|
+
number >>>= 6;
|
|
1035
|
+
if (chars === 5) {
|
|
1036
|
+
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
1037
|
+
chars = 0;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
return result;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
var _objDefineProperty = ObjDefineProperty;
|
|
1044
|
+
var version = "2.7.3";
|
|
1045
|
+
var instanceName = "." + newId(6);
|
|
1046
|
+
var _dataUid = 0;
|
|
1047
|
+
function _createAccessor(target, prop, value) {
|
|
1048
|
+
if (_objDefineProperty) {
|
|
1049
|
+
try {
|
|
1050
|
+
_objDefineProperty(target, prop, {
|
|
1051
|
+
value: value,
|
|
1052
|
+
enumerable: false,
|
|
1053
|
+
configurable: true
|
|
1054
|
+
});
|
|
1055
|
+
return true;
|
|
1056
|
+
}
|
|
1057
|
+
catch (e) {
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
return false;
|
|
1061
|
+
}
|
|
1062
|
+
function _canAcceptData(target) {
|
|
1063
|
+
return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType);
|
|
1064
|
+
}
|
|
1065
|
+
function _getCache(data, target) {
|
|
1066
|
+
var theCache = target[data.id];
|
|
1067
|
+
if (!theCache) {
|
|
1068
|
+
theCache = {};
|
|
1069
|
+
try {
|
|
1070
|
+
if (_canAcceptData(target)) {
|
|
1071
|
+
if (!_createAccessor(target, data.id, theCache)) {
|
|
1072
|
+
target[data.id] = theCache;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
catch (e) {
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
return theCache;
|
|
1080
|
+
}
|
|
1081
|
+
function createUniqueNamespace(name, includeVersion) {
|
|
1082
|
+
if (includeVersion === void 0) { includeVersion = false; }
|
|
1083
|
+
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName);
|
|
1084
|
+
}
|
|
1085
|
+
function createElmNodeData(name) {
|
|
1086
|
+
var data = {
|
|
1087
|
+
id: createUniqueNamespace("_aiData-" + (name || "") + "." + version),
|
|
1088
|
+
accept: function (target) {
|
|
1089
|
+
return _canAcceptData(target);
|
|
1090
|
+
},
|
|
1091
|
+
get: function (target, name, defValue, addDefault) {
|
|
1092
|
+
var theCache = target[data.id];
|
|
1093
|
+
if (!theCache) {
|
|
1094
|
+
if (addDefault) {
|
|
1095
|
+
theCache = _getCache(data, target);
|
|
1096
|
+
theCache[normalizeJsName(name)] = defValue;
|
|
1097
|
+
}
|
|
1098
|
+
return defValue;
|
|
1099
|
+
}
|
|
1100
|
+
return theCache[normalizeJsName(name)];
|
|
1101
|
+
},
|
|
1102
|
+
kill: function (target, name) {
|
|
1103
|
+
if (target && target[name]) {
|
|
1104
|
+
try {
|
|
1105
|
+
delete target[name];
|
|
1106
|
+
}
|
|
1107
|
+
catch (e) {
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
return data;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
var pluginStateData = createElmNodeData("plugin");
|
|
1116
|
+
function _getPluginState(plugin) {
|
|
1117
|
+
return pluginStateData.get(plugin, "state", {}, true);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
982
1120
|
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
983
1121
|
var strHasRunFlags = "_hasRun";
|
|
984
1122
|
var strGetTelCtx = "_getTelCtx";
|
|
@@ -992,53 +1130,69 @@ this.Microsoft = this.Microsoft || {};
|
|
|
992
1130
|
}
|
|
993
1131
|
return createTelemetryProxyChain([startAt], config, core);
|
|
994
1132
|
}
|
|
995
|
-
function
|
|
1133
|
+
function _createInternalContext(telemetryChain, config, core, startAt) {
|
|
996
1134
|
var _nextProxy = null;
|
|
997
|
-
var _onComplete =
|
|
998
|
-
if (startAt) {
|
|
999
|
-
_nextProxy = _getNextProxyStart(telemetryChain, config, core, startAt);
|
|
1000
|
-
}
|
|
1001
|
-
else {
|
|
1002
|
-
_nextProxy = telemetryChain;
|
|
1135
|
+
var _onComplete = [];
|
|
1136
|
+
if (startAt !== null) {
|
|
1137
|
+
_nextProxy = startAt ? _getNextProxyStart(telemetryChain, config, core, startAt) : telemetryChain;
|
|
1003
1138
|
}
|
|
1004
1139
|
var context = {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1140
|
+
_next: _moveNext,
|
|
1141
|
+
ctx: {
|
|
1142
|
+
core: function () { return core; },
|
|
1143
|
+
diagLog: function () {
|
|
1144
|
+
return safeGetLogger(core, config);
|
|
1145
|
+
},
|
|
1146
|
+
getCfg: function () {
|
|
1147
|
+
return config;
|
|
1148
|
+
},
|
|
1149
|
+
getExtCfg: _getExtCfg,
|
|
1150
|
+
getConfig: _getConfig,
|
|
1151
|
+
hasNext: function () {
|
|
1152
|
+
return !!_nextProxy;
|
|
1153
|
+
},
|
|
1154
|
+
getNext: function () {
|
|
1155
|
+
return _nextProxy;
|
|
1156
|
+
},
|
|
1157
|
+
setNext: function (nextPlugin) {
|
|
1158
|
+
_nextProxy = nextPlugin;
|
|
1159
|
+
},
|
|
1160
|
+
iterate: _iterateChain,
|
|
1161
|
+
onComplete: _addOnComplete
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
function _addOnComplete(onComplete, that) {
|
|
1165
|
+
var args = [];
|
|
1166
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1167
|
+
args[_i - 2] = arguments[_i];
|
|
1168
|
+
}
|
|
1169
|
+
if (onComplete) {
|
|
1170
|
+
_onComplete.push({
|
|
1171
|
+
func: onComplete,
|
|
1172
|
+
self: !isUndefined(that) ? that : context.ctx,
|
|
1173
|
+
args: args
|
|
1028
1174
|
});
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
function _moveNext() {
|
|
1178
|
+
var nextProxy = _nextProxy;
|
|
1179
|
+
_nextProxy = nextProxy ? nextProxy.getNext() : null;
|
|
1180
|
+
if (!nextProxy) {
|
|
1181
|
+
var onComplete = _onComplete;
|
|
1182
|
+
if (onComplete && onComplete.length > 0) {
|
|
1183
|
+
arrForEach(onComplete, function (completeDetails) {
|
|
1184
|
+
try {
|
|
1185
|
+
completeDetails.func.call(completeDetails.self, completeDetails.args);
|
|
1186
|
+
}
|
|
1187
|
+
catch (e) {
|
|
1188
|
+
core.logger.throwInternal(2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
_onComplete = [];
|
|
1035
1192
|
}
|
|
1036
|
-
return createProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
|
|
1037
|
-
},
|
|
1038
|
-
onComplete: function (onComplete) {
|
|
1039
|
-
_onComplete = onComplete;
|
|
1040
1193
|
}
|
|
1041
|
-
|
|
1194
|
+
return nextProxy;
|
|
1195
|
+
}
|
|
1042
1196
|
function _getExtCfg(identifier, defaultValue, mergeDefault) {
|
|
1043
1197
|
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1044
1198
|
if (mergeDefault === void 0) { mergeDefault = 0 ; }
|
|
@@ -1081,29 +1235,53 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1081
1235
|
}
|
|
1082
1236
|
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1083
1237
|
}
|
|
1084
|
-
function
|
|
1085
|
-
var nextPlugin
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
else {
|
|
1091
|
-
if (_onComplete) {
|
|
1092
|
-
_onComplete();
|
|
1093
|
-
_onComplete = null;
|
|
1238
|
+
function _iterateChain(cb) {
|
|
1239
|
+
var nextPlugin;
|
|
1240
|
+
while (!!(nextPlugin = context._next())) {
|
|
1241
|
+
var plugin = nextPlugin.getPlugin();
|
|
1242
|
+
if (plugin) {
|
|
1243
|
+
cb(plugin);
|
|
1094
1244
|
}
|
|
1095
1245
|
}
|
|
1096
1246
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1247
|
+
return context;
|
|
1248
|
+
}
|
|
1249
|
+
function createProcessTelemetryContext(telemetryChain, config, core, startAt) {
|
|
1250
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1251
|
+
var context = internalContext.ctx;
|
|
1252
|
+
function _processNext(env) {
|
|
1253
|
+
var nextPlugin = internalContext._next();
|
|
1254
|
+
nextPlugin && nextPlugin.processTelemetry(env, context);
|
|
1255
|
+
return !nextPlugin;
|
|
1256
|
+
}
|
|
1257
|
+
function _createNew(plugins, startAt) {
|
|
1258
|
+
if (plugins === void 0) { plugins = null; }
|
|
1259
|
+
if (isArray(plugins)) {
|
|
1260
|
+
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1261
|
+
}
|
|
1262
|
+
return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt);
|
|
1263
|
+
}
|
|
1264
|
+
context.processNext = _processNext;
|
|
1265
|
+
context.createNew = _createNew;
|
|
1266
|
+
return context;
|
|
1267
|
+
}
|
|
1268
|
+
function createProcessTelemetryUnloadContext(telemetryChain, config, core, startAt) {
|
|
1269
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1270
|
+
var context = internalContext.ctx;
|
|
1271
|
+
function _processNext(unloadState) {
|
|
1272
|
+
var nextPlugin = internalContext._next();
|
|
1273
|
+
nextPlugin && nextPlugin.unload(context, unloadState);
|
|
1274
|
+
return !nextPlugin;
|
|
1275
|
+
}
|
|
1276
|
+
function _createNew(plugins, startAt) {
|
|
1277
|
+
if (plugins === void 0) { plugins = null; }
|
|
1278
|
+
if (isArray(plugins)) {
|
|
1279
|
+
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1105
1280
|
}
|
|
1281
|
+
return createProcessTelemetryUnloadContext(plugins || context.getNext(), config, core, startAt);
|
|
1106
1282
|
}
|
|
1283
|
+
context.processNext = _processNext;
|
|
1284
|
+
context.createNew = _createNew;
|
|
1107
1285
|
return context;
|
|
1108
1286
|
}
|
|
1109
1287
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
@@ -1151,32 +1329,35 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1151
1329
|
return nextProxy;
|
|
1152
1330
|
},
|
|
1153
1331
|
processTelemetry: _processTelemetry,
|
|
1332
|
+
unload: _unloadPlugin,
|
|
1154
1333
|
_id: chainId,
|
|
1155
1334
|
_setNext: function (nextPlugin) {
|
|
1156
1335
|
nextProxy = nextPlugin;
|
|
1157
1336
|
}
|
|
1158
1337
|
};
|
|
1159
|
-
function
|
|
1338
|
+
function _getTelCtx() {
|
|
1339
|
+
var itemCtx;
|
|
1340
|
+
if (plugin && isFunction(plugin[strGetTelCtx])) {
|
|
1341
|
+
itemCtx = plugin[strGetTelCtx]();
|
|
1342
|
+
}
|
|
1160
1343
|
if (!itemCtx) {
|
|
1161
|
-
|
|
1162
|
-
itemCtx = plugin[strGetTelCtx]();
|
|
1163
|
-
}
|
|
1164
|
-
if (!itemCtx) {
|
|
1165
|
-
itemCtx = createProcessTelemetryContext(proxyChain, config, core);
|
|
1166
|
-
}
|
|
1344
|
+
itemCtx = createProcessTelemetryContext(proxyChain, config, core);
|
|
1167
1345
|
}
|
|
1346
|
+
return itemCtx;
|
|
1347
|
+
}
|
|
1348
|
+
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
1349
|
+
var hasRun = false;
|
|
1168
1350
|
var identifier = plugin ? plugin.identifier : strTelemetryPluginChain;
|
|
1169
1351
|
var hasRunContext = itemCtx[strHasRunFlags];
|
|
1170
1352
|
if (!hasRunContext) {
|
|
1171
1353
|
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
1172
1354
|
}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
if (plugin) {
|
|
1355
|
+
itemCtx.setNext(nextProxy);
|
|
1356
|
+
if (plugin) {
|
|
1357
|
+
doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () {
|
|
1358
|
+
hasRunContext[chainId] = true;
|
|
1178
1359
|
try {
|
|
1179
|
-
var nextId = nextProxy ? nextProxy._id :
|
|
1360
|
+
var nextId = nextProxy ? nextProxy._id : strEmpty;
|
|
1180
1361
|
if (nextId) {
|
|
1181
1362
|
hasRunContext[nextId] = false;
|
|
1182
1363
|
}
|
|
@@ -1188,18 +1369,21 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1188
1369
|
hasRun = true;
|
|
1189
1370
|
}
|
|
1190
1371
|
if (!nextProxy || !hasNextRun) {
|
|
1191
|
-
itemCtx.diagLog().throwInternal(
|
|
1372
|
+
itemCtx.diagLog().throwInternal(1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1192
1373
|
}
|
|
1193
1374
|
}
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
}
|
|
1198
|
-
}, details, isAsync);
|
|
1375
|
+
}, details, isAsync);
|
|
1376
|
+
}
|
|
1377
|
+
return hasRun;
|
|
1199
1378
|
}
|
|
1200
1379
|
function _processTelemetry(env, itemCtx) {
|
|
1201
|
-
|
|
1202
|
-
|
|
1380
|
+
itemCtx = itemCtx || _getTelCtx();
|
|
1381
|
+
function _callProcessTelemetry(itemCtx) {
|
|
1382
|
+
if (!plugin || !hasProcessTelemetry) {
|
|
1383
|
+
return false;
|
|
1384
|
+
}
|
|
1385
|
+
var pluginState = _getPluginState(plugin);
|
|
1386
|
+
if (pluginState[strTeardown] || pluginState[strDisabled]) {
|
|
1203
1387
|
return false;
|
|
1204
1388
|
}
|
|
1205
1389
|
if (hasSetNext) {
|
|
@@ -1207,15 +1391,61 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1207
1391
|
}
|
|
1208
1392
|
plugin.processTelemetry(env, itemCtx);
|
|
1209
1393
|
return true;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1394
|
+
}
|
|
1395
|
+
if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) {
|
|
1396
|
+
itemCtx.processNext(env);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
function _unloadPlugin(unloadCtx, unloadState) {
|
|
1400
|
+
function _callTeardown() {
|
|
1401
|
+
var hasRun = false;
|
|
1402
|
+
if (plugin) {
|
|
1403
|
+
var pluginState = _getPluginState(plugin);
|
|
1404
|
+
var pluginCore = plugin[strCore] || pluginState.core;
|
|
1405
|
+
if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) {
|
|
1406
|
+
pluginState[strCore] = null;
|
|
1407
|
+
pluginState[strTeardown] = true;
|
|
1408
|
+
pluginState[strIsInitialized] = false;
|
|
1409
|
+
if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) {
|
|
1410
|
+
hasRun = true;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
return hasRun;
|
|
1415
|
+
}
|
|
1416
|
+
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) {
|
|
1417
|
+
unloadCtx.processNext(unloadState);
|
|
1418
|
+
}
|
|
1213
1419
|
}
|
|
1214
1420
|
return objFreeze(proxyChain);
|
|
1215
1421
|
}
|
|
1216
1422
|
|
|
1217
1423
|
var strExtensionConfig = "extensionConfig";
|
|
1218
1424
|
|
|
1425
|
+
function createUnloadHandlerContainer() {
|
|
1426
|
+
var handlers = [];
|
|
1427
|
+
function _addHandler(handler) {
|
|
1428
|
+
if (handler) {
|
|
1429
|
+
handlers.push(handler);
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
function _runHandlers(unloadCtx, unloadState) {
|
|
1433
|
+
arrForEach(handlers, function (handler) {
|
|
1434
|
+
try {
|
|
1435
|
+
handler(unloadCtx, unloadState);
|
|
1436
|
+
}
|
|
1437
|
+
catch (e) {
|
|
1438
|
+
unloadCtx.diagLog().throwInternal(2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
|
|
1439
|
+
}
|
|
1440
|
+
});
|
|
1441
|
+
handlers = [];
|
|
1442
|
+
}
|
|
1443
|
+
return {
|
|
1444
|
+
add: _addHandler,
|
|
1445
|
+
run: _runHandlers
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1219
1449
|
var strGetPlugin = "getPlugin";
|
|
1220
1450
|
var BaseTelemetryPlugin = /** @class */ (function () {
|
|
1221
1451
|
function BaseTelemetryPlugin() {
|
|
@@ -1223,6 +1453,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1223
1453
|
var _isinitialized;
|
|
1224
1454
|
var _rootCtx;
|
|
1225
1455
|
var _nextPlugin;
|
|
1456
|
+
var _unloadHandlerContainer;
|
|
1226
1457
|
var _hooks;
|
|
1227
1458
|
_initDefaults();
|
|
1228
1459
|
dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
|
|
@@ -1230,6 +1461,39 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1230
1461
|
_setDefaults(config, core, pluginChain);
|
|
1231
1462
|
_isinitialized = true;
|
|
1232
1463
|
};
|
|
1464
|
+
_self.teardown = function (unloadCtx, unloadState) {
|
|
1465
|
+
if (!_self.core || (unloadCtx && _self.core !== unloadCtx.core())) {
|
|
1466
|
+
return;
|
|
1467
|
+
}
|
|
1468
|
+
var result;
|
|
1469
|
+
var unloadDone = false;
|
|
1470
|
+
var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1471
|
+
var theUnloadState = unloadState || {
|
|
1472
|
+
reason: 0 ,
|
|
1473
|
+
isAsync: false
|
|
1474
|
+
};
|
|
1475
|
+
function _unloadCallback() {
|
|
1476
|
+
if (!unloadDone) {
|
|
1477
|
+
unloadDone = true;
|
|
1478
|
+
_unloadHandlerContainer.run(theUnloadCtx, unloadState);
|
|
1479
|
+
arrForEach(_hooks, function (fn) {
|
|
1480
|
+
fn.rm();
|
|
1481
|
+
});
|
|
1482
|
+
_hooks = [];
|
|
1483
|
+
if (result === true) {
|
|
1484
|
+
theUnloadCtx.processNext(theUnloadState);
|
|
1485
|
+
}
|
|
1486
|
+
_initDefaults();
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {
|
|
1490
|
+
_unloadCallback();
|
|
1491
|
+
}
|
|
1492
|
+
else {
|
|
1493
|
+
result = true;
|
|
1494
|
+
}
|
|
1495
|
+
return result;
|
|
1496
|
+
};
|
|
1233
1497
|
_self._addHook = function (hooks) {
|
|
1234
1498
|
if (hooks) {
|
|
1235
1499
|
if (isArray(hooks)) {
|
|
@@ -1240,17 +1504,18 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1240
1504
|
}
|
|
1241
1505
|
}
|
|
1242
1506
|
};
|
|
1507
|
+
proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add");
|
|
1243
1508
|
});
|
|
1244
1509
|
_self.diagLog = function (itemCtx) {
|
|
1245
1510
|
return _getTelCtx(itemCtx).diagLog();
|
|
1246
1511
|
};
|
|
1247
|
-
_self
|
|
1512
|
+
_self[strIsInitialized] = function () {
|
|
1248
1513
|
return _isinitialized;
|
|
1249
1514
|
};
|
|
1250
1515
|
_self.setInitialized = function (isInitialized) {
|
|
1251
1516
|
_isinitialized = isInitialized;
|
|
1252
1517
|
};
|
|
1253
|
-
_self
|
|
1518
|
+
_self[strSetNextPlugin] = function (next) {
|
|
1254
1519
|
_nextPlugin = next;
|
|
1255
1520
|
};
|
|
1256
1521
|
_self.processNext = function (env, itemCtx) {
|
|
@@ -1296,11 +1561,197 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1296
1561
|
_rootCtx = null;
|
|
1297
1562
|
_nextPlugin = null;
|
|
1298
1563
|
_hooks = [];
|
|
1564
|
+
_unloadHandlerContainer = createUnloadHandlerContainer();
|
|
1299
1565
|
}
|
|
1300
1566
|
}
|
|
1301
1567
|
return BaseTelemetryPlugin;
|
|
1302
1568
|
}());
|
|
1303
1569
|
|
|
1570
|
+
var strOnPrefix = "on";
|
|
1571
|
+
var strAttachEvent = "attachEvent";
|
|
1572
|
+
var strAddEventHelper = "addEventListener";
|
|
1573
|
+
var strEvents = "events";
|
|
1574
|
+
createUniqueNamespace("aiEvtPageHide");
|
|
1575
|
+
createUniqueNamespace("aiEvtPageShow");
|
|
1576
|
+
var _guid = 1;
|
|
1577
|
+
var elmNodeData = createElmNodeData("events");
|
|
1578
|
+
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
1579
|
+
function _normalizeNamespace(name) {
|
|
1580
|
+
if (name && name.replace) {
|
|
1581
|
+
return name.replace(/^\s*\.*|\.*\s*$/g, "");
|
|
1582
|
+
}
|
|
1583
|
+
return name;
|
|
1584
|
+
}
|
|
1585
|
+
function _getEvtNamespace(eventName, namespaces) {
|
|
1586
|
+
if (namespaces) {
|
|
1587
|
+
var theNamespace_1 = "";
|
|
1588
|
+
if (isArray(namespaces)) {
|
|
1589
|
+
theNamespace_1 = "";
|
|
1590
|
+
arrForEach(namespaces, function (name) {
|
|
1591
|
+
name = _normalizeNamespace(name);
|
|
1592
|
+
if (name) {
|
|
1593
|
+
if (name[0] !== ".") {
|
|
1594
|
+
name = "." + name;
|
|
1595
|
+
}
|
|
1596
|
+
theNamespace_1 += name;
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
else {
|
|
1601
|
+
theNamespace_1 = _normalizeNamespace(namespaces);
|
|
1602
|
+
}
|
|
1603
|
+
if (theNamespace_1) {
|
|
1604
|
+
if (theNamespace_1[0] !== ".") {
|
|
1605
|
+
theNamespace_1 = "." + theNamespace_1;
|
|
1606
|
+
}
|
|
1607
|
+
eventName = (eventName || "") + theNamespace_1;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
var parsedEvent = (eventNamespace.exec(eventName) || []);
|
|
1611
|
+
return {
|
|
1612
|
+
type: parsedEvent[1],
|
|
1613
|
+
ns: ((parsedEvent[2] || "").split(".").sort()).join(".")
|
|
1614
|
+
};
|
|
1615
|
+
}
|
|
1616
|
+
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
1617
|
+
if (addDefault === void 0) { addDefault = true; }
|
|
1618
|
+
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
1619
|
+
var registeredEvents = aiEvts[evtName];
|
|
1620
|
+
if (!registeredEvents) {
|
|
1621
|
+
registeredEvents = aiEvts[evtName] = [];
|
|
1622
|
+
}
|
|
1623
|
+
return registeredEvents;
|
|
1624
|
+
}
|
|
1625
|
+
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
1626
|
+
var result = false;
|
|
1627
|
+
if (obj && evtName && evtName.type && handlerRef) {
|
|
1628
|
+
if (obj[strAddEventHelper]) {
|
|
1629
|
+
obj[strAddEventHelper](evtName.type, handlerRef, useCapture);
|
|
1630
|
+
result = true;
|
|
1631
|
+
}
|
|
1632
|
+
else if (obj[strAttachEvent]) {
|
|
1633
|
+
obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef);
|
|
1634
|
+
result = true;
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
return result;
|
|
1638
|
+
}
|
|
1639
|
+
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
1640
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
1641
|
+
var result = false;
|
|
1642
|
+
if (target) {
|
|
1643
|
+
try {
|
|
1644
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
1645
|
+
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
1646
|
+
if (result && elmNodeData.accept(target)) {
|
|
1647
|
+
var registeredEvent = {
|
|
1648
|
+
guid: _guid++,
|
|
1649
|
+
evtName: evtName,
|
|
1650
|
+
handler: handlerRef,
|
|
1651
|
+
capture: useCapture
|
|
1652
|
+
};
|
|
1653
|
+
_getRegisteredEvents(target, evtName.type).push(registeredEvent);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
catch (e) {
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
return result;
|
|
1660
|
+
}
|
|
1661
|
+
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
1662
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
1663
|
+
return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
var LoggingSeverity = createEnumStyle({
|
|
1667
|
+
CRITICAL: 1 ,
|
|
1668
|
+
WARNING: 2
|
|
1669
|
+
});
|
|
1670
|
+
var _InternalMessageId = createEnumStyle({
|
|
1671
|
+
BrowserDoesNotSupportLocalStorage: 0 ,
|
|
1672
|
+
BrowserCannotReadLocalStorage: 1 ,
|
|
1673
|
+
BrowserCannotReadSessionStorage: 2 ,
|
|
1674
|
+
BrowserCannotWriteLocalStorage: 3 ,
|
|
1675
|
+
BrowserCannotWriteSessionStorage: 4 ,
|
|
1676
|
+
BrowserFailedRemovalFromLocalStorage: 5 ,
|
|
1677
|
+
BrowserFailedRemovalFromSessionStorage: 6 ,
|
|
1678
|
+
CannotSendEmptyTelemetry: 7 ,
|
|
1679
|
+
ClientPerformanceMathError: 8 ,
|
|
1680
|
+
ErrorParsingAISessionCookie: 9 ,
|
|
1681
|
+
ErrorPVCalc: 10 ,
|
|
1682
|
+
ExceptionWhileLoggingError: 11 ,
|
|
1683
|
+
FailedAddingTelemetryToBuffer: 12 ,
|
|
1684
|
+
FailedMonitorAjaxAbort: 13 ,
|
|
1685
|
+
FailedMonitorAjaxDur: 14 ,
|
|
1686
|
+
FailedMonitorAjaxOpen: 15 ,
|
|
1687
|
+
FailedMonitorAjaxRSC: 16 ,
|
|
1688
|
+
FailedMonitorAjaxSend: 17 ,
|
|
1689
|
+
FailedMonitorAjaxGetCorrelationHeader: 18 ,
|
|
1690
|
+
FailedToAddHandlerForOnBeforeUnload: 19 ,
|
|
1691
|
+
FailedToSendQueuedTelemetry: 20 ,
|
|
1692
|
+
FailedToReportDataLoss: 21 ,
|
|
1693
|
+
FlushFailed: 22 ,
|
|
1694
|
+
MessageLimitPerPVExceeded: 23 ,
|
|
1695
|
+
MissingRequiredFieldSpecification: 24 ,
|
|
1696
|
+
NavigationTimingNotSupported: 25 ,
|
|
1697
|
+
OnError: 26 ,
|
|
1698
|
+
SessionRenewalDateIsZero: 27 ,
|
|
1699
|
+
SenderNotInitialized: 28 ,
|
|
1700
|
+
StartTrackEventFailed: 29 ,
|
|
1701
|
+
StopTrackEventFailed: 30 ,
|
|
1702
|
+
StartTrackFailed: 31 ,
|
|
1703
|
+
StopTrackFailed: 32 ,
|
|
1704
|
+
TelemetrySampledAndNotSent: 33 ,
|
|
1705
|
+
TrackEventFailed: 34 ,
|
|
1706
|
+
TrackExceptionFailed: 35 ,
|
|
1707
|
+
TrackMetricFailed: 36 ,
|
|
1708
|
+
TrackPVFailed: 37 ,
|
|
1709
|
+
TrackPVFailedCalc: 38 ,
|
|
1710
|
+
TrackTraceFailed: 39 ,
|
|
1711
|
+
TransmissionFailed: 40 ,
|
|
1712
|
+
FailedToSetStorageBuffer: 41 ,
|
|
1713
|
+
FailedToRestoreStorageBuffer: 42 ,
|
|
1714
|
+
InvalidBackendResponse: 43 ,
|
|
1715
|
+
FailedToFixDepricatedValues: 44 ,
|
|
1716
|
+
InvalidDurationValue: 45 ,
|
|
1717
|
+
TelemetryEnvelopeInvalid: 46 ,
|
|
1718
|
+
CreateEnvelopeError: 47 ,
|
|
1719
|
+
CannotSerializeObject: 48 ,
|
|
1720
|
+
CannotSerializeObjectNonSerializable: 49 ,
|
|
1721
|
+
CircularReferenceDetected: 50 ,
|
|
1722
|
+
ClearAuthContextFailed: 51 ,
|
|
1723
|
+
ExceptionTruncated: 52 ,
|
|
1724
|
+
IllegalCharsInName: 53 ,
|
|
1725
|
+
ItemNotInArray: 54 ,
|
|
1726
|
+
MaxAjaxPerPVExceeded: 55 ,
|
|
1727
|
+
MessageTruncated: 56 ,
|
|
1728
|
+
NameTooLong: 57 ,
|
|
1729
|
+
SampleRateOutOfRange: 58 ,
|
|
1730
|
+
SetAuthContextFailed: 59 ,
|
|
1731
|
+
SetAuthContextFailedAccountName: 60 ,
|
|
1732
|
+
StringValueTooLong: 61 ,
|
|
1733
|
+
StartCalledMoreThanOnce: 62 ,
|
|
1734
|
+
StopCalledWithoutStart: 63 ,
|
|
1735
|
+
TelemetryInitializerFailed: 64 ,
|
|
1736
|
+
TrackArgumentsNotSpecified: 65 ,
|
|
1737
|
+
UrlTooLong: 66 ,
|
|
1738
|
+
SessionStorageBufferFull: 67 ,
|
|
1739
|
+
CannotAccessCookie: 68 ,
|
|
1740
|
+
IdTooLong: 69 ,
|
|
1741
|
+
InvalidEvent: 70 ,
|
|
1742
|
+
FailedMonitorAjaxSetRequestHeader: 71 ,
|
|
1743
|
+
SendBrowserInfoOnUserInit: 72 ,
|
|
1744
|
+
PluginException: 73 ,
|
|
1745
|
+
NotificationException: 74 ,
|
|
1746
|
+
SnippetScriptLoadFailure: 99 ,
|
|
1747
|
+
InvalidInstrumentationKey: 100 ,
|
|
1748
|
+
CannotParseAiBlobValue: 101 ,
|
|
1749
|
+
InvalidContentBlob: 102 ,
|
|
1750
|
+
TrackPageActionEventFailed: 103 ,
|
|
1751
|
+
FailedAddingCustomDefinedRequestContext: 104 ,
|
|
1752
|
+
InMemoryStorageBufferFull: 105
|
|
1753
|
+
});
|
|
1754
|
+
|
|
1304
1755
|
var strNotSpecified = "not_specified";
|
|
1305
1756
|
|
|
1306
1757
|
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
@@ -2156,7 +2607,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
2156
2607
|
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.TrackPageActionEventFailed, "trackPageAction failed, page action event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2157
2608
|
}
|
|
2158
2609
|
};
|
|
2159
|
-
ClickAnalyticsPlugin.Version = "2.8.0-beta.2203-
|
|
2610
|
+
ClickAnalyticsPlugin.Version = "2.8.0-beta.2203-04";
|
|
2160
2611
|
return ClickAnalyticsPlugin;
|
|
2161
2612
|
}(BaseTelemetryPlugin));
|
|
2162
2613
|
|