diff --git a/src/plugins/favGifSearch/index.tsx b/src/plugins/favGifSearch/index.tsx index 592d8f5..d71f567 100644 --- a/src/plugins/favGifSearch/index.tsx +++ b/src/plugins/favGifSearch/index.tsx @@ -200,7 +200,14 @@ function SearchBar({ instance, SearchBarComponent }: { instance: Instance; Searc export function getTargetString(urlStr: string) { - const url = new URL(urlStr); + let url: URL; + try { + url = new URL(urlStr); + } catch (err) { + // Can't resolve URL, return as-is + return urlStr; + } + switch (settings.store.searchOption) { case "url": return url.href;