Add a vencord injection, commented out for now.

This commit is contained in:
wearrrrr 2024-08-01 16:15:39 -05:00
parent 4674bd182e
commit 92f23fb7c6
5 changed files with 1827 additions and 1829 deletions

View file

@ -2,8 +2,6 @@ import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
import { epoxyPath } from "@mercuryworkshop/epoxy-transport"; import { epoxyPath } from "@mercuryworkshop/epoxy-transport";
import { libcurlPath } from "@mercuryworkshop/libcurl-transport"; import { libcurlPath } from "@mercuryworkshop/libcurl-transport";
import { baremuxPath } from "@mercuryworkshop/bare-mux/node"; 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 express from "express";
import { createServer } from "http"; import { createServer } from "http";
import path from "node:path"; import path from "node:path";
@ -29,8 +27,6 @@ if (!existsSync("./dist")) build({});
const log = (message) => console.log(chalk.gray("[Alu] " + message)); const log = (message) => console.log(chalk.gray("[Alu] " + message));
const bare = createBareServer("/bare/");
const PORT = process.env.PORT || 3000; const PORT = process.env.PORT || 3000;
log("Starting Rammerhead..."); log("Starting Rammerhead...");
const rh = createRammerhead(); const rh = createRammerhead();
@ -68,7 +64,6 @@ app.use("/uv/", express.static(uvPath));
app.use("/epoxy/", express.static(epoxyPath)); app.use("/epoxy/", express.static(epoxyPath));
app.use("/libcurl/", express.static(libcurlPath)); app.use("/libcurl/", express.static(libcurlPath));
app.use("/baremux/", express.static(baremuxPath)); app.use("/baremux/", express.static(baremuxPath));
app.use("/baremod/", express.static(bareModulePath));
app.use(express.json()); app.use(express.json());
app.use( app.use(
@ -134,9 +129,7 @@ app.get("*", (req, res) => {
const server = createServer(); const server = createServer();
server.on("request", (req, res) => { server.on("request", (req, res) => {
if (bare.shouldRoute(req)) { if (shouldRouteRh(req)) {
bare.routeRequest(req, res);
} else if (shouldRouteRh(req)) {
routeRhRequest(req, res); routeRhRequest(req, res);
} else { } else {
app(req, res); app(req, res);
@ -144,9 +137,7 @@ server.on("request", (req, res) => {
}); });
server.on("upgrade", (req, socket, head) => { server.on("upgrade", (req, socket, head) => {
if (bare.shouldRoute(req)) { if (shouldRouteRh(req)) {
bare.routeUpgrade(req, socket, head);
} else if (shouldRouteRh(req)) {
routeRhUpgrade(req, socket, head); routeRhUpgrade(req, socket, head);
/* Kinda hacky, I need to do a proper dynamic import. */ /* Kinda hacky, I need to do a proper dynamic import. */
} else if (req.url.endsWith("/wisp/") && WISP_ENABLED == "true") { } else if (req.url.endsWith("/wisp/") && WISP_ENABLED == "true") {

3631
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -2,10 +2,16 @@ importScripts("/uv/uv.bundle.js", "/uv.config.js", "/workerware/workerware.js");
importScripts( __uv$config.sw); importScripts( __uv$config.sw);
importScripts("/marketplace/scriptInjector/index.js") importScripts("/marketplace/scriptInjector/index.js")
const uv = new UVServiceWorker();
const ww = new WorkerWare({ const ww = new WorkerWare({
debug: false, 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() { function loadExtensionScripts() {
try { try {
@ -34,8 +40,6 @@ function loadExtensionScripts() {
} }
loadExtensionScripts(); loadExtensionScripts();
const uv = new UVServiceWorker();
self.addEventListener("fetch", async (event) => { self.addEventListener("fetch", async (event) => {
event.respondWith( event.respondWith(
(async () => { (async () => {

View file

@ -6,6 +6,6 @@ self.__uv$config = {
handler: "/uv/uv.handler.js", handler: "/uv/uv.handler.js",
client: "/uv/uv.client.js", client: "/uv/uv.client.js",
bundle: "/uv/uv.bundle.js", bundle: "/uv/uv.bundle.js",
config: "/uv/uv.config.js", config: "/uv.config.js",
sw: "/uv/uv.sw.js", sw: "/uv/uv.sw.js",
}; };

View file

@ -80,7 +80,7 @@ const { title, optionalPreloads } = Astro.props;
<Header /> <Header />
<slot transition:animate={"fade"} /> <slot transition:animate={"fade"} />
<script src="/uv/uv.bundle.js" is:inline transition:persist></script> <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 /> <WelcomeLogging />
<Footer /> <Footer />
<style is:global> <style is:global>