1
1
import type { Scope } from '@sentry/core' ;
2
- import { BaseClient , getEnvelopeEndpointWithUrlEncodedAuth , SDK_VERSION } from '@sentry/core' ;
2
+ import { BaseClient , SDK_VERSION } from '@sentry/core' ;
3
3
import type {
4
4
BrowserClientReplayOptions ,
5
5
ClientOptions ,
@@ -9,7 +9,7 @@ import type {
9
9
Severity ,
10
10
SeverityLevel ,
11
11
} from '@sentry/types' ;
12
- import { createClientReportEnvelope , dsnToString , getSDKSource , logger , serializeEnvelope } from '@sentry/utils' ;
12
+ import { createClientReportEnvelope , dsnToString , getSDKSource , logger } from '@sentry/utils' ;
13
13
14
14
import { eventFromException , eventFromMessage } from './eventbuilder' ;
15
15
import { WINDOW } from './helpers' ;
@@ -132,24 +132,7 @@ export class BrowserClient extends BaseClient<BrowserClientOptions> {
132
132
133
133
__DEBUG_BUILD__ && logger . log ( 'Sending outcomes:' , outcomes ) ;
134
134
135
- const url = getEnvelopeEndpointWithUrlEncodedAuth ( this . _dsn , this . _options ) ;
136
135
const envelope = createClientReportEnvelope ( outcomes , this . _options . tunnel && dsnToString ( this . _dsn ) ) ;
137
-
138
- try {
139
- const isRealNavigator = Object . prototype . toString . call ( WINDOW && WINDOW . navigator ) === '[object Navigator]' ;
140
- const hasSendBeacon = isRealNavigator && typeof WINDOW . navigator . sendBeacon === 'function' ;
141
- // Make sure beacon is not used if user configures custom transport options
142
- if ( hasSendBeacon && ! this . _options . transportOptions ) {
143
- // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch
144
- const sendBeacon = WINDOW . navigator . sendBeacon . bind ( WINDOW . navigator ) ;
145
- sendBeacon ( url , serializeEnvelope ( envelope ) ) ;
146
- } else {
147
- // If beacon is not supported or if they are using the tunnel option
148
- // use our regular transport to send client reports to Sentry.
149
- void this . _sendEnvelope ( envelope ) ;
150
- }
151
- } catch ( e ) {
152
- __DEBUG_BUILD__ && logger . error ( e ) ;
153
- }
136
+ void this . _sendEnvelope ( envelope ) ;
154
137
}
155
138
}
0 commit comments