@@ -121,13 +121,6 @@ http.interceptors.request.use(function (config: HttpRequestConfig) {
121121 } ;
122122} ) ;
123123
124- const isInSpecialFrame = ( ) : boolean => {
125- return (
126- getRuntimeMisc ( ) . isInIframeOfSameSite &&
127- ! getRuntimeMisc ( ) . isInIframeOfVisualBuilder
128- ) ;
129- } ;
130-
131124http . interceptors . request . use ( function ( config : HttpRequestConfig ) {
132125 if ( analyzer ) {
133126 const { userInstanceId : uid , username } = getAuth ( ) ;
@@ -141,16 +134,14 @@ http.interceptors.request.use(function (config: HttpRequestConfig) {
141134 }
142135
143136 if ( ! config . options ?. interceptorParams ?. ignoreLoadingBar ) {
144- const curWindow = isInSpecialFrame ( ) ? window . parent : window ;
145- curWindow . dispatchEvent ( new CustomEvent ( "request.start" ) ) ;
137+ window . dispatchEvent ( new CustomEvent ( "request.start" ) ) ;
146138 }
147139 return config ;
148140} ) ;
149141
150142http . interceptors . response . use (
151143 function ( response : HttpResponse ) {
152- const curWindow = isInSpecialFrame ( ) ? window . parent : window ;
153- curWindow . dispatchEvent ( new CustomEvent ( "request.end" ) ) ;
144+ window . dispatchEvent ( new CustomEvent ( "request.end" ) ) ;
154145 ( getRuntime ( ) . getFeatureFlags ( ) [ "enable-analyzer" ] || false ) &&
155146 analyzer ?. analyses ( response ) ;
156147 return response . config . options ?. observe === "response"
@@ -160,8 +151,7 @@ http.interceptors.response.use(
160151 function ( error : HttpError ) {
161152 ( getRuntime ( ) . getFeatureFlags ( ) [ "enable-analyzer" ] || false ) &&
162153 analyzer ?. analyses ( error ) ;
163- const curWindow = isInSpecialFrame ( ) ? window . parent : window ;
164- curWindow . dispatchEvent ( new CustomEvent ( "request.end" ) ) ;
154+ window . dispatchEvent ( new CustomEvent ( "request.end" ) ) ;
165155 return Promise . reject ( error . error ) ;
166156 }
167157) ;
0 commit comments