@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.
@@ -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) {
@@ -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) && (!configuration.isEnabled('remove-network-errors') || !request.isAborted) && (isRejected(request) || isServerError(request))) {
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
@@ -85,6 +85,8 @@ function proxyXhr() {
85
85
  var hasBeenReported = false;
86
86
 
87
87
  var reportXhr = function reportXhr() {
88
+ _this.removeEventListener('loadend', reportXhr);
89
+
88
90
  if (hasBeenReported) {
89
91
  return;
90
92
  }
@@ -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: feature => includes(enableExperimentalFeatures, feature),
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) {
@@ -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) && (!configuration.isEnabled('remove-network-errors') || !request.isAborted) && (isRejected(request) || isServerError(request))) {
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
@@ -73,6 +73,8 @@ function proxyXhr() {
73
73
  var hasBeenReported = false;
74
74
 
75
75
  var reportXhr = function reportXhr() {
76
+ _this.removeEventListener('loadend', reportXhr);
77
+
76
78
  if (hasBeenReported) {
77
79
  return;
78
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcare/browser-core",
3
- "version": "1.0.10",
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": "af688fabc2f473eea2d9c0219350aa76e2cfa899"
23
+ "gitHead": "e1e2638c408f226504ec32e60dc98c919f75e727"
24
24
  }
@@ -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) => includes(enableExperimentalFeatures, 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 (
@@ -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
- (!configuration.isEnabled('remove-network-errors') ||
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
  })