diff options
Diffstat (limited to 'src/helpers')
-rw-r--r-- | src/helpers/url-helpers.ts | 9 |
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 @@ | |||
2 | import { URL } from 'url'; | 2 | import { URL } from 'url'; |
3 | import { ensureDirSync, existsSync } from 'fs-extra'; | 3 | import { ensureDirSync, existsSync } from 'fs-extra'; |
4 | import { shell } from 'electron'; | 4 | import { shell } from 'electron'; |
5 | import normalizeUrl from 'normalize-url'; | ||
5 | import { ALLOWED_PROTOCOLS } from '../config'; | 6 | import { ALLOWED_PROTOCOLS } from '../config'; |
6 | 7 | ||
7 | const debug = require('../preload-safe-debug')('Ferdium:Helpers:url'); | 8 | const 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 | |||
54 | export function normalizedUrl(url: string) { | ||
55 | return normalizeUrl(url, { | ||
56 | stripAuthentication: false, | ||
57 | stripWWW: false, | ||
58 | removeTrailingSlash: false, | ||
59 | }); | ||
60 | } | ||