Add a vencord injection, commented out for now.
This commit is contained in:
parent
4674bd182e
commit
92f23fb7c6
5 changed files with 1827 additions and 1829 deletions
13
index.js
13
index.js
|
|
@ -2,8 +2,6 @@ import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
|
|||
import { epoxyPath } from "@mercuryworkshop/epoxy-transport";
|
||||
import { libcurlPath } from "@mercuryworkshop/libcurl-transport";
|
||||
import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
|
||||
import { bareModulePath } from "@mercuryworkshop/bare-as-module3";
|
||||
import { createBareServer } from "@tomphttp/bare-server-node";
|
||||
import express from "express";
|
||||
import { createServer } from "http";
|
||||
import path from "node:path";
|
||||
|
|
@ -29,8 +27,6 @@ if (!existsSync("./dist")) build({});
|
|||
|
||||
const log = (message) => console.log(chalk.gray("[Alu] " + message));
|
||||
|
||||
const bare = createBareServer("/bare/");
|
||||
|
||||
const PORT = process.env.PORT || 3000;
|
||||
log("Starting Rammerhead...");
|
||||
const rh = createRammerhead();
|
||||
|
|
@ -68,7 +64,6 @@ app.use("/uv/", express.static(uvPath));
|
|||
app.use("/epoxy/", express.static(epoxyPath));
|
||||
app.use("/libcurl/", express.static(libcurlPath));
|
||||
app.use("/baremux/", express.static(baremuxPath));
|
||||
app.use("/baremod/", express.static(bareModulePath));
|
||||
|
||||
app.use(express.json());
|
||||
app.use(
|
||||
|
|
@ -134,9 +129,7 @@ app.get("*", (req, res) => {
|
|||
|
||||
const server = createServer();
|
||||
server.on("request", (req, res) => {
|
||||
if (bare.shouldRoute(req)) {
|
||||
bare.routeRequest(req, res);
|
||||
} else if (shouldRouteRh(req)) {
|
||||
if (shouldRouteRh(req)) {
|
||||
routeRhRequest(req, res);
|
||||
} else {
|
||||
app(req, res);
|
||||
|
|
@ -144,9 +137,7 @@ server.on("request", (req, res) => {
|
|||
});
|
||||
|
||||
server.on("upgrade", (req, socket, head) => {
|
||||
if (bare.shouldRoute(req)) {
|
||||
bare.routeUpgrade(req, socket, head);
|
||||
} else if (shouldRouteRh(req)) {
|
||||
if (shouldRouteRh(req)) {
|
||||
routeRhUpgrade(req, socket, head);
|
||||
/* Kinda hacky, I need to do a proper dynamic import. */
|
||||
} else if (req.url.endsWith("/wisp/") && WISP_ENABLED == "true") {
|
||||
|
|
|
|||
3631
pnpm-lock.yaml
generated
3631
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -2,10 +2,16 @@ importScripts("/uv/uv.bundle.js", "/uv.config.js", "/workerware/workerware.js");
|
|||
importScripts( __uv$config.sw);
|
||||
importScripts("/marketplace/scriptInjector/index.js")
|
||||
|
||||
const uv = new UVServiceWorker();
|
||||
const ww = new WorkerWare({
|
||||
debug: false,
|
||||
});
|
||||
|
||||
// uv.config.inject = [{
|
||||
// "host": "discord.com",
|
||||
// "html": `<script src="https://raw.githubusercontent.com/Vencord/builds/main/browser.js"></script><link rel="stylesheet" href="https://raw.githubusercontent.com/Vencord/builds/main/browser.css"></link>`,
|
||||
// "injectTo": "head",
|
||||
// }]
|
||||
|
||||
function loadExtensionScripts() {
|
||||
try {
|
||||
|
|
@ -34,8 +40,6 @@ function loadExtensionScripts() {
|
|||
}
|
||||
loadExtensionScripts();
|
||||
|
||||
const uv = new UVServiceWorker();
|
||||
|
||||
self.addEventListener("fetch", async (event) => {
|
||||
event.respondWith(
|
||||
(async () => {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ self.__uv$config = {
|
|||
handler: "/uv/uv.handler.js",
|
||||
client: "/uv/uv.client.js",
|
||||
bundle: "/uv/uv.bundle.js",
|
||||
config: "/uv/uv.config.js",
|
||||
config: "/uv.config.js",
|
||||
sw: "/uv/uv.sw.js",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ const { title, optionalPreloads } = Astro.props;
|
|||
<Header />
|
||||
<slot transition:animate={"fade"} />
|
||||
<script src="/uv/uv.bundle.js" is:inline transition:persist></script>
|
||||
<script src="/uv/uv.config.js" is:inline transition:persist></script>
|
||||
<script src="/uv.config.js" is:inline transition:persist></script>
|
||||
<WelcomeLogging />
|
||||
<Footer />
|
||||
<style is:global>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue