aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/features/utils/openExternalLink.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/features/utils/openExternalLink.js b/app/features/utils/openExternalLink.js
index b317061..e077ffa 100644
--- a/app/features/utils/openExternalLink.js
+++ b/app/features/utils/openExternalLink.js
@@ -2,8 +2,6 @@ const { shell } = require('electron');
const url = require('url');
-const protocolRegex = /^(https?|mailto):/i;
-
/**
* Opens the given link in an external browser.
*
@@ -19,7 +17,10 @@ export function openExternalLink(link) {
return;
}
- if (protocolRegex.test(u.protocol)) {
- shell.openExternal(link);
+ const proto = u.protocol;
+ const href = u.href;
+
+ if (proto === 'http:' || proto === 'https:' || proto === 'mailto:') {
+ shell.openExternal(href);
}
}