url/extract: convert input to URL object if passed as string

This commit is contained in:
dumbmoron 2024-05-21 21:27:23 +00:00
parent 5199b3d8fd
commit 03b1248b5f
No known key found for this signature in database

View file

@ -127,6 +127,10 @@ export function normalizeURL(url) {
} }
export function extract(url) { export function extract(url) {
if (!(url instanceof URL)) {
url = new URL(url);
}
const host = getHostIfValid(url); const host = getHostIfValid(url);
if (!host || !services[host].enabled) { if (!host || !services[host].enabled) {