Socket
Socket
Sign inDemoInstall

@datadog/browser-core

Package Overview
Dependencies
Maintainers
1
Versions
256
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.7.0 to 1.7.1

cjs/urlPolyfill.d.ts

1

cjs/index.d.ts

@@ -9,4 +9,5 @@ export { DEFAULT_CONFIGURATION, Configuration, UserConfiguration } from './configuration';

export { HttpRequest, Batch } from './transport';
export * from './urlPolyfill';
export * from './utils';
export { areCookiesAuthorized, getCookie, setCookie, COOKIE_ACCESS_DELAY } from './cookie';
export * from './specHelper';

@@ -31,2 +31,3 @@ "use strict";

exports.Batch = transport_1.Batch;
tslib_1.__exportStar(require("./urlPolyfill"), exports);
tslib_1.__exportStar(require("./utils"), exports);

@@ -33,0 +34,0 @@ var cookie_1 = require("./cookie");

2

cjs/requestCollection.d.ts

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

import 'url-polyfill';
import { Observable } from './observable';

@@ -22,4 +21,3 @@ export declare enum RequestType {

export declare function trackFetch(observable: RequestObservable): void;
export declare function normalizeUrl(url: string): string;
export declare function isRejected(request: RequestDetails): boolean;
export declare function isServerError(request: RequestDetails): boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
require("url-polyfill");
var errorCollection_1 = require("./errorCollection");

@@ -9,2 +8,3 @@ var internalMonitoring_1 = require("./internalMonitoring");

var tracekit_1 = require("./tracekit");
var urlPolyfill_1 = require("./urlPolyfill");
var RequestType;

@@ -52,3 +52,3 @@ (function (RequestType) {

type: RequestType.XHR,
url: normalizeUrl(_this._datadog_xhr.url),
url: urlPolyfill_1.normalizeUrl(_this._datadog_xhr.url),
});

@@ -86,3 +86,3 @@ };

duration = performance.now() - startTime;
url = normalizeUrl((typeof input === 'object' && input.url) || input);
url = urlPolyfill_1.normalizeUrl((typeof input === 'object' && input.url) || input);
if (!('stack' in response || response instanceof Error)) return [3 /*break*/, 1];

@@ -138,6 +138,2 @@ stackTrace = tracekit_1.computeStackTrace(response);

exports.trackFetch = trackFetch;
function normalizeUrl(url) {
return new URL(url, window.location.origin).href;
}
exports.normalizeUrl = normalizeUrl;
function isRejected(request) {

@@ -144,0 +140,0 @@ return request.status === 0 && request.responseType !== 'opaque';

@@ -65,1 +65,7 @@ export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

export declare function getGlobalObject<T>(): T;
export declare function getLocationOrigin(): string;
/**
* IE fallback
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/origin
*/
export declare function getLinkElementOrigin(element: Location | HTMLAnchorElement | URL): string;

@@ -190,2 +190,18 @@ "use strict";

exports.getGlobalObject = getGlobalObject;
function getLocationOrigin() {
return getLinkElementOrigin(window.location);
}
exports.getLocationOrigin = getLocationOrigin;
/**
* IE fallback
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/origin
*/
function getLinkElementOrigin(element) {
if (element.origin) {
return element.origin;
}
var sanitizedHost = element.host.replace(/(:80|:443)$/, '');
return element.protocol + "//" + sanitizedHost;
}
exports.getLinkElementOrigin = getLinkElementOrigin;
//# sourceMappingURL=utils.js.map

@@ -9,4 +9,5 @@ export { DEFAULT_CONFIGURATION, Configuration, UserConfiguration } from './configuration';

export { HttpRequest, Batch } from './transport';
export * from './urlPolyfill';
export * from './utils';
export { areCookiesAuthorized, getCookie, setCookie, COOKIE_ACCESS_DELAY } from './cookie';
export * from './specHelper';

@@ -11,2 +11,3 @@ export { DEFAULT_CONFIGURATION } from './configuration';

export { HttpRequest, Batch } from './transport';
export * from './urlPolyfill';
export * from './utils';

@@ -13,0 +14,0 @@ export { areCookiesAuthorized, getCookie, setCookie, COOKIE_ACCESS_DELAY } from './cookie';

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

import 'url-polyfill';
import { Observable } from './observable';

@@ -22,4 +21,3 @@ export declare enum RequestType {

export declare function trackFetch(observable: RequestObservable): void;
export declare function normalizeUrl(url: string): string;
export declare function isRejected(request: RequestDetails): boolean;
export declare function isServerError(request: RequestDetails): boolean;
import * as tslib_1 from "tslib";
import 'url-polyfill';
import { toStackTraceString } from './errorCollection';

@@ -7,2 +6,3 @@ import { monitor } from './internalMonitoring';

import { computeStackTrace } from './tracekit';
import { normalizeUrl } from './urlPolyfill';
export var RequestType;

@@ -131,5 +131,2 @@ (function (RequestType) {

}
export function normalizeUrl(url) {
return new URL(url, window.location.origin).href;
}
export function isRejected(request) {

@@ -136,0 +133,0 @@ return request.status === 0 && request.responseType !== 'opaque';

@@ -65,1 +65,7 @@ export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

export declare function getGlobalObject<T>(): T;
export declare function getLocationOrigin(): string;
/**
* IE fallback
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/origin
*/
export declare function getLinkElementOrigin(element: Location | HTMLAnchorElement | URL): string;

@@ -171,2 +171,16 @@ export var ONE_SECOND = 1000;

}
export function getLocationOrigin() {
return getLinkElementOrigin(window.location);
}
/**
* IE fallback
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/origin
*/
export function getLinkElementOrigin(element) {
if (element.origin) {
return element.origin;
}
var sanitizedHost = element.host.replace(/(:80|:443)$/, '');
return element.protocol + "//" + sanitizedHost;
}
//# sourceMappingURL=utils.js.map
{
"name": "@datadog/browser-core",
"version": "1.7.0",
"version": "1.7.1",
"license": "Apache-2.0",

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

"lodash.merge": "4.6.2",
"tslib": "1.10.0",
"url-polyfill": "1.1.7"
"tslib": "1.10.0"
},

@@ -31,3 +30,3 @@ "devDependencies": {

},
"gitHead": "dfd227a80feb3de6a4115de746c2eba520bcfe8c"
"gitHead": "3c877598f38f3745388ad2516416f0f064acaf78"
}

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