@cloudcare/browser-core 1.0.10 → 1.0.14
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/cjs/configuration.js +1 -1
- package/cjs/errorCollection.js +1 -1
- package/cjs/xhrProxy.js +2 -0
- package/esm/configuration.js +4 -2
- package/esm/errorCollection.js +1 -1
- package/esm/xhrProxy.js +2 -0
- package/package.json +2 -2
- package/src/configuration.js +2 -2
- package/src/errorCollection.js +1 -2
- package/src/xhrProxy.js +1 -1
package/cjs/configuration.js
CHANGED
|
@@ -105,7 +105,7 @@ function commonInit(userConfiguration, buildEnv) {
|
|
|
105
105
|
transportConfiguration.trackInteractions = !!userConfiguration.trackInteractions;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
return (0, _tools.extend2Lev)(DEFAULT_CONFIGURATION, transportConfiguration);
|
|
108
|
+
return (0, _tools.extend2Lev)({}, DEFAULT_CONFIGURATION, transportConfiguration);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
function mustUseSecureCookie(userConfiguration) {
|
package/cjs/errorCollection.js
CHANGED
|
@@ -113,7 +113,7 @@ function trackNetworkError(configuration, errorObservable) {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
function handleCompleteRequest(type, request) {
|
|
116
|
-
if (!(0, _configuration.isIntakeRequest)(request.url, configuration) &&
|
|
116
|
+
if (!(0, _configuration.isIntakeRequest)(request.url, configuration) && !request.isAborted && (isRejected(request) || isServerError(request))) {
|
|
117
117
|
errorObservable.notify({
|
|
118
118
|
message: format(type) + ' error ' + request.method + ' ' + request.url,
|
|
119
119
|
resource: {
|
package/cjs/xhrProxy.js
CHANGED
package/esm/configuration.js
CHANGED
|
@@ -69,7 +69,9 @@ export function commonInit(userConfiguration, buildEnv) {
|
|
|
69
69
|
sdkName: buildEnv.sdkName,
|
|
70
70
|
datakitUrl: getDatakitUrl(userConfiguration.datakitUrl || userConfiguration.datakitOrigin),
|
|
71
71
|
logsEndpoint: getLogsEndPoint(userConfiguration.datakitOrigin),
|
|
72
|
-
isEnabled:
|
|
72
|
+
isEnabled: function isEnabled(feature) {
|
|
73
|
+
return includes(enableExperimentalFeatures, feature);
|
|
74
|
+
},
|
|
73
75
|
cookieOptions: buildCookieOptions(userConfiguration)
|
|
74
76
|
};
|
|
75
77
|
|
|
@@ -89,7 +91,7 @@ export function commonInit(userConfiguration, buildEnv) {
|
|
|
89
91
|
transportConfiguration.trackInteractions = !!userConfiguration.trackInteractions;
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
return extend2Lev(DEFAULT_CONFIGURATION, transportConfiguration);
|
|
94
|
+
return extend2Lev({}, DEFAULT_CONFIGURATION, transportConfiguration);
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
function mustUseSecureCookie(userConfiguration) {
|
package/esm/errorCollection.js
CHANGED
|
@@ -87,7 +87,7 @@ export function trackNetworkError(configuration, errorObservable) {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
function handleCompleteRequest(type, request) {
|
|
90
|
-
if (!isIntakeRequest(request.url, configuration) &&
|
|
90
|
+
if (!isIntakeRequest(request.url, configuration) && !request.isAborted && (isRejected(request) || isServerError(request))) {
|
|
91
91
|
errorObservable.notify({
|
|
92
92
|
message: format(type) + ' error ' + request.method + ' ' + request.url,
|
|
93
93
|
resource: {
|
package/esm/xhrProxy.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcare/browser-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"author": "dataflux",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"description": "DataFlux RUM Web 端数据指标监控",
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "e1e2638c408f226504ec32e60dc98c919f75e727"
|
|
24
24
|
}
|
package/src/configuration.js
CHANGED
|
@@ -74,7 +74,7 @@ export function commonInit(userConfiguration, buildEnv) {
|
|
|
74
74
|
userConfiguration.datakitUrl || userConfiguration.datakitOrigin
|
|
75
75
|
),
|
|
76
76
|
logsEndpoint: getLogsEndPoint(userConfiguration.datakitOrigin),
|
|
77
|
-
isEnabled: (feature)
|
|
77
|
+
isEnabled: function(feature) {return includes(enableExperimentalFeatures, feature)},
|
|
78
78
|
cookieOptions: buildCookieOptions(userConfiguration)
|
|
79
79
|
}
|
|
80
80
|
if ('allowedDDTracingOrigins' in userConfiguration) {
|
|
@@ -94,7 +94,7 @@ export function commonInit(userConfiguration, buildEnv) {
|
|
|
94
94
|
if ('trackInteractions' in userConfiguration) {
|
|
95
95
|
transportConfiguration.trackInteractions = !!userConfiguration.trackInteractions
|
|
96
96
|
}
|
|
97
|
-
return extend2Lev(DEFAULT_CONFIGURATION, transportConfiguration)
|
|
97
|
+
return extend2Lev({}, DEFAULT_CONFIGURATION, transportConfiguration)
|
|
98
98
|
}
|
|
99
99
|
function mustUseSecureCookie(userConfiguration) {
|
|
100
100
|
return (
|
package/src/errorCollection.js
CHANGED
|
@@ -108,8 +108,7 @@ export function trackNetworkError(configuration, errorObservable) {
|
|
|
108
108
|
function handleCompleteRequest(type, request) {
|
|
109
109
|
if (
|
|
110
110
|
!isIntakeRequest(request.url, configuration) &&
|
|
111
|
-
|
|
112
|
-
!request.isAborted) &&
|
|
111
|
+
!request.isAborted &&
|
|
113
112
|
(isRejected(request) || isServerError(request))
|
|
114
113
|
) {
|
|
115
114
|
errorObservable.notify({
|
package/src/xhrProxy.js
CHANGED
|
@@ -71,6 +71,7 @@ function proxyXhr() {
|
|
|
71
71
|
|
|
72
72
|
var hasBeenReported = false
|
|
73
73
|
var reportXhr = function () {
|
|
74
|
+
_this.removeEventListener('loadend', reportXhr)
|
|
74
75
|
if (hasBeenReported) {
|
|
75
76
|
return
|
|
76
77
|
}
|
|
@@ -83,7 +84,6 @@ function proxyXhr() {
|
|
|
83
84
|
response: _this.response,
|
|
84
85
|
status: _this.status
|
|
85
86
|
})
|
|
86
|
-
|
|
87
87
|
each(onRequestCompleteCallbacks, function (callback) {
|
|
88
88
|
callback(xhrCompleteContext, _this)
|
|
89
89
|
})
|