From 03b1248b5fe8412add1065c446aefed7e3869809 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Tue, 21 May 2024 21:27:23 +0000 Subject: [PATCH] url/extract: convert input to URL object if passed as string --- src/modules/processing/url.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/processing/url.js b/src/modules/processing/url.js index 51883b1b..a006402c 100644 --- a/src/modules/processing/url.js +++ b/src/modules/processing/url.js @@ -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) {