Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .prettierignore

This file was deleted.

2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://biomejs.dev/schemas/2.3.9/schema.json",
"files": {
"ignoreUnknown": true,
"includes": ["**", "!**/src/global.css", "!**/.astro"]
"includes": ["**", "!**/src/global.css", "!**/.astro", "!**/dist"]
},
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
Expand Down
8 changes: 4 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import path from "node:path";
import zlib from "node:zlib";

EventEmitter.defaultMaxListeners = 50;

import fastifyMiddie from "@fastify/middie";
import fastifyStatic from "@fastify/static";
import { server as wisp } from "@mercuryworkshop/wisp-js/server";
import { build } from "astro";
import Fastify from "fastify";
import INConfig from "./config";
import { generateMaps, getClientScript, type ObfuscationMaps, transformCss, transformHtml, transformJs, ROUTES, ASSET_FOLDERS } from "./src/lib/obfuscate";
import { ASSET_FOLDERS, generateMaps, getClientScript, type ObfuscationMaps, ROUTES, transformCss, transformHtml, transformJs } from "./src/lib/obfuscate";

let obfuscationMaps: ObfuscationMaps | null = null;

Expand Down Expand Up @@ -112,7 +113,7 @@ async function Start() {
}

const [urlPath, query] = req.url.split("?");
let pathParts = urlPath.split("/").filter(Boolean);
const pathParts = urlPath.split("/").filter(Boolean);
let modified = false;

if (pathParts.length > 0) {
Expand Down Expand Up @@ -213,10 +214,7 @@ self.addEventListener("fetch", (event) => {
);
});
`;
reply
.header("Service-Worker-Allowed", "/")
.type("application/javascript")
.send(swCode);
reply.header("Service-Worker-Allowed", "/").type("application/javascript").send(swCode);
});

app.get(`/assets/${scramjetFolder}/*`, (req, reply) => {
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"astro": "astro",
"disable": "bunx astro telemetry disable",
"precommit": "bun run typecheck && bun run check",
"check": "prettier --write . && biome check --write ."
"check": "biome check --write ."
},
"dependencies": {
"@astrojs/check": "^0.9.6",
Expand Down Expand Up @@ -50,8 +50,6 @@
"@types/react-dom": "19.2.3",
"autoprefixer": "^10.4.23",
"postcss": "^8",
"prettier": "^3.4.2",
"prettier-plugin-astro": "^0.14.1",
"tailwindcss": "^3.4.19"
},
"overrides": {
Expand Down
18 changes: 0 additions & 18 deletions prettier.config.js

This file was deleted.

279 changes: 278 additions & 1 deletion public/assets/bundled/bm-index.mjs

Large diffs are not rendered by default.

29 changes: 12 additions & 17 deletions public/assets/bundled/v.cnfg.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const filePrefix = "/assets/bundled/v."
const filePrefix = "/assets/bundled/v.";
// cursed encoding method
const factory = (key) => {
const getShuffledAlphabet = () => {
const alphabet =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
return shuffle(alphabet, key);
};
const shuffle = (alphabet, key) => {
Expand All @@ -26,8 +25,7 @@ const factory = (key) => {

const base64Encode = (text) => {
const shuffledAlphabet = getShuffledAlphabet();
const alphabet =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
return [...btoa(text)]
.map((char) => {
const index = alphabet.indexOf(char);
Expand All @@ -38,8 +36,7 @@ const factory = (key) => {

const base64Decode = (encodedText) => {
const shuffledAlphabet = getShuffledAlphabet();
const alphabet =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
return atob(
[...encodedText]
.map((char) => {
Expand All @@ -54,9 +51,7 @@ const factory = (key) => {
enc: base64Encode,
dec: (encodedText) => {
if (encodedText.includes("?")) {
encodedText = base64Encode(
`${base64Decode(encodedText.split("?")[0])}?${encodedText.split("?")[1]}`,
);
encodedText = base64Encode(`${base64Decode(encodedText.split("?")[0])}?${encodedText.split("?")[1]}`);
}
return base64Decode(encodedText);
},
Expand All @@ -66,7 +61,7 @@ const factory = (key) => {
const cipher = factory((location.origin + navigator.userAgent).toUpperCase());
/** @type {import("@titaniumnetwork-dev/ultraviolet").UVConfig}*/
const config = {
prefix: '/jquery/',
prefix: "/jquery/",
encodeUrl: cipher.enc,
decodeUrl: cipher.dec,
handler: `${filePrefix}hndlr.js`,
Expand All @@ -81,18 +76,18 @@ const config = {
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">
`
`,
},
{
host: /youtube.com*/,
injectTo: "head",
html: `<script>console.log("hello world!")</script>` /* to-do: remove 4k option */
html: `<script>console.log("hello world!")</script>` /* to-do: remove 4k option */,
},
{
host: /now.gg*/,
injectTo: "head",
html: `<script>document.querySelectorAll("div.sc-19c21da7-0.dgAMyI").forEach(function(c){c.remove()});</script>`
}
]
};
html: `<script>document.querySelectorAll("div.sc-19c21da7-0.dgAMyI").forEach(function(c){c.remove()});</script>`,
},
],
};
self.__uv$config = config;
5,587 changes: 5,568 additions & 19 deletions public/assets/scramjet/scramjet.all.js

