From 759d93dc198a3cc8c5265245c0144efa5435682b Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Fri, 22 Apr 2022 15:04:21 -0500 Subject: Turn off usage of 'debug' npm package using with electron-16 (fixes #17) --- src/helpers/url-helpers.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/helpers') 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'; import { ALLOWED_PROTOCOLS } from '../config'; -const debug = require('debug')('Ferdium:Helpers:url'); +// TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed +// const debug = require('debug')('Ferdium:Helpers:url'); export function isValidExternalURL(url: string | URL) { let parsedUrl: URL; @@ -18,7 +19,7 @@ export function isValidExternalURL(url: string | URL) { const isAllowed = ALLOWED_PROTOCOLS.includes(parsedUrl.protocol); - debug('protocol check is', isAllowed, 'for:', url); + console.log('protocol check is', isAllowed, 'for:', url); return isAllowed; } @@ -37,7 +38,7 @@ export function openExternalUrl( url: string | URL, skipValidityCheck: boolean = false, ) { - debug('Open url:', url, 'with skipValidityCheck:', skipValidityCheck); + console.log('Open url:', url, 'with skipValidityCheck:', skipValidityCheck); if (skipValidityCheck || isValidExternalURL(url)) { shell.openExternal(url.toString()); } -- cgit v1.2.3-54-g00ecf