We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b07c016 commit b3d3647Copy full SHA for b3d3647
src/browser/OscLinkProvider.ts
@@ -69,8 +69,13 @@ export class OscLinkProvider implements ILinkProvider {
69
70
let ignoreLink = false;
71
if (!linkHandler?.allowNonHttpProtocols) {
72
- const parsed = new URL(text);
73
- if (!['http:', 'https:'].includes(parsed.protocol)) {
+ try {
+ const parsed = new URL(text);
74
+ if (!['http:', 'https:'].includes(parsed.protocol)) {
75
+ ignoreLink = true;
76
+ }
77
+ } catch (e) {
78
+ // Ignore invalid URLs to prevent unexpected behaviors
79
ignoreLink = true;
80
}
81
0 commit comments