File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/extensionsIntegrated/Phoenix-live-preview Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 9999 href : location . href
100100 } , "{{{PARENT_ORIGIN}}}" ) ;
101101 }
102+
103+ let target = event . target ;
104+ // Traverse up the DOM tree to find if the target is within an <a> tag
105+ while ( target && target . tagName !== 'A' ) {
106+ target = target . parentNode ;
107+ }
108+
102109 // in desktop phoenix builds, tauri will not open anchor tags in browser if it is in
103110 // an iframe(except for the intel mac bug)
104111 // in normal browsers, we dont need to do this.
105112 if ( window . __PHOENIX_EMBED_INFO && window . __PHOENIX_EMBED_INFO . isTauri &&
106- event . target . tagName === 'A' && ( event . target . target === '_blank' ) ) {
107- const href = getAbsoluteUrl ( event . target . getAttribute ( 'href' ) ) ;
113+ target . tagName === 'A' && ( target . target === '_blank' ) ) {
114+ const href = getAbsoluteUrl ( target . getAttribute ( 'href' ) ) ;
108115 window . parent . postMessage ( {
109116 handlerName : "ph-liveServer" ,
110117 eventName : 'embeddedIframeHrefClick' ,
You can’t perform that action at this time.
0 commit comments