File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
src/LiveDevelopment/BrowserScripts Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 304304 // an iframe(except for the intel mac bug)
305305 // in normal browsers, we dont need to do this and the borwser will do its thing.
306306 const href = getAbsoluteUrl ( targetElement . getAttribute ( 'href' ) ) ;
307- window . parent . postMessage ( {
308- handlerName : "ph-liveServer" ,
309- eventName : 'embeddedIframeHrefClick' ,
310- href : href
311- } , "*" ) ;
312- // in intel mac desktop, tauri seems to open in browser
313- // causing 2 tabs to open. in m1 macs its not there. so we prevent default behavior.
314- event . stopImmediatePropagation ( ) ;
315- event . preventDefault ( ) ;
307+ if ( ! event . defaultPrevented ) {
308+ window . parent . postMessage ( {
309+ handlerName : "ph-liveServer" ,
310+ eventName : 'embeddedIframeHrefClick' ,
311+ href : href
312+ } , "*" ) ;
313+ // in intel mac desktop, tauri seems to open in browser
314+ // causing 2 tabs to open. in m1 macs its not there. so we prevent default behavior.
315+ event . stopImmediatePropagation ( ) ;
316+ event . preventDefault ( ) ;
317+ }
316318 }
317- } , true ) ;
319+ } ) ;
318320 document . addEventListener ( 'contextmenu' , function ( event ) {
319321 ( document . activeElement || document . body ) . focus ( ) ;
320322 } ) ;
You can’t perform that action at this time.
0 commit comments