@microsoft/applicationinsights-react-js 19.3.8-nightly.2507-11 → 19.3.8-nightly.2508-03
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-react-js.js +132 -49
- package/browser/applicationinsights-react-js.js.map +1 -1
- package/browser/applicationinsights-react-js.min.js +2 -2
- package/browser/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.api.json +1 -1
- package/dist/applicationinsights-react-js.d.ts +1 -1
- package/dist/applicationinsights-react-js.js +132 -49
- package/dist/applicationinsights-react-js.js.map +1 -1
- package/dist/applicationinsights-react-js.min.js +2 -2
- package/dist/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.rollup.d.ts +1 -1
- package/dist-esm/AppInsightsContext.js +1 -1
- package/dist-esm/AppInsightsErrorBoundary.js +1 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js +1 -1
- package/dist-esm/ReactPlugin.js +1 -1
- package/dist-esm/applicationinsights-react-js.js +1 -1
- package/dist-esm/useTrackEvent.js +1 -1
- package/dist-esm/useTrackMetric.js +1 -1
- package/dist-esm/withAITracking.js +1 -1
- package/package.json +1 -1
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Plugin, 19.3.8-nightly.
|
|
2
|
+
* Application Insights JavaScript SDK - React Plugin, 19.3.8-nightly.2508-03
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -1687,7 +1687,7 @@
|
|
|
1687
1687
|
return result;
|
|
1688
1688
|
}
|
|
1689
1689
|
|
|
1690
|
-
var version = '3.3.10-nightly3.
|
|
1690
|
+
var version = '3.3.10-nightly3.2508-03';
|
|
1691
1691
|
var instanceName = "." + newId(6);
|
|
1692
1692
|
var _dataUid = 0;
|
|
1693
1693
|
function _canAcceptData(target) {
|
|
@@ -2579,6 +2579,7 @@
|
|
|
2579
2579
|
_b.enabled = UNDEFINED_VALUE,
|
|
2580
2580
|
_b.ignoreCookies = UNDEFINED_VALUE,
|
|
2581
2581
|
_b.blockedCookies = UNDEFINED_VALUE,
|
|
2582
|
+
_b.disableCookieDefer = false,
|
|
2582
2583
|
_b)),
|
|
2583
2584
|
cookieDomain: UNDEFINED_VALUE,
|
|
2584
2585
|
cookiePath: UNDEFINED_VALUE
|
|
@@ -2658,16 +2659,99 @@
|
|
|
2658
2659
|
var _getCookieFn;
|
|
2659
2660
|
var _setCookieFn;
|
|
2660
2661
|
var _delCookieFn;
|
|
2662
|
+
var _pendingCookies = [];
|
|
2663
|
+
function _formatDeletionValue(path) {
|
|
2664
|
+
var _a;
|
|
2665
|
+
var values = (_a = {},
|
|
2666
|
+
_a[STR_PATH] = path ? path : "/",
|
|
2667
|
+
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
2668
|
+
_a);
|
|
2669
|
+
if (!isIE()) {
|
|
2670
|
+
values["max-age"] = "0";
|
|
2671
|
+
}
|
|
2672
|
+
return _formatCookieValue(STR_EMPTY, values);
|
|
2673
|
+
}
|
|
2674
|
+
function _formatSetCookieValue(value, maxAgeSec, domain, path) {
|
|
2675
|
+
var values = {};
|
|
2676
|
+
var theValue = strTrim(value || STR_EMPTY);
|
|
2677
|
+
var idx = strIndexOf(theValue, ";");
|
|
2678
|
+
if (idx !== -1) {
|
|
2679
|
+
theValue = strTrim(strLeft(value, idx));
|
|
2680
|
+
values = _extractParts(strSubstring(value, idx + 1));
|
|
2681
|
+
}
|
|
2682
|
+
setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
|
|
2683
|
+
if (!isNullOrUndefined(maxAgeSec)) {
|
|
2684
|
+
var _isIE = isIE();
|
|
2685
|
+
if (isUndefined(values[strExpires])) {
|
|
2686
|
+
var nowMs = utcNow();
|
|
2687
|
+
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
2688
|
+
if (expireMs > 0) {
|
|
2689
|
+
var expiry = new Date();
|
|
2690
|
+
expiry.setTime(expireMs);
|
|
2691
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
if (!_isIE) {
|
|
2695
|
+
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
var location = getLocation();
|
|
2699
|
+
if (location && location.protocol === "https:") {
|
|
2700
|
+
setValue(values, "secure", null, null, isUndefined);
|
|
2701
|
+
if (_allowUaSameSite === null) {
|
|
2702
|
+
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
|
|
2703
|
+
}
|
|
2704
|
+
if (_allowUaSameSite) {
|
|
2705
|
+
setValue(values, "SameSite", "None", null, isUndefined);
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
setValue(values, STR_PATH, path || _path, null, isUndefined);
|
|
2709
|
+
return _formatCookieValue(theValue, values);
|
|
2710
|
+
}
|
|
2711
|
+
function _removePendingCookie(name) {
|
|
2712
|
+
if (_pendingCookies) {
|
|
2713
|
+
for (var i = _pendingCookies[_DYN_LENGTH ] - 1; i >= 0; i--) {
|
|
2714
|
+
if (_pendingCookies[i].n === name) {
|
|
2715
|
+
_pendingCookies[_DYN_SPLICE ](i, 1);
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
function _flushPendingCookies() {
|
|
2721
|
+
if (areCookiesSupported(logger) && _pendingCookies) {
|
|
2722
|
+
arrForEach(_pendingCookies, function (pendingData) {
|
|
2723
|
+
if (!_isBlockedCookie(cookieMgrConfig, pendingData.n)) {
|
|
2724
|
+
if (pendingData.o === 0 ) {
|
|
2725
|
+
_setCookieFn(pendingData.n, pendingData.v);
|
|
2726
|
+
}
|
|
2727
|
+
else if (pendingData.o === 1 ) {
|
|
2728
|
+
_delCookieFn(pendingData.n, pendingData.v);
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
});
|
|
2732
|
+
_pendingCookies = [];
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2661
2735
|
rootConfig = createDynamicConfig(rootConfig || _globalCookieConfig, null, logger).cfg;
|
|
2662
2736
|
unloadHandler = onConfigChange(rootConfig, function (details) {
|
|
2663
2737
|
details.setDf(details.cfg, rootDefaultConfig);
|
|
2664
2738
|
cookieMgrConfig = details.ref(details.cfg, "cookieCfg");
|
|
2665
2739
|
_path = cookieMgrConfig[STR_PATH ] || "/";
|
|
2666
2740
|
_domain = cookieMgrConfig[STR_DOMAIN ];
|
|
2741
|
+
if (cookieMgrConfig.disableCookieDefer) {
|
|
2742
|
+
_pendingCookies = null;
|
|
2743
|
+
}
|
|
2744
|
+
else if (_pendingCookies === null) {
|
|
2745
|
+
_pendingCookies = [];
|
|
2746
|
+
}
|
|
2747
|
+
var wasEnabled = _enabled;
|
|
2667
2748
|
_enabled = _isCfgEnabled(rootConfig, cookieMgrConfig) !== false;
|
|
2668
2749
|
_getCookieFn = cookieMgrConfig.getCookie || _getCookieValue;
|
|
2669
2750
|
_setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
2670
2751
|
_delCookieFn = cookieMgrConfig.delCookie || _setCookieValue;
|
|
2752
|
+
if (!wasEnabled && _enabled && _pendingCookies) {
|
|
2753
|
+
_flushPendingCookies();
|
|
2754
|
+
}
|
|
2671
2755
|
}, logger);
|
|
2672
2756
|
var cookieMgr = {
|
|
2673
2757
|
isEnabled: function () {
|
|
@@ -2679,55 +2763,52 @@
|
|
|
2679
2763
|
return enabled;
|
|
2680
2764
|
},
|
|
2681
2765
|
setEnabled: function (value) {
|
|
2682
|
-
_enabled = value !== false;
|
|
2683
2766
|
cookieMgrConfig[_DYN_ENABLED ] = value;
|
|
2767
|
+
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
2768
|
+
rootConfig[strDisableCookiesUsage] = !value;
|
|
2769
|
+
}
|
|
2684
2770
|
},
|
|
2685
2771
|
set: function (name, value, maxAgeSec, domain, path) {
|
|
2686
2772
|
var result = false;
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
var
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
values = _extractParts(strSubstring(value, idx + 1));
|
|
2694
|
-
}
|
|
2695
|
-
setValue(values, STR_DOMAIN, domain || _domain, isTruthy, isUndefined);
|
|
2696
|
-
if (!isNullOrUndefined(maxAgeSec)) {
|
|
2697
|
-
var _isIE = isIE();
|
|
2698
|
-
if (isUndefined(values[strExpires])) {
|
|
2699
|
-
var nowMs = utcNow();
|
|
2700
|
-
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
2701
|
-
if (expireMs > 0) {
|
|
2702
|
-
var expiry = new Date();
|
|
2703
|
-
expiry.setTime(expireMs);
|
|
2704
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
|
2705
|
-
}
|
|
2706
|
-
}
|
|
2707
|
-
if (!_isIE) {
|
|
2708
|
-
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
|
2709
|
-
}
|
|
2773
|
+
var isBlocked = _isBlockedCookie(cookieMgrConfig, name);
|
|
2774
|
+
if (!isBlocked) {
|
|
2775
|
+
var cookieValue = _formatSetCookieValue(value, maxAgeSec, domain, path);
|
|
2776
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
2777
|
+
_setCookieFn(name, cookieValue);
|
|
2778
|
+
result = true;
|
|
2710
2779
|
}
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
}
|
|
2780
|
+
else if (_pendingCookies) {
|
|
2781
|
+
_removePendingCookie(name);
|
|
2782
|
+
_pendingCookies[_DYN_PUSH ]({
|
|
2783
|
+
n: name,
|
|
2784
|
+
o: 0 ,
|
|
2785
|
+
v: cookieValue
|
|
2786
|
+
});
|
|
2787
|
+
result = true;
|
|
2720
2788
|
}
|
|
2721
|
-
setValue(values, STR_PATH, path || _path, null, isUndefined);
|
|
2722
|
-
_setCookieFn(name, _formatCookieValue(theValue, values));
|
|
2723
|
-
result = true;
|
|
2724
2789
|
}
|
|
2725
2790
|
return result;
|
|
2726
2791
|
},
|
|
2727
2792
|
get: function (name) {
|
|
2728
2793
|
var value = STR_EMPTY;
|
|
2729
|
-
|
|
2730
|
-
|
|
2794
|
+
var isIgnored = _isIgnoredCookie(cookieMgrConfig, name);
|
|
2795
|
+
if (!isIgnored) {
|
|
2796
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
2797
|
+
value = _getCookieFn(name);
|
|
2798
|
+
}
|
|
2799
|
+
else if (_pendingCookies) {
|
|
2800
|
+
for (var i = _pendingCookies[_DYN_LENGTH ] - 1; i >= 0; i--) {
|
|
2801
|
+
var pendingData = _pendingCookies[i];
|
|
2802
|
+
if (pendingData.n === name) {
|
|
2803
|
+
if (pendingData.o === 0 ) {
|
|
2804
|
+
var cookieValue = pendingData.v;
|
|
2805
|
+
var idx = strIndexOf(cookieValue, ";");
|
|
2806
|
+
value = idx !== -1 ? strTrim(strLeft(cookieValue, idx)) : strTrim(cookieValue);
|
|
2807
|
+
}
|
|
2808
|
+
break;
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2731
2812
|
}
|
|
2732
2813
|
return value;
|
|
2733
2814
|
},
|
|
@@ -2736,20 +2817,21 @@
|
|
|
2736
2817
|
if (_isMgrEnabled(cookieMgr)) {
|
|
2737
2818
|
result = cookieMgr.purge(name, path);
|
|
2738
2819
|
}
|
|
2820
|
+
else if (_pendingCookies) {
|
|
2821
|
+
_removePendingCookie(name);
|
|
2822
|
+
_pendingCookies[_DYN_PUSH ]({
|
|
2823
|
+
n: name,
|
|
2824
|
+
o: 1 ,
|
|
2825
|
+
v: _formatDeletionValue(path)
|
|
2826
|
+
});
|
|
2827
|
+
result = true;
|
|
2828
|
+
}
|
|
2739
2829
|
return result;
|
|
2740
2830
|
},
|
|
2741
2831
|
purge: function (name, path) {
|
|
2742
|
-
var _a;
|
|
2743
2832
|
var result = false;
|
|
2744
2833
|
if (areCookiesSupported(logger)) {
|
|
2745
|
-
|
|
2746
|
-
_a[STR_PATH] = path ? path : "/",
|
|
2747
|
-
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
2748
|
-
_a);
|
|
2749
|
-
if (!isIE()) {
|
|
2750
|
-
values["max-age"] = "0";
|
|
2751
|
-
}
|
|
2752
|
-
_delCookieFn(name, _formatCookieValue(STR_EMPTY, values));
|
|
2834
|
+
_delCookieFn(name, _formatDeletionValue(path));
|
|
2753
2835
|
result = true;
|
|
2754
2836
|
}
|
|
2755
2837
|
return result;
|
|
@@ -2757,6 +2839,7 @@
|
|
|
2757
2839
|
unload: function (isAsync) {
|
|
2758
2840
|
unloadHandler && unloadHandler.rm();
|
|
2759
2841
|
unloadHandler = null;
|
|
2842
|
+
_pendingCookies = null;
|
|
2760
2843
|
}
|
|
2761
2844
|
};
|
|
2762
2845
|
cookieMgr[strConfigCookieMgr] = cookieMgr;
|