Skip to content

best way to save what you love

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

dumbmoron03b1248b5fe8
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) {