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

@datadog/browser-core

Package Overview
Dependencies
Maintainers
1
Versions
258
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 4.11.2 to 4.11.3

2

cjs/boot/init.js

@@ -9,3 +9,3 @@ "use strict";

var publicApi = (0, utils_1.assign)({
version: "4.11.2",
version: "4.11.3",
// This API method is intentionally not monitored, since the only thing executed is the

@@ -12,0 +12,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and

@@ -28,5 +28,5 @@ "use strict";

var parameters = 'ddsource=browser' +
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.11.2")].concat(tags).join(','))) +
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.11.3")].concat(tags).join(','))) +
"&dd-api-key=".concat(clientToken) +
"&dd-evp-origin-version=".concat(encodeURIComponent("4.11.2")) +
"&dd-evp-origin-version=".concat(encodeURIComponent("4.11.3")) +
'&dd-evp-origin=browser' +

@@ -33,0 +33,0 @@ "&dd-request-id=".concat((0, utils_1.generateUUID)());

@@ -40,3 +40,3 @@ "use strict";

service: 'browser-sdk',
version: "4.11.2",
version: "4.11.3",
source: 'browser',

@@ -43,0 +43,0 @@ _dd: {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.canUseEventBridge = exports.getEventBridge = void 0;
var __1 = require("..");
var utils_1 = require("../tools/utils");
function getEventBridge() {

@@ -22,3 +22,3 @@ var eventBridgeGlobal = getEventBridgeGlobal();

var _a;
if (hostname === void 0) { hostname = (_a = (0, __1.getGlobalObject)().location) === null || _a === void 0 ? void 0 : _a.hostname; }
if (hostname === void 0) { hostname = (_a = (0, utils_1.getGlobalObject)().location) === null || _a === void 0 ? void 0 : _a.hostname; }
var bridge = getEventBridge();

@@ -34,4 +34,4 @@ return (!!bridge &&

function getEventBridgeGlobal() {
return (0, __1.getGlobalObject)().DatadogEventBridge;
return (0, utils_1.getGlobalObject)().DatadogEventBridge;
}
//# sourceMappingURL=eventBridge.js.map

@@ -10,3 +10,3 @@ "use strict";

function startFlushFailedSendBeacons() {
if (!(0, configuration_1.isExperimentalFeatureEnabled)('lower-batch-size'))
if (!(0, configuration_1.isExperimentalFeatureEnabled)('failed-sendbeacon'))
return;

@@ -18,3 +18,3 @@ // delay the computation to prevent the SDK from blocking the main thread on init

function addFailedSendBeacon(endpointType, size, reason) {
if (!(0, configuration_1.isExperimentalFeatureEnabled)('lower-batch-size'))
if (!(0, configuration_1.isExperimentalFeatureEnabled)('failed-sendbeacon'))
return;

@@ -24,3 +24,3 @@ var failSendBeaconLog = {

endpointType: endpointType,
version: "4.11.2",
version: "4.11.3",
connection: navigator.connection ? navigator.connection.effectiveType : undefined,

@@ -27,0 +27,0 @@ onLine: navigator.onLine,

@@ -14,3 +14,3 @@ import type { EndpointBuilder } from '../domain/configuration';

constructor(endpointBuilder: EndpointBuilder, bytesLimit: number);
send(data: string | FormData, bytesCount: number, reason?: string): void;
send(data: string | FormData, bytesCount: number, flushReason?: string): void;
}

@@ -19,3 +19,3 @@ "use strict";

}
HttpRequest.prototype.send = function (data, bytesCount, reason) {
HttpRequest.prototype.send = function (data, bytesCount, flushReason) {
var url = this.endpointBuilder.build();

@@ -29,3 +29,3 @@ var canUseBeacon = !!navigator.sendBeacon && bytesCount < this.bytesLimit;

}
(0, failedSendBeacon_1.addFailedSendBeacon)(this.endpointBuilder.endpointType, bytesCount, reason);
(0, failedSendBeacon_1.addFailedSendBeacon)(this.endpointBuilder.endpointType, bytesCount, flushReason);
}

@@ -32,0 +32,0 @@ catch (e) {

@@ -6,3 +6,3 @@ import { catchUserErrors } from '../tools/catchUserErrors';

var publicApi = assign({
version: "4.11.2",
version: "4.11.3",
// This API method is intentionally not monitored, since the only thing executed is the

@@ -9,0 +9,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and

@@ -25,5 +25,5 @@ import { timeStampNow } from '../../tools/timeUtils';

var parameters = 'ddsource=browser' +
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.11.2")].concat(tags).join(','))) +
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.11.3")].concat(tags).join(','))) +
"&dd-api-key=".concat(clientToken) +
"&dd-evp-origin-version=".concat(encodeURIComponent("4.11.2")) +
"&dd-evp-origin-version=".concat(encodeURIComponent("4.11.3")) +
'&dd-evp-origin=browser' +

@@ -30,0 +30,0 @@ "&dd-request-id=".concat(generateUUID());

@@ -37,3 +37,3 @@ import { ConsoleApiName } from '../../tools/display';

service: 'browser-sdk',
version: "4.11.2",
version: "4.11.3",
source: 'browser',

@@ -40,0 +40,0 @@ _dd: {

@@ -1,2 +0,2 @@

import { getGlobalObject } from '..';
import { getGlobalObject } from '../tools/utils';
export function getEventBridge() {

@@ -3,0 +3,0 @@ var eventBridgeGlobal = getEventBridgeGlobal();

@@ -7,3 +7,3 @@ import { isExperimentalFeatureEnabled } from '../domain/configuration';

export function startFlushFailedSendBeacons() {
if (!isExperimentalFeatureEnabled('lower-batch-size'))
if (!isExperimentalFeatureEnabled('failed-sendbeacon'))
return;

@@ -14,3 +14,3 @@ // delay the computation to prevent the SDK from blocking the main thread on init

export function addFailedSendBeacon(endpointType, size, reason) {
if (!isExperimentalFeatureEnabled('lower-batch-size'))
if (!isExperimentalFeatureEnabled('failed-sendbeacon'))
return;

@@ -20,3 +20,3 @@ var failSendBeaconLog = {

endpointType: endpointType,
version: "4.11.2",
version: "4.11.3",
connection: navigator.connection ? navigator.connection.effectiveType : undefined,

@@ -23,0 +23,0 @@ onLine: navigator.onLine,

@@ -14,3 +14,3 @@ import type { EndpointBuilder } from '../domain/configuration';

constructor(endpointBuilder: EndpointBuilder, bytesLimit: number);
send(data: string | FormData, bytesCount: number, reason?: string): void;
send(data: string | FormData, bytesCount: number, flushReason?: string): void;
}

@@ -16,3 +16,3 @@ import { addTelemetryError } from '../domain/telemetry';

}
HttpRequest.prototype.send = function (data, bytesCount, reason) {
HttpRequest.prototype.send = function (data, bytesCount, flushReason) {
var url = this.endpointBuilder.build();

@@ -26,3 +26,3 @@ var canUseBeacon = !!navigator.sendBeacon && bytesCount < this.bytesLimit;

}
addFailedSendBeacon(this.endpointBuilder.endpointType, bytesCount, reason);
addFailedSendBeacon(this.endpointBuilder.endpointType, bytesCount, flushReason);
}

@@ -29,0 +29,0 @@ catch (e) {

{
"name": "@datadog/browser-core",
"version": "4.11.2",
"version": "4.11.3",
"license": "Apache-2.0",

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

},
"gitHead": "69e74c5a61a62c63e87bc85d3da434c983afc179"
"gitHead": "2833c9db3336b373ae24804293321f3c6cf2151c"
}

@@ -1,2 +0,2 @@

import { getGlobalObject } from '..'
import { getGlobalObject } from '../tools/utils'

@@ -3,0 +3,0 @@ export interface BrowserWindowWithEventBridge extends Window {

@@ -31,5 +31,5 @@ import type { Clock } from '../../test/specHelper'

describe('when ff lower-batch-size enabled', () => {
describe('when ff failed-sendbeacon enabled', () => {
beforeEach(() => {
updateExperimentalFeatures(['lower-batch-size'])
updateExperimentalFeatures(['failed-sendbeacon'])
})

@@ -62,3 +62,3 @@

describe('when ff lower-batch-size disabled', () => {
describe('when ff failed-sendbeacon disabled', () => {
it('should not flush failed sendBeacon asynchronously', () => {

@@ -65,0 +65,0 @@ startFlushFailedSendBeacons()

@@ -12,3 +12,3 @@ import { isExperimentalFeatureEnabled } from '../domain/configuration'

export function startFlushFailedSendBeacons() {
if (!isExperimentalFeatureEnabled('lower-batch-size')) return
if (!isExperimentalFeatureEnabled('failed-sendbeacon')) return

@@ -20,3 +20,3 @@ // delay the computation to prevent the SDK from blocking the main thread on init

export function addFailedSendBeacon(endpointType: string, size: number, reason?: string) {
if (!isExperimentalFeatureEnabled('lower-batch-size')) return
if (!isExperimentalFeatureEnabled('failed-sendbeacon')) return

@@ -23,0 +23,0 @@ const failSendBeaconLog = {

@@ -16,3 +16,3 @@ import type { EndpointBuilder } from '../domain/configuration'

send(data: string | FormData, bytesCount: number, reason?: string) {
send(data: string | FormData, bytesCount: number, flushReason?: string) {
const url = this.endpointBuilder.build()

@@ -23,2 +23,3 @@ const canUseBeacon = !!navigator.sendBeacon && bytesCount < this.bytesLimit

const isQueued = navigator.sendBeacon(url, data)
if (isQueued) {

@@ -28,3 +29,3 @@ return

addFailedSendBeacon(this.endpointBuilder.endpointType, bytesCount, reason)
addFailedSendBeacon(this.endpointBuilder.endpointType, bytesCount, flushReason)
} catch (e) {

@@ -31,0 +32,0 @@ reportBeaconError(e)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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