Search Engine switching
This commit is contained in:
+1
-1
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user