mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-13 05:37:44 +02:00
url/extract: convert input to URL object if passed as string
This commit is contained in:
@ -127,6 +127,10 @@ export function normalizeURL(url) {
|
||||
}
|
||||
|
||||
export function extract(url) {
|
||||
if (!(url instanceof URL)) {
|
||||
url = new URL(url);
|
||||
}
|
||||
|
||||
const host = getHostIfValid(url);
|
||||
|
||||
if (!host || !services[host].enabled) {
|
||||
|
Reference in New Issue
Block a user