aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2022-04-22 15:04:21 -0500
committerLibravatar GitHub <noreply@github.com>2022-04-22 20:04:21 +0000
commit759d93dc198a3cc8c5265245c0144efa5435682b (patch)
tree53e963a085d3d12af5a2efa2f1ab6f3e5574edc7 /src/helpers
parentAdded build scripts for linux, macos and windows to help new contributors get... (diff)
downloadferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.gz
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.zst
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.zip
Turn off usage of 'debug' npm package using with electron-16 (fixes #17)
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/url-helpers.ts7
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
7import { ALLOWED_PROTOCOLS } from '../config'; 7import { ALLOWED_PROTOCOLS } from '../config';
8 8
9const 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
11export function isValidExternalURL(url: string | URL) { 12export 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 }