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

Commit 7ded90c

Browse files
Semi add Aero
1 parent 2c495cf commit 7ded90c

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "public/ruby-assets"]
22
path = public/ruby-assets
33
url = https://github.com/ruby-network/ruby-assets
4+
[submodule "public/aero"]
5+
path = public/aero
6+
url = https://github.com/ruby-network/aero

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ This is our second edition of [Ruby](https://github.com/ruby-network/ruby-v1). T
7272
- [Ultraviolet](https://github.com/titaniumnetwork-dev/ultraviolet)
7373
- [Dynamic Interception Proxy (DIP)](https://github.com/Dynamic-Interception-Proxy/DIP)
7474
- [Osana](https://github.com/nebulaservices/osana)
75-
75+
[aero](https://github.com/nebulaservices/aero) **NOTE: aero is unstable and may cause issues** (We currently use our own [fork](https://github.com/ruby-network/aero))
7676
---
7777

7878
- Basic Password protection for the website (you can set a password in the settings page)

public/aero

Submodule aero added at d4270fb

public/aero-sw.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import handle from "./aero/handle.js";
2+
import "./aero/init.js";
3+
4+
self.addEventListener("fetch", (event) => {
5+
if (event.request.url.startsWith(location.origin + '/go/'))
6+
event.respondWith(handle(event).catch(err => new Response(err.stack, { status: 500 })))
7+
});

public/js/index.js

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

0 commit comments

Comments
 (0)