@@ -5,7 +5,7 @@ import { logger } from '@sentry/utils/logger';
5
5
import { getEventDescription , getGlobalObject , parseUrl } from '@sentry/utils/misc' ;
6
6
import { deserialize , fill , safeNormalize } from '@sentry/utils/object' ;
7
7
import { includes , safeJoin } from '@sentry/utils/string' ;
8
- import { supportsBeacon , supportsHistory , supportsNativeFetch } from '@sentry/utils/supports' ;
8
+ import { supportsHistory , supportsNativeFetch } from '@sentry/utils/supports' ;
9
9
import { BrowserClient } from '../client' ;
10
10
import { breadcrumbEventHandler , keypressEventHandler , wrap } from './helpers' ;
11
11
@@ -24,7 +24,6 @@ export interface SentryWrappedXMLHttpRequest extends XMLHttpRequest {
24
24
25
25
/** JSDoc */
26
26
interface BreadcrumbIntegrations {
27
- beacon ?: boolean ;
28
27
console ?: boolean ;
29
28
dom ?: boolean ;
30
29
fetch ?: boolean ;
@@ -53,7 +52,6 @@ export class Breadcrumbs implements Integration {
53
52
*/
54
53
public constructor ( options ?: BreadcrumbIntegrations ) {
55
54
this . options = {
56
- beacon : true ,
57
55
console : true ,
58
56
dom : true ,
59
57
fetch : true ,
@@ -64,56 +62,6 @@ export class Breadcrumbs implements Integration {
64
62
} ;
65
63
}
66
64
67
- /** JSDoc */
68
- private instrumentBeacon ( ) : void {
69
- if ( ! supportsBeacon ( ) ) {
70
- return ;
71
- }
72
-
73
- /** JSDoc */
74
- function beaconReplacementFunction ( originalBeaconFunction : ( ) => void ) : ( ) => void {
75
- return function ( this : History , ...args : any [ ] ) : void {
76
- const url = args [ 0 ] ;
77
- const data = args [ 1 ] ;
78
- // If the browser successfully queues the request for delivery, the method returns "true" and returns "false" otherwise.
79
- // https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API/Using_the_Beacon_API
80
- const result = originalBeaconFunction . apply ( this , args ) ;
81
-
82
- const client = getCurrentHub ( ) . getClient ( ) as BrowserClient ;
83
- const dsn = client && client . getDsn ( ) ;
84
- if ( dsn ) {
85
- const filterUrl = new API ( dsn ) . getStoreEndpoint ( ) ;
86
- // if Sentry key appears in URL, don't capture it as a request
87
- // but rather as our own 'sentry' type breadcrumb
88
- if ( filterUrl && includes ( url , filterUrl ) ) {
89
- addSentryBreadcrumb ( data ) ;
90
- return result ;
91
- }
92
- }
93
-
94
- // What is wrong with you TypeScript...
95
- const breadcrumbData = ( {
96
- category : 'beacon' ,
97
- data,
98
- type : 'http' ,
99
- } as any ) as { [ key : string ] : any } ;
100
-
101
- if ( ! result ) {
102
- breadcrumbData . level = Severity . Error ;
103
- }
104
-
105
- Breadcrumbs . addBreadcrumb ( breadcrumbData , {
106
- input : args ,
107
- result,
108
- } ) ;
109
-
110
- return result ;
111
- } ;
112
- }
113
-
114
- fill ( global . navigator , 'sendBeacon' , beaconReplacementFunction ) ;
115
- }
116
-
117
65
/** JSDoc */
118
66
private instrumentConsole ( ) : void {
119
67
if ( ! ( 'console' in global ) ) {
@@ -481,9 +429,6 @@ export class Breadcrumbs implements Integration {
481
429
if ( this . options . fetch ) {
482
430
this . instrumentFetch ( ) ;
483
431
}
484
- if ( this . options . beacon ) {
485
- this . instrumentBeacon ( ) ;
486
- }
487
432
if ( this . options . history ) {
488
433
this . instrumentHistory ( ) ;
489
434
}
0 commit comments