Add proxy switcher to the mix
This commit is contained in:
+2
-1
@@ -48,7 +48,8 @@ class SW {
|
||||
return template.replace("%s", encodeURIComponent(input));
|
||||
}
|
||||
|
||||
encodeURL(string: string, proxy: 'uv' | 'sj'): string {
|
||||
encodeURL(string: string): string {
|
||||
const proxy = this.#storageManager.getVal("proxy") as 'uv' | 'sj';
|
||||
const input = this.#search(string, "https://google.com/search?q=%s");
|
||||
return proxy === 'uv' ? `${__uv$config.prefix}${__uv$config.encodeUrl!(input)}` : this.#scramjetController!.encodeUrl(input)
|
||||
}
|
||||
|
||||
@@ -71,7 +71,9 @@ class Settings {
|
||||
: document.documentElement.className = theme || this.#storageManager.getVal('theme');
|
||||
}
|
||||
|
||||
proxy(prox: 'uv' | 'sj') {}
|
||||
proxy(prox: 'uv' | 'sj') {
|
||||
this.#storageManager.setVal('proxy', prox);
|
||||
}
|
||||
|
||||
async *#init() {
|
||||
yield this.theme(this.#storageManager.getVal('theme') || 'default');
|
||||
|
||||
Reference in New Issue
Block a user