Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@datadog/browser-core

Package Overview
Dependencies
Maintainers
1
Versions
261
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-core - npm Package Compare versions

Comparing version 1.15.0 to 1.15.1

52

cjs/xhrProxy.js

@@ -45,30 +45,32 @@ "use strict";

});
XMLHttpRequest.prototype.send = function (body) {
XMLHttpRequest.prototype.send = internalMonitoring_1.monitor(function (body) {
var _this = this;
this._datadog_xhr.startTime = performance.now();
var originalOnreadystatechange = this.onreadystatechange;
this.onreadystatechange = function () {
if (this.readyState === XMLHttpRequest.DONE) {
internalMonitoring_1.monitor(reportXhr)();
}
if (originalOnreadystatechange) {
originalOnreadystatechange.apply(this, arguments);
}
};
var hasBeenReported = false;
var reportXhr = function () {
if (hasBeenReported) {
return;
}
hasBeenReported = true;
_this._datadog_xhr.duration = performance.now() - _this._datadog_xhr.startTime;
_this._datadog_xhr.response = _this.response;
_this._datadog_xhr.status = _this.status;
onRequestCompleteCallbacks.forEach(function (callback) { return callback(_this._datadog_xhr); });
};
this.addEventListener('loadend', internalMonitoring_1.monitor(reportXhr));
beforeSendCallbacks.forEach(function (callback) { return callback(_this._datadog_xhr); });
if (this._datadog_xhr) {
this._datadog_xhr.startTime = performance.now();
var originalOnreadystatechange_1 = this.onreadystatechange;
this.onreadystatechange = function () {
if (this.readyState === XMLHttpRequest.DONE) {
internalMonitoring_1.monitor(reportXhr_1)();
}
if (originalOnreadystatechange_1) {
originalOnreadystatechange_1.apply(this, arguments);
}
};
var hasBeenReported_1 = false;
var reportXhr_1 = function () {
if (hasBeenReported_1) {
return;
}
hasBeenReported_1 = true;
_this._datadog_xhr.duration = performance.now() - _this._datadog_xhr.startTime;
_this._datadog_xhr.response = _this.response;
_this._datadog_xhr.status = _this.status;
onRequestCompleteCallbacks.forEach(function (callback) { return callback(_this._datadog_xhr); });
};
this.addEventListener('loadend', internalMonitoring_1.monitor(reportXhr_1));
beforeSendCallbacks.forEach(function (callback) { return callback(_this._datadog_xhr); });
}
return originalXhrSend.apply(this, arguments);
};
});
}
//# sourceMappingURL=xhrProxy.js.map

@@ -41,30 +41,32 @@ import { monitor } from './internalMonitoring';

});
XMLHttpRequest.prototype.send = function (body) {
XMLHttpRequest.prototype.send = monitor(function (body) {
var _this = this;
this._datadog_xhr.startTime = performance.now();
var originalOnreadystatechange = this.onreadystatechange;
this.onreadystatechange = function () {
if (this.readyState === XMLHttpRequest.DONE) {
monitor(reportXhr)();
}
if (originalOnreadystatechange) {
originalOnreadystatechange.apply(this, arguments);
}
};
var hasBeenReported = false;
var reportXhr = function () {
if (hasBeenReported) {
return;
}
hasBeenReported = true;
_this._datadog_xhr.duration = performance.now() - _this._datadog_xhr.startTime;
_this._datadog_xhr.response = _this.response;
_this._datadog_xhr.status = _this.status;
onRequestCompleteCallbacks.forEach(function (callback) { return callback(_this._datadog_xhr); });
};
this.addEventListener('loadend', monitor(reportXhr));
beforeSendCallbacks.forEach(function (callback) { return callback(_this._datadog_xhr); });
if (this._datadog_xhr) {
this._datadog_xhr.startTime = performance.now();
var originalOnreadystatechange_1 = this.onreadystatechange;
this.onreadystatechange = function () {
if (this.readyState === XMLHttpRequest.DONE) {
monitor(reportXhr_1)();
}
if (originalOnreadystatechange_1) {
originalOnreadystatechange_1.apply(this, arguments);
}
};
var hasBeenReported_1 = false;
var reportXhr_1 = function () {
if (hasBeenReported_1) {
return;
}
hasBeenReported_1 = true;
_this._datadog_xhr.duration = performance.now() - _this._datadog_xhr.startTime;
_this._datadog_xhr.response = _this.response;
_this._datadog_xhr.status = _this.status;
onRequestCompleteCallbacks.forEach(function (callback) { return callback(_this._datadog_xhr); });
};
this.addEventListener('loadend', monitor(reportXhr_1));
beforeSendCallbacks.forEach(function (callback) { return callback(_this._datadog_xhr); });
}
return originalXhrSend.apply(this, arguments);
};
});
}
//# sourceMappingURL=xhrProxy.js.map
{
"name": "@datadog/browser-core",
"version": "1.15.0",
"version": "1.15.1",
"license": "Apache-2.0",

@@ -26,3 +26,3 @@ "main": "cjs/index.js",

},
"gitHead": "ec0779221049b205cd64bdb4ec838f39ea1ac0c9"
"gitHead": "7d7cef5e04a1cffeb5773501b77b3b63e7709691"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc