Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit b2ae593

Browse files
A little bit more aero
1 parent 544355d commit b2ae593

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

public/js/index.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,31 @@ if (proxytype === 'Osana') {
121121
return a;
122122
}
123123
}
124+
if (proxytype === 'Aero') {
125+
document.getElementById('uv-form').addEventListener('submit', async (event) => {
126+
event.preventDefault();
127+
let url;
128+
function searchURI(value) {
129+
url = search(value, searchEngine.value);
130+
}
131+
worker().then((event) => {
132+
let search = document.querySelector('.dipinput');
133+
let address = document.getElementById('uv-address');
134+
searchURI(address.value);
135+
let textcolor = getComputedStyle(document.body).getPropertyValue('--text-color');
136+
iframe.src = '/go/' + url;
137+
document.getElementById('control').classList.remove('dnone');
138+
iframe.classList.remove('dnone');
139+
});
140+
});
141+
async function worker() {
142+
var a = await navigator.serviceWorker.register('/aero-sw.js', {
143+
scope: '/go/',
144+
type: 'module',
145+
});
146+
return a;
147+
}
148+
}
124149
function decoded(str) {
125150
if (str.charAt(str.length - 1) == '/') str = str.slice(0, -1);
126151
return decodeURIComponent(str)

0 commit comments

Comments
 (0)