@microsoft/applicationinsights-analytics-js 3.3.10-nightly3.2507-29 → 3.3.10-nightly3.2508-01
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-analytics-js.cjs.js +133 -50
- package/browser/es5/applicationinsights-analytics-js.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-analytics-js.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-analytics-js.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-analytics-js.gbl.js +135 -52
- package/browser/es5/applicationinsights-analytics-js.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-analytics-js.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-analytics-js.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-analytics-js.integrity.json +25 -25
- package/browser/es5/applicationinsights-analytics-js.js +135 -52
- package/browser/es5/applicationinsights-analytics-js.js.map +1 -1
- package/browser/es5/applicationinsights-analytics-js.min.js +2 -2
- package/browser/es5/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/es5/applicationinsights-analytics-js.js +133 -50
- package/dist/es5/applicationinsights-analytics-js.js.map +1 -1
- package/dist/es5/applicationinsights-analytics-js.min.js +2 -2
- package/dist/es5/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist-es5/JavaScriptSDK/AnalyticsPlugin.js +2 -2
- package/dist-es5/JavaScriptSDK/AnalyticsPlugin.js.map +1 -1
- package/dist-es5/JavaScriptSDK/Interfaces/IAnalyticsConfig.js +1 -1
- package/dist-es5/JavaScriptSDK/Telemetry/PageViewManager.js +1 -1
- package/dist-es5/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js +1 -1
- package/dist-es5/JavaScriptSDK/Telemetry/PageVisitTimeManager.js +1 -1
- package/dist-es5/JavaScriptSDK/Timing.js +1 -1
- package/dist-es5/__DynamicConstants.js +1 -1
- package/dist-es5/applicationinsights-analytics-js.js +1 -1
- package/package.json +6 -6
- package/types/applicationinsights-analytics-js.d.ts +1 -1
- package/types/applicationinsights-analytics-js.namespaced.d.ts +9 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Web Analytics, 3.3.10-nightly3.
|
|
2
|
+
* Application Insights JavaScript SDK - Web Analytics, 3.3.10-nightly3.2508-01
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -1537,7 +1537,7 @@ function newId(maxLength) {
|
|
|
1537
1537
|
return result;
|
|
1538
1538
|
}
|
|
1539
1539
|
|
|
1540
|
-
var version = '3.3.10-nightly3.
|
|
1540
|
+
var version = '3.3.10-nightly3.2508-01';
|
|
1541
1541
|
var instanceName = "." + newId(6);
|
|
1542
1542
|
var _dataUid = 0;
|
|
1543
1543
|
function _canAcceptData(target) {
|
|
@@ -2467,6 +2467,7 @@ var rootDefaultConfig = (_a$2 = {
|
|
|
2467
2467
|
_b.enabled = UNDEFINED_VALUE,
|
|
2468
2468
|
_b.ignoreCookies = UNDEFINED_VALUE,
|
|
2469
2469
|
_b.blockedCookies = UNDEFINED_VALUE,
|
|
2470
|
+
_b.disableCookieDefer = false,
|
|
2470
2471
|
_b)),
|
|
2471
2472
|
cookieDomain: UNDEFINED_VALUE,
|
|
2472
2473
|
cookiePath: UNDEFINED_VALUE
|
|
@@ -2546,16 +2547,99 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
2546
2547
|
var _getCookieFn;
|
|
2547
2548
|
var _setCookieFn;
|
|
2548
2549
|
var _delCookieFn;
|
|
2550
|
+
var _pendingCookies = [];
|
|
2551
|
+
function _formatDeletionValue(path) {
|
|
2552
|
+
var _a;
|
|
2553
|
+
var values = (_a = {},
|
|
2554
|
+
_a[STR_PATH] = path ? path : "/",
|
|
2555
|
+
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
2556
|
+
_a);
|
|
2557
|
+
if (!isIE()) {
|
|
2558
|
+
values["max-age"] = "0";
|
|
2559
|
+
}
|
|
2560
|
+
return _formatCookieValue(STR_EMPTY, values);
|
|
2561
|
+
}
|
|
2562
|
+
function _formatSetCookieValue(value, maxAgeSec, domain, path) {
|
|
2563
|
+
var values = {};
|
|
2564
|
+
var theValue = strTrim(value || STR_EMPTY);
|
|
2565
|
+
var idx = strIndexOf(theValue, ";");
|
|
2566
|
+
if (idx !== -1) {
|
|
2567
|
+
theValue = strTrim(strLeft(value, idx));
|
|
2568
|
+
values = _extractParts(strSubstring(value, idx + 1));
|
|
2569
|
+
}
|
|
2570
|
+
setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
|
|
2571
|
+
if (!isNullOrUndefined(maxAgeSec)) {
|
|
2572
|
+
var _isIE = isIE();
|
|
2573
|
+
if (isUndefined(values[strExpires])) {
|
|
2574
|
+
var nowMs = utcNow();
|
|
2575
|
+
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
2576
|
+
if (expireMs > 0) {
|
|
2577
|
+
var expiry = new Date();
|
|
2578
|
+
expiry.setTime(expireMs);
|
|
2579
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
if (!_isIE) {
|
|
2583
|
+
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
var location = getLocation();
|
|
2587
|
+
if (location && location.protocol === "https:") {
|
|
2588
|
+
setValue(values, "secure", null, null, isUndefined);
|
|
2589
|
+
if (_allowUaSameSite === null) {
|
|
2590
|
+
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
|
|
2591
|
+
}
|
|
2592
|
+
if (_allowUaSameSite) {
|
|
2593
|
+
setValue(values, "SameSite", "None", null, isUndefined);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
setValue(values, STR_PATH, path || _path, null, isUndefined);
|
|
2597
|
+
return _formatCookieValue(theValue, values);
|
|
2598
|
+
}
|
|
2599
|
+
function _removePendingCookie(name) {
|
|
2600
|
+
if (_pendingCookies) {
|
|
2601
|
+
for (var i = _pendingCookies[_DYN_LENGTH$2 ] - 1; i >= 0; i--) {
|
|
2602
|
+
if (_pendingCookies[i].n === name) {
|
|
2603
|
+
_pendingCookies[_DYN_SPLICE ](i, 1);
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
function _flushPendingCookies() {
|
|
2609
|
+
if (areCookiesSupported(logger) && _pendingCookies) {
|
|
2610
|
+
arrForEach(_pendingCookies, function (pendingData) {
|
|
2611
|
+
if (!_isBlockedCookie(cookieMgrConfig, pendingData.n)) {
|
|
2612
|
+
if (pendingData.o === 0 ) {
|
|
2613
|
+
_setCookieFn(pendingData.n, pendingData.v);
|
|
2614
|
+
}
|
|
2615
|
+
else if (pendingData.o === 1 ) {
|
|
2616
|
+
_delCookieFn(pendingData.n, pendingData.v);
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
});
|
|
2620
|
+
_pendingCookies = [];
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2549
2623
|
rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg;
|
|
2550
2624
|
unloadHandler = onConfigChange(rootConfig, function (details) {
|
|
2551
2625
|
details.setDf(details.cfg, rootDefaultConfig);
|
|
2552
2626
|
cookieMgrConfig = details.ref(details.cfg, "cookieCfg");
|
|
2553
2627
|
_path = cookieMgrConfig[STR_PATH ] || "/";
|
|
2554
2628
|
_domain = cookieMgrConfig[STR_DOMAIN ];
|
|
2629
|
+
if (cookieMgrConfig.disableCookieDefer) {
|
|
2630
|
+
_pendingCookies = null;
|
|
2631
|
+
}
|
|
2632
|
+
else if (_pendingCookies === null) {
|
|
2633
|
+
_pendingCookies = [];
|
|
2634
|
+
}
|
|
2635
|
+
var wasEnabled = _enabled;
|
|
2555
2636
|
_enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false;
|
|
2556
2637
|
_getCookieFn = cookieMgrConfig.getCookie || _getCookieValue;
|
|
2557
2638
|
_setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
2558
2639
|
_delCookieFn = cookieMgrConfig.delCookie || _setCookieValue;
|
|
2640
|
+
if (!wasEnabled && _enabled && _pendingCookies) {
|
|
2641
|
+
_flushPendingCookies();
|
|
2642
|
+
}
|
|
2559
2643
|
}, logger);
|
|
2560
2644
|
var cookieMgr = {
|
|
2561
2645
|
isEnabled: function () {
|
|
@@ -2567,55 +2651,52 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
2567
2651
|
return enabled;
|
|
2568
2652
|
},
|
|
2569
2653
|
setEnabled: function (value) {
|
|
2570
|
-
_enabled = value !== false;
|
|
2571
2654
|
cookieMgrConfig[_DYN_ENABLED ] = value;
|
|
2655
|
+
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
2656
|
+
rootConfig[strDisableCookiesUsage] = !value;
|
|
2657
|
+
}
|
|
2572
2658
|
},
|
|
2573
2659
|
set: function (name, value, maxAgeSec, domain, path) {
|
|
2574
2660
|
var result = false;
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
var
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
values = _extractParts(strSubstring(value, idx + 1));
|
|
2582
|
-
}
|
|
2583
|
-
setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
|
|
2584
|
-
if (!isNullOrUndefined(maxAgeSec)) {
|
|
2585
|
-
var _isIE = isIE();
|
|
2586
|
-
if (isUndefined(values[strExpires])) {
|
|
2587
|
-
var nowMs = utcNow();
|
|
2588
|
-
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
2589
|
-
if (expireMs > 0) {
|
|
2590
|
-
var expiry = new Date();
|
|
2591
|
-
expiry.setTime(expireMs);
|
|
2592
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
if (!_isIE) {
|
|
2596
|
-
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
|
2597
|
-
}
|
|
2661
|
+
var isBlocked = _isBlockedCookie(cookieMgrConfig, name);
|
|
2662
|
+
if (!isBlocked) {
|
|
2663
|
+
var cookieValue = _formatSetCookieValue(value, maxAgeSec, domain, path);
|
|
2664
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
2665
|
+
_setCookieFn(name, cookieValue);
|
|
2666
|
+
result = true;
|
|
2598
2667
|
}
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
}
|
|
2668
|
+
else if (_pendingCookies) {
|
|
2669
|
+
_removePendingCookie(name);
|
|
2670
|
+
_pendingCookies[_DYN_PUSH ]({
|
|
2671
|
+
n: name,
|
|
2672
|
+
o: 0 ,
|
|
2673
|
+
v: cookieValue
|
|
2674
|
+
});
|
|
2675
|
+
result = true;
|
|
2608
2676
|
}
|
|
2609
|
-
setValue(values, STR_PATH, path || _path, null, isUndefined);
|
|
2610
|
-
_setCookieFn(name, _formatCookieValue(theValue, values));
|
|
2611
|
-
result = true;
|
|
2612
2677
|
}
|
|
2613
2678
|
return result;
|
|
2614
2679
|
},
|
|
2615
2680
|
get: function (name) {
|
|
2616
2681
|
var value = STR_EMPTY;
|
|
2617
|
-
|
|
2618
|
-
|
|
2682
|
+
var isIgnored = _isIgnoredCookie(cookieMgrConfig, name);
|
|
2683
|
+
if (!isIgnored) {
|
|
2684
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
2685
|
+
value = _getCookieFn(name);
|
|
2686
|
+
}
|
|
2687
|
+
else if (_pendingCookies) {
|
|
2688
|
+
for (var i = _pendingCookies[_DYN_LENGTH$2 ] - 1; i >= 0; i--) {
|
|
2689
|
+
var pendingData = _pendingCookies[i];
|
|
2690
|
+
if (pendingData.n === name) {
|
|
2691
|
+
if (pendingData.o === 0 ) {
|
|
2692
|
+
var cookieValue = pendingData.v;
|
|
2693
|
+
var idx = strIndexOf(cookieValue, ";");
|
|
2694
|
+
value = idx !== -1 ? strTrim(strLeft(cookieValue, idx)) : strTrim(cookieValue);
|
|
2695
|
+
}
|
|
2696
|
+
break;
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2619
2700
|
}
|
|
2620
2701
|
return value;
|
|
2621
2702
|
},
|
|
@@ -2624,20 +2705,21 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
2624
2705
|
if (_isMgrEnabled(cookieMgr)) {
|
|
2625
2706
|
result = cookieMgr.purge(name, path);
|
|
2626
2707
|
}
|
|
2708
|
+
else if (_pendingCookies) {
|
|
2709
|
+
_removePendingCookie(name);
|
|
2710
|
+
_pendingCookies[_DYN_PUSH ]({
|
|
2711
|
+
n: name,
|
|
2712
|
+
o: 1 ,
|
|
2713
|
+
v: _formatDeletionValue(path)
|
|
2714
|
+
});
|
|
2715
|
+
result = true;
|
|
2716
|
+
}
|
|
2627
2717
|
return result;
|
|
2628
2718
|
},
|
|
2629
2719
|
purge: function (name, path) {
|
|
2630
|
-
var _a;
|
|
2631
2720
|
var result = false;
|
|
2632
2721
|
if (areCookiesSupported(logger)) {
|
|
2633
|
-
|
|
2634
|
-
_a[STR_PATH] = path ? path : "/",
|
|
2635
|
-
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
2636
|
-
_a);
|
|
2637
|
-
if (!isIE()) {
|
|
2638
|
-
values["max-age"] = "0";
|
|
2639
|
-
}
|
|
2640
|
-
_delCookieFn(name, _formatCookieValue(STR_EMPTY, values));
|
|
2722
|
+
_delCookieFn(name, _formatDeletionValue(path));
|
|
2641
2723
|
result = true;
|
|
2642
2724
|
}
|
|
2643
2725
|
return result;
|
|
@@ -2645,6 +2727,7 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
2645
2727
|
unload: function (isAsync) {
|
|
2646
2728
|
unloadHandler && unloadHandler.rm();
|
|
2647
2729
|
unloadHandler = null;
|
|
2730
|
+
_pendingCookies = null;
|
|
2648
2731
|
}
|
|
2649
2732
|
};
|
|
2650
2733
|
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
@@ -5988,7 +6071,7 @@ var AnalyticsPlugin = /** @class */ (function (_super) {
|
|
|
5988
6071
|
});
|
|
5989
6072
|
return _this;
|
|
5990
6073
|
}
|
|
5991
|
-
AnalyticsPlugin.Version = '3.3.10-nightly3.
|
|
6074
|
+
AnalyticsPlugin.Version = '3.3.10-nightly3.2508-01';
|
|
5992
6075
|
return AnalyticsPlugin;
|
|
5993
6076
|
}(BaseTelemetryPlugin));
|
|
5994
6077
|
|