Closed GrahamDumpleton closed 4 months ago
We should try to see why this happens as it's annoying.
It cannot be fixed as is because xterm.js changed how they launched new browser windows and it now no longer works when embedded in an iframe as a result.
Options are:
Fix turns out to be quite simple. Provided have latest xterm.js can do:
function handleLinkClick(event: MouseEvent, uri: string): void {
window.open(uri, '_blank');
}
this.terminal.loadAddon(new WebLinksAddon(handleLinkClick))
This is how it did it a long time ago.
It was changed to:
function handleLink(event: MouseEvent, uri: string): void {
const newWindow = window.open();
if (newWindow) {
try {
newWindow.opener = null;
} catch {
// no-op, Electron can throw
}
newWindow.location.href = uri;
} else {
console.warn('Opening link blocked as opener could not be cleared');
}
}
The problem is that newWindow.location.href = uri;
is blocked when target updated after the fact.
When done as part of window open all is fine.
Describe the bug
Once upon a time you could click on a URL link in the dashboard terminal and it would open a new browser window on that URL. This is no longer working and it always opens a blank page in the new browser page.
Additional information
No response