mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-25 16:59:17 +01:00
require node URL
This commit is contained in:
parent
42bf9b2edb
commit
33c3af3a8e
@ -1,3 +1,6 @@
|
||||
// tslint:disable-next-line
|
||||
const nodeURL = typeof window === 'undefined' ? require('url').URL : null;
|
||||
|
||||
export class Utils {
|
||||
static inited = false;
|
||||
static isNode = false;
|
||||
@ -159,7 +162,7 @@ export class Utils {
|
||||
|
||||
if (uriString.startsWith('http://') || uriString.startsWith('https://')) {
|
||||
try {
|
||||
return new URL(uriString);
|
||||
return nodeURL != null ? new nodeURL(uriString) : new URL(uriString);
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user