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