Support for autocomplete suggestions
This commit is contained in:
13
src/main.ts
13
src/main.ts
@@ -92,7 +92,20 @@ function getBangredirectUrl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function doRedirect() {
|
function doRedirect() {
|
||||||
|
const url = new URL(window.location.href);
|
||||||
const searchUrl = getBangredirectUrl();
|
const searchUrl = getBangredirectUrl();
|
||||||
|
|
||||||
|
if (url.pathname === "/autocompleter") {
|
||||||
|
url.hostname = defaultBang!.d;
|
||||||
|
url.port = "";
|
||||||
|
if (LS_DEFAULT_BANG === "g") {
|
||||||
|
url.pathname = "/complete/search";
|
||||||
|
url.searchParams.set("client", "chrome");
|
||||||
|
}
|
||||||
|
window.location.replace(url.toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!searchUrl) return;
|
if (!searchUrl) return;
|
||||||
window.location.replace(searchUrl);
|
window.location.replace(searchUrl);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user