diff options
Diffstat (limited to 'src/helpers/url-helpers.ts')
-rw-r--r-- | src/helpers/url-helpers.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/helpers/url-helpers.ts b/src/helpers/url-helpers.ts index bd9796ab0..abe123577 100644 --- a/src/helpers/url-helpers.ts +++ b/src/helpers/url-helpers.ts | |||
@@ -6,7 +6,8 @@ import { shell } from 'electron'; | |||
6 | 6 | ||
7 | import { ALLOWED_PROTOCOLS } from '../config'; | 7 | import { ALLOWED_PROTOCOLS } from '../config'; |
8 | 8 | ||
9 | const debug = require('debug')('Ferdium:Helpers:url'); | 9 | // TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed |
10 | // const debug = require('debug')('Ferdium:Helpers:url'); | ||
10 | 11 | ||
11 | export function isValidExternalURL(url: string | URL) { | 12 | export function isValidExternalURL(url: string | URL) { |
12 | let parsedUrl: URL; | 13 | let parsedUrl: URL; |
@@ -18,7 +19,7 @@ export function isValidExternalURL(url: string | URL) { | |||
18 | 19 | ||
19 | const isAllowed = ALLOWED_PROTOCOLS.includes(parsedUrl.protocol); | 20 | const isAllowed = ALLOWED_PROTOCOLS.includes(parsedUrl.protocol); |
20 | 21 | ||
21 | debug('protocol check is', isAllowed, 'for:', url); | 22 | console.log('protocol check is', isAllowed, 'for:', url); |
22 | 23 | ||
23 | return isAllowed; | 24 | return isAllowed; |
24 | } | 25 | } |
@@ -37,7 +38,7 @@ export function openExternalUrl( | |||
37 | url: string | URL, | 38 | url: string | URL, |
38 | skipValidityCheck: boolean = false, | 39 | skipValidityCheck: boolean = false, |
39 | ) { | 40 | ) { |
40 | debug('Open url:', url, 'with skipValidityCheck:', skipValidityCheck); | 41 | console.log('Open url:', url, 'with skipValidityCheck:', skipValidityCheck); |
41 | if (skipValidityCheck || isValidExternalURL(url)) { | 42 | if (skipValidityCheck || isValidExternalURL(url)) { |
42 | shell.openExternal(url.toString()); | 43 | shell.openExternal(url.toString()); |
43 | } | 44 | } |