Large diffs are not rendered by default.

5,875 changes: 5,856 additions & 19 deletions public/assets/scramjet/scramjet.bundle.js

Large diffs are not rendered by default.

41 changes: 39 additions & 2 deletions public/assets/scramjet/scramjet.sync.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions src/components/ArrowButton.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,9 @@ interface Props {
const { id, title = "Open" } = Astro.props;
---

<button
id={id}
class="group flex items-center gap-2 h-9 px-4 bg-white/5 border border-white/10 rounded text-sm text-text-secondary hover:text-text hover:bg-white/10 hover:border-white/20 transition-all"
>
<button id={id} class="group flex items-center gap-2 h-9 px-4 bg-white/5 border border-white/10 rounded text-sm text-text-secondary hover:text-text hover:bg-white/10 hover:border-white/20 transition-all">
<span>{title}</span>
<svg
class="w-3.5 h-3.5 transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5"
viewBox="0 0 15 15"
fill="none"
stroke="currentColor"
stroke-width="1.5"
>
<svg class="w-3.5 h-3.5 transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5" viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M4 11L11 4M11 4H5.5M11 4V9.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</button>
46 changes: 19 additions & 27 deletions src/components/AssetCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,25 @@ export const prerender = false;

<div data-asset={JSON.stringify(asset)} data-asset-card class="group relative cursor-pointer" role="button" tabindex="0">
<div class="relative overflow-hidden rounded bg-white/[0.03] border border-white/10 hover:border-white/25 hover:bg-white/[0.06] transition-all">
{asset.custom && (
<button
type="button"
data-asset-remove={JSON.stringify({ type: assetType, id: asset.id, name: asset.name, link: asset.link, image: asset.image })}
class="absolute right-1.5 top-1.5 z-10 flex h-5 w-5 items-center justify-center rounded-full bg-black/70 text-white/80 hover:text-white hover:bg-black/90 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-auto"
aria-label="Remove"
>
</button>
)}
{asset.image?.startsWith("/") ? (
<Image
loading="lazy"
src={asset.image}
alt={asset.name}
height={128}
width={128}
class="w-full aspect-square object-cover opacity-90 group-hover:opacity-100 group-hover:scale-105 transition-all duration-300"
/>
) : (
<img
loading="lazy"
src={asset.image}
alt={asset.name}
class="w-full aspect-square object-cover opacity-90 group-hover:opacity-100 group-hover:scale-105 transition-all duration-300"
/>
)}
{
asset.custom && (
<button
type="button"
data-asset-remove={JSON.stringify({ type: assetType, id: asset.id, name: asset.name, link: asset.link, image: asset.image })}
class="absolute right-1.5 top-1.5 z-10 flex h-5 w-5 items-center justify-center rounded-full bg-black/70 text-white/80 hover:text-white hover:bg-black/90 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-auto"
aria-label="Remove"
>
</button>
)
}
{
asset.image?.startsWith("/") ? (
<Image loading="lazy" src={asset.image} alt={asset.name} height={128} width={128} class="w-full aspect-square object-cover opacity-90 group-hover:opacity-100 group-hover:scale-105 transition-all duration-300" />
) : (
<img loading="lazy" src={asset.image} alt={asset.name} class="w-full aspect-square object-cover opacity-90 group-hover:opacity-100 group-hover:scale-105 transition-all duration-300" />
)
}

<div class="absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity">
<div class="absolute bottom-0 left-0 right-0 p-3">
Expand Down
35 changes: 4 additions & 31 deletions src/components/Browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ import { actionBarClass, addressInputClass, classNames, closeButtonClass, encode
type ScramjetWindow = Window & { __scramjet$config?: unknown };

const IconButton = ({ onClick, icon: Icon, className = "", disabled = false, title = "" }: { onClick?: () => void; icon: React.ComponentType<{ className?: string }>; className?: string; disabled?: boolean; title?: string }) => (
<button
type="button"
onClick={onClick}
disabled={disabled}
title={title}
className={classNames(iconButtonClass, "disabled:opacity-30 disabled:cursor-not-allowed", className)}
>
<button type="button" onClick={onClick} disabled={disabled} title={title} className={classNames(iconButtonClass, "disabled:opacity-30 disabled:cursor-not-allowed", className)}>
<Icon className="h-4 w-4" />
</button>
);
Expand Down Expand Up @@ -416,17 +410,7 @@ export default function Browser() {
<div className="flex h-screen flex-col bg-background">
<div className="flex items-center gap-1 bg-background-secondary/50 px-2 py-1.5 border-b border-border/50">
{tabs.map((tab) => (
<button
key={tab.id}
type="button"
onClick={() => setActiveTab(tab.id)}
className={classNames(
tabButtonClass,
tab.active
? "bg-background text-text border border-border/50"
: "text-text-secondary hover:text-text hover:bg-white/5"
)}
>
<button key={tab.id} type="button" onClick={() => setActiveTab(tab.id)} className={classNames(tabButtonClass, tab.active ? "bg-background text-text border border-border/50" : "text-text-secondary hover:text-text hover:bg-white/5")}>
<div className="flex min-w-0 flex-1 items-center gap-2">
{favicons[tab.id] ? (
<img
Expand Down Expand Up @@ -455,12 +439,7 @@ export default function Browser() {
</button>
</button>
))}
<button
type="button"
className="inline-flex h-6 w-6 items-center justify-center rounded text-text-secondary hover:text-accent hover:bg-white/5 transition-all"
onClick={addNewTab}
aria-label="Add tab"
>
<button type="button" className="inline-flex h-6 w-6 items-center justify-center rounded text-text-secondary hover:text-accent hover:bg-white/5 transition-all" onClick={addNewTab} aria-label="Add tab">
<Plus className="h-3.5 w-3.5" />
</button>
</div>
Expand All @@ -476,13 +455,7 @@ export default function Browser() {
<div className="flex-1">
<div className={actionBarClass}>
<Lock className="h-3.5 w-3.5 text-text-placeholder" />
<input
className={addressInputClass}
value={url}
placeholder="Search or enter address"
onChange={(e) => setUrl(e.target.value)}
onKeyDown={(e) => e.key === "Enter" && handleNavigate(e.currentTarget.value)}
/>
<input className={addressInputClass} value={url} placeholder="Search or enter address" onChange={(e) => setUrl(e.target.value)} onKeyDown={(e) => e.key === "Enter" && handleNavigate(e.currentTarget.value)} />
</div>
</div>

Expand Down
Loading
Loading