mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Properly handle errors from URL constructor
This commit is contained in:
@@ -69,8 +69,13 @@ export class OscLinkProvider implements ILinkProvider {
|
||||
|
||||
let ignoreLink = false;
|
||||
if (!linkHandler?.allowNonHttpProtocols) {
|
||||
const parsed = new URL(text);
|
||||
if (!['http:', 'https:'].includes(parsed.protocol)) {
|
||||
try {
|
||||
const parsed = new URL(text);
|
||||
if (!['http:', 'https:'].includes(parsed.protocol)) {
|
||||
ignoreLink = true;
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore invalid URLs to prevent unexpected behaviors
|
||||
ignoreLink = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user