This commit is contained in:
MotorTruck1221
2025-04-07 22:11:56 -06:00
parent 8af7b073fa
commit 05c7dad93d
7 changed files with 82 additions and 47 deletions
+4 -2
View File
@@ -48,12 +48,14 @@ class SW {
return template.replace("%s", encodeURIComponent(input));
}
encodeURL(string: string, proxy: 'uv' | 'scram'): string {
encodeURL(string: string, proxy: 'uv' | 'sj'): string {
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)
}
async setTransport(transport?: 'epoxy' | 'libcurl') {
async setTransport(transport?: 'epoxy' | 'libcurl', get?: boolean) {
console.log('Setting transport');
if (get) return this.#storageManager.getVal('transport');
this.#storageManager.setVal("transport", transport || this.#storageManager.getVal("transport") || 'epoxy');
switch(transport) {
case 'epoxy': {
+2
View File
@@ -70,6 +70,8 @@ class Settings {
? document.documentElement.className = 'default'
: document.documentElement.className = theme || this.#storageManager.getVal('theme');
}
proxy(prox: 'uv' | 'sj') {}
async *#init() {
yield this.theme(this.#storageManager.getVal('theme') || 'default');