Search Engine switching

This commit is contained in:
MotorTruck1221
2025-05-02 23:26:36 -06:00
parent 4ea7ab5e11
commit ab6f588fb1
3 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ class SW {
encodeURL(string: string): string {
const proxy = this.#storageManager.getVal("proxy") as 'uv' | 'sj';
const input = this.#search(string, "https://google.com/search?q=%s");
const input = this.#search(string, this.#storageManager.getVal('searchEngine'));
return proxy === 'uv' ? `${__uv$config.prefix}${__uv$config.encodeUrl!(input)}` : this.#scramjetController!.encodeUrl(input)
}
+4
View File
@@ -74,6 +74,10 @@ class Settings {
proxy(prox: 'uv' | 'sj') {
this.#storageManager.setVal('proxy', prox);
}
searchEngine(engine: string) {
this.#storageManager.setVal('searchEngine', engine);
}
async *#init() {
yield this.theme(this.#storageManager.getVal('theme') || 'default');