@sentry/browser
Advanced tools
Comparing version 4.6.4 to 4.6.5
@@ -13,3 +13,2 @@ import { Breadcrumb, Integration, SentryBreadcrumbHint } from '@sentry/types'; | ||
interface BreadcrumbIntegrations { | ||
beacon?: boolean; | ||
console?: boolean; | ||
@@ -39,4 +38,2 @@ dom?: boolean; | ||
/** JSDoc */ | ||
private instrumentBeacon; | ||
/** JSDoc */ | ||
private instrumentConsole; | ||
@@ -43,0 +40,0 @@ /** JSDoc */ |
export { BaseTransport } from './base'; | ||
export { FetchTransport } from './fetch'; | ||
export { XHRTransport } from './xhr'; | ||
export { BeaconTransport } from './beacon'; |
export declare const SDK_NAME = "sentry.javascript.browser"; | ||
export declare const SDK_VERSION = "4.6.4"; | ||
export declare const SDK_VERSION = "4.6.5"; |
import { BaseBackend, SentryError } from '@sentry/core/esm'; | ||
import { Severity } from '@sentry/types/esm'; | ||
import { isDOMError, isDOMException, isError, isErrorEvent, isPlainObject } from '@sentry/utils/esm/is'; | ||
import { supportsBeacon, supportsFetch } from '@sentry/utils/esm/supports'; | ||
import { supportsFetch } from '@sentry/utils/esm/supports'; | ||
import { addExceptionTypeValue, eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from './parsers'; | ||
import { computeStackTrace } from './tracekit'; | ||
import { BeaconTransport, FetchTransport, XHRTransport } from './transports'; | ||
import { FetchTransport, XHRTransport } from './transports'; | ||
/** The Sentry Browser SDK Backend. */ | ||
@@ -36,5 +36,2 @@ export class BrowserBackend extends BaseBackend { | ||
} | ||
else if (supportsBeacon()) { | ||
return new BeaconTransport(transportOptions); | ||
} | ||
else if (supportsFetch()) { | ||
@@ -41,0 +38,0 @@ return new FetchTransport(transportOptions); |
@@ -13,3 +13,2 @@ import { Breadcrumb, Integration, SentryBreadcrumbHint } from '@sentry/types/esm'; | ||
interface BreadcrumbIntegrations { | ||
beacon?: boolean; | ||
console?: boolean; | ||
@@ -39,4 +38,2 @@ dom?: boolean; | ||
/** JSDoc */ | ||
private instrumentBeacon; | ||
/** JSDoc */ | ||
private instrumentConsole; | ||
@@ -43,0 +40,0 @@ /** JSDoc */ |
@@ -8,3 +8,3 @@ import { API, getCurrentHub } from '@sentry/core/esm'; | ||
import { includes, safeJoin } from '@sentry/utils/esm/string'; | ||
import { supportsBeacon, supportsHistory, supportsNativeFetch } from '@sentry/utils/esm/supports'; | ||
import { supportsHistory, supportsNativeFetch } from '@sentry/utils/esm/supports'; | ||
import { breadcrumbEventHandler, keypressEventHandler, wrap } from './helpers'; | ||
@@ -24,3 +24,2 @@ const global = getGlobalObject(); | ||
this.options = { | ||
beacon: true, | ||
console: true, | ||
@@ -36,44 +35,2 @@ dom: true, | ||
/** JSDoc */ | ||
instrumentBeacon() { | ||
if (!supportsBeacon()) { | ||
return; | ||
} | ||
/** JSDoc */ | ||
function beaconReplacementFunction(originalBeaconFunction) { | ||
return function (...args) { | ||
const url = args[0]; | ||
const data = args[1]; | ||
// If the browser successfully queues the request for delivery, the method returns "true" and returns "false" otherwise. | ||
// https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API/Using_the_Beacon_API | ||
const result = originalBeaconFunction.apply(this, args); | ||
const client = getCurrentHub().getClient(); | ||
const dsn = client && client.getDsn(); | ||
if (dsn) { | ||
const filterUrl = new API(dsn).getStoreEndpoint(); | ||
// if Sentry key appears in URL, don't capture it as a request | ||
// but rather as our own 'sentry' type breadcrumb | ||
if (filterUrl && includes(url, filterUrl)) { | ||
addSentryBreadcrumb(data); | ||
return result; | ||
} | ||
} | ||
// What is wrong with you TypeScript... | ||
const breadcrumbData = { | ||
category: 'beacon', | ||
data, | ||
type: 'http', | ||
}; | ||
if (!result) { | ||
breadcrumbData.level = Severity.Error; | ||
} | ||
Breadcrumbs.addBreadcrumb(breadcrumbData, { | ||
input: args, | ||
result, | ||
}); | ||
return result; | ||
}; | ||
} | ||
fill(global.navigator, 'sendBeacon', beaconReplacementFunction); | ||
} | ||
/** JSDoc */ | ||
instrumentConsole() { | ||
@@ -386,5 +343,2 @@ if (!('console' in global)) { | ||
} | ||
if (this.options.beacon) { | ||
this.instrumentBeacon(); | ||
} | ||
if (this.options.history) { | ||
@@ -391,0 +345,0 @@ this.instrumentHistory(); |
export { BaseTransport } from './base'; | ||
export { FetchTransport } from './fetch'; | ||
export { XHRTransport } from './xhr'; | ||
export { BeaconTransport } from './beacon'; |
export { BaseTransport } from './base'; | ||
export { FetchTransport } from './fetch'; | ||
export { XHRTransport } from './xhr'; | ||
export { BeaconTransport } from './beacon'; | ||
//# sourceMappingURL=index.js.map |
export declare const SDK_NAME = "sentry.javascript.browser"; | ||
export declare const SDK_VERSION = "4.6.4"; | ||
export declare const SDK_VERSION = "4.6.5"; |
export const SDK_NAME = 'sentry.javascript.browser'; | ||
export const SDK_VERSION = '4.6.4'; | ||
export const SDK_VERSION = '4.6.5'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@sentry/browser", | ||
"version": "4.6.4", | ||
"version": "4.6.5", | ||
"description": "Offical Sentry SDK for browsers", | ||
@@ -18,5 +18,5 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/core": "4.6.4", | ||
"@sentry/core": "4.6.5", | ||
"@sentry/types": "4.5.3", | ||
"@sentry/utils": "4.6.4", | ||
"@sentry/utils": "4.6.5", | ||
"tslib": "^1.9.3" | ||
@@ -23,0 +23,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1898399
97
16038
+ Added@sentry/core@4.6.5(transitive)
+ Added@sentry/hub@4.6.5(transitive)
+ Added@sentry/minimal@4.6.5(transitive)
+ Added@sentry/utils@4.6.5(transitive)
- Removed@sentry/core@4.6.4(transitive)
- Removed@sentry/hub@4.6.4(transitive)
- Removed@sentry/minimal@4.6.4(transitive)
- Removed@sentry/utils@4.6.4(transitive)
Updated@sentry/core@4.6.5
Updated@sentry/utils@4.6.5