Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/LiveDevelopment/BrowserScripts/LivePreviewTransportRemote.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,19 @@
// an iframe(except for the intel mac bug)
// in normal browsers, we dont need to do this and the borwser will do its thing.
const href = getAbsoluteUrl(targetElement.getAttribute('href'));
window.parent.postMessage({
handlerName: "ph-liveServer",
eventName: 'embeddedIframeHrefClick',
href: href
}, "*");
// in intel mac desktop, tauri seems to open in browser
// causing 2 tabs to open. in m1 macs its not there. so we prevent default behavior.
event.stopImmediatePropagation();
event.preventDefault();
if (!event.defaultPrevented) {
window.parent.postMessage({
handlerName: "ph-liveServer",
eventName: 'embeddedIframeHrefClick',
href: href
}, "*");
// in intel mac desktop, tauri seems to open in browser
// causing 2 tabs to open. in m1 macs its not there. so we prevent default behavior.
event.stopImmediatePropagation();
event.preventDefault();
}
}
}, true);
});
document.addEventListener('contextmenu', function(event) {
(document.activeElement || document.body).focus();
});
Expand Down
Loading