aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers/url-helpers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/url-helpers.ts')
-rw-r--r--src/helpers/url-helpers.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/helpers/url-helpers.ts b/src/helpers/url-helpers.ts
index 9c5cf7752..795d3f2cb 100644
--- a/src/helpers/url-helpers.ts
+++ b/src/helpers/url-helpers.ts
@@ -2,6 +2,7 @@
2import { URL } from 'url'; 2import { URL } from 'url';
3import { ensureDirSync, existsSync } from 'fs-extra'; 3import { ensureDirSync, existsSync } from 'fs-extra';
4import { shell } from 'electron'; 4import { shell } from 'electron';
5import normalizeUrl from 'normalize-url';
5import { ALLOWED_PROTOCOLS } from '../config'; 6import { ALLOWED_PROTOCOLS } from '../config';
6 7
7const debug = require('../preload-safe-debug')('Ferdium:Helpers:url'); 8const debug = require('../preload-safe-debug')('Ferdium:Helpers:url');
@@ -49,3 +50,11 @@ export function openExternalUrl(
49 shell.openExternal(fixedUrl.toString()); 50 shell.openExternal(fixedUrl.toString());
50 } 51 }
51} 52}
53
54export function normalizedUrl(url: string) {
55 return normalizeUrl(url, {
56 stripAuthentication: false,
57 stripWWW: false,
58 removeTrailingSlash: false,
59 });
60}