66 browserTracingIntegration ,
77 startBrowserTracingNavigationSpan ,
88 startBrowserTracingPageLoadSpan ,
9+ WINDOW ,
910} from '@sentry/browser' ;
1011import type { Client , Integration , Span , TransactionSource } from '@sentry/core' ;
1112import {
@@ -15,7 +16,6 @@ import {
1516 getClient ,
1617 getCurrentScope ,
1718 getRootSpan ,
18- GLOBAL_OBJ ,
1919 SEMANTIC_ATTRIBUTE_SENTRY_OP ,
2020 SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ,
2121 SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ,
@@ -53,12 +53,12 @@ let _enableAsyncRouteHandlers: boolean = false;
5353const CLIENTS_WITH_INSTRUMENT_NAVIGATION = new WeakSet < Client > ( ) ;
5454
5555/**
56- * Gets the current location from the global object (window in browser environments) .
57- * Returns undefined if global location is not available.
56+ * Gets the current location from the window object in browser environments.
57+ * Returns undefined if window is not available.
5858 */
5959function getGlobalLocation ( ) : Location | undefined {
60- if ( typeof GLOBAL_OBJ !== 'undefined' ) {
61- const globalLocation = ( GLOBAL_OBJ as typeof GLOBAL_OBJ & Window ) . location ;
60+ if ( typeof WINDOW !== 'undefined' ) {
61+ const globalLocation = WINDOW . location ;
6262 if ( globalLocation ) {
6363 return { pathname : globalLocation . pathname } ;
6464 }
@@ -67,12 +67,12 @@ function getGlobalLocation(): Location | undefined {
6767}
6868
6969/**
70- * Gets the pathname from the global object (window in browser environments) .
71- * Returns undefined if global location is not available.
70+ * Gets the pathname from the window object in browser environments.
71+ * Returns undefined if window is not available.
7272 */
7373function getGlobalPathname ( ) : string | undefined {
74- if ( typeof GLOBAL_OBJ !== 'undefined' ) {
75- return ( GLOBAL_OBJ as typeof GLOBAL_OBJ & Window ) . location ?. pathname ;
74+ if ( typeof WINDOW !== 'undefined' ) {
75+ return WINDOW . location ?. pathname ;
7676 }
7777 return undefined ;
7878}
0 commit comments