diff --git a/src/components/Settings/CommonSettings.tsx b/src/components/Settings/CommonSettings.tsx index acc501e39..55c710359 100644 --- a/src/components/Settings/CommonSettings.tsx +++ b/src/components/Settings/CommonSettings.tsx @@ -28,6 +28,15 @@ export default function CommonSettings(args: any) { Search engine + + Tip: %s can be used as a placeholder for the query. + { setCustomSearchUrl(event.currentTarget.value); diff --git a/src/components/modules/search/SearchModule.tsx b/src/components/modules/search/SearchModule.tsx index 85ca6adf5..5848c4c87 100644 --- a/src/components/modules/search/SearchModule.tsx +++ b/src/components/modules/search/SearchModule.tsx @@ -96,7 +96,13 @@ export default function SearchBar(props: any) { } else if (isTorrent) { window.open(`https://bitsearch.to/search?q=${query.substring(3)}`); } else { - window.open(`${queryUrl}${values.query}`); + window.open( + `${ + queryUrl.includes('%s') + ? queryUrl.replace('%s', values.query) + : queryUrl + values.query + }` + ); } }, 20); })} @@ -114,6 +120,7 @@ export default function SearchBar(props: any) { onBlurCapture={() => setOpened(false)} target={