diff --git a/.github/ISSUE_TEMPLATE/blank.yml b/.github/ISSUE_TEMPLATE/blank.yml
index ba2b15b0..e8ca246d 100644
--- a/.github/ISSUE_TEMPLATE/blank.yml
+++ b/.github/ISSUE_TEMPLATE/blank.yml
@@ -2,9 +2,29 @@ name: Blank Issue
description: Create a blank issue. ALWAYS FIRST USE OUR SUPPORT CHANNEL! ONLY USE THIS FORM IF YOU ARE A CONTRIBUTOR OR WERE TOLD TO DO SO IN THE SUPPORT CHANNEL.
body:
+ - type: markdown
+ attributes:
+ value: |
+ # READ THIS BEFORE OPENING AN ISSUE
+
+ This form is ONLY FOR DEVELOPERS. YOUR ISSUE WILL BE CLOSED AND YOU WILL POSSIBLY BE BLOCKED FROM THE REPOSITORY IF YOU IGNORE THIS.
+
+ DO NOT USE THIS FORM, unless
+ - you are a vencord contributor
+ - you were given explicit permission to use this form by a moderator in our support server
+ - you are filing a security related report
+
- type: textarea
id: content
attributes:
label: Content
validations:
required: true
+
+ - type: checkboxes
+ id: agreement-check
+ attributes:
+ label: Request Agreement
+ options:
+ - label: I have read the requirements for opening an issue above
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index e7afec3c..74b2a418 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -4,6 +4,18 @@ labels: [bug]
title: "[Bug]
"
body:
+ - type: markdown
+ attributes:
+ value: |
+ # READ THIS BEFORE OPENING AN ISSUE
+
+ This form is ONLY FOR DEVELOPERS. YOUR ISSUE WILL BE CLOSED AND YOU WILL POSSIBLY BE BLOCKED FROM THE REPOSITORY IF YOU IGNORE THIS.
+
+ DO NOT USE THIS FORM, unless
+ - you are a vencord contributor
+ - you were given explicit permission to use this form by a moderator in our support server
+ - you are filing a security related report
+
- type: input
id: discord
attributes:
@@ -64,3 +76,5 @@ body:
options:
- label: I am using Discord Stable or tried on Stable and this bug happens there as well
required: true
+ - label: I have read the requirements for opening an issue above
+ required: true
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 9d56e9a9..83236c11 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -36,26 +36,10 @@ jobs:
- name: Publish extension
run: |
- # Do not fail so that even if chrome fails, firefox gets a shot. But also store exit code to fail workflow later
- EXIT_CODE=0
-
- # Chrome
cd dist/chromium-unpacked
- pnpx chrome-webstore-upload-cli@2.1.0 upload --auto-publish || EXIT_CODE=$?
-
- # Firefox
- cd ../firefox-unpacked
- npm i -g web-ext@7.4.0 web-ext-submit@7.4.0
- web-ext-submit || EXIT_CODE=$?
-
- exit $EXIT_CODE
+ pnpx chrome-webstore-upload-cli@2.1.0 upload --auto-publish
env:
- # Chrome
EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
-
- # Firefox
- WEB_EXT_API_KEY: ${{ secrets.WEBEXT_USER }}
- WEB_EXT_API_SECRET: ${{ secrets.WEBEXT_SECRET }}
diff --git a/README.md b/README.md
index e848fd25..cd54fcdc 100644
--- a/README.md
+++ b/README.md
@@ -22,29 +22,7 @@ The cutest Discord client mod
## Installing / Uninstalling
-Click the below button to install Vencord to the Discord Desktop app
-
-[![Download and run the Installer](https://img.shields.io/github/v/release/Vencord/Installer?label=Download%20Vencord%20Installer&style=for-the-badge)](https://github.com/Vencord/Installer#vencord-installer)
-
-## Installing on Browser
-
-[![Get it on the Firefox Webstore](https://blog.mozilla.org/addons/files/2015/11/get-the-addon.png)](https://addons.mozilla.org/en-GB/firefox/addon/vencord-web/) [![Get it on the Chrome Webstore](https://storage.googleapis.com/web-dev-uploads/image/WlD8wC6g8khYWPJUsQceQkhXSlv1/UV4C4ybeBTsZt43U4xis.png)](https://chrome.google.com/webstore/detail/vencord-web/cbghhgpcnddeihccjmnadmkaejncjndb)
-
-Or use the [UserScript](https://raw.githubusercontent.com/Vencord/builds/main/Vencord.user.js) - Please note that the CSS Editor, Themes loaded from remote sources and co. will not work in the UserScript. Use the extension if you need any of those
-
-
-Alternative Downloads
-
-## Vencord Desktop
-
-> **Warning**
-> This is an alternative app. It currently doesn't support keybinds and possibly some more features. If you just want to install to the normal Discord Desktop app, scroll up
-
-As an alternative to the Discord Desktop app, Vencord also has its own standalone Desktop app that is snappier and lighter than Discord's official Desktop app
-
-[![Download Vencord Desktop](https://img.shields.io/github/v/release/Vencord/Desktop?label=Download%20Vencord%20Desktop&style=for-the-badge)](https://github.com/Vencord/Desktop#vencord-desktop)
-
-
+Visit https://vencord.dev/download
## Join our Support/Community Server
diff --git a/browser/background.js b/browser/background.js
new file mode 100644
index 00000000..1f2d5ec1
--- /dev/null
+++ b/browser/background.js
@@ -0,0 +1,32 @@
+/**
+ * @template T
+ * @param {T[]} arr
+ * @param {(v: T) => boolean} predicate
+ */
+function removeFirst(arr, predicate) {
+ const idx = arr.findIndex(predicate);
+ if (idx !== -1) arr.splice(idx, 1);
+}
+
+chrome.webRequest.onHeadersReceived.addListener(
+ ({ responseHeaders, type, url }) => {
+ if (!responseHeaders) return;
+
+ if (type === "main_frame") {
+ // In main frame requests, the CSP needs to be removed to enable fetching of custom css
+ // as desired by the user
+ removeFirst(responseHeaders, h => h.name.toLowerCase() === "content-security-policy");
+ } else if (type === "stylesheet" && url.startsWith("https://raw.githubusercontent.com/")) {
+ // Most users will load css from GitHub, but GitHub doesn't set the correct content type,
+ // so we fix it here
+ removeFirst(responseHeaders, h => h.name.toLowerCase() === "content-type");
+ responseHeaders.push({
+ name: "Content-Type",
+ value: "text/css"
+ });
+ }
+ return { responseHeaders };
+ },
+ { urls: ["https://raw.githubusercontent.com/*", "*://*.discord.com/*"], types: ["main_frame", "stylesheet"] },
+ ["blocking", "responseHeaders"]
+);
diff --git a/browser/manifestv2.json b/browser/manifestv2.json
index a6feada7..3cac9450 100644
--- a/browser/manifestv2.json
+++ b/browser/manifestv2.json
@@ -26,7 +26,11 @@
}
],
- "web_accessible_resources": ["dist/*", "third-party/*"],
+ "background": {
+ "scripts": ["background.js"]
+ },
+
+ "web_accessible_resources": ["dist/Vencord.js", "dist/Vencord.css"],
"browser_specific_settings": {
"gecko": {
diff --git a/package.json b/package.json
index c0b3998f..d0ce6299 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "vencord",
"private": "true",
- "version": "1.5.2",
+ "version": "1.5.6",
"description": "The cutest Discord client mod",
"homepage": "https://github.com/Vendicated/Vencord#readme",
"bugs": {
@@ -99,7 +99,7 @@
"build": {
"overwriteDest": true
},
- "sourceDir": "./dist/extension-v2-unpacked"
+ "sourceDir": "./dist/firefox-unpacked"
},
"engines": {
"node": ">=18",
diff --git a/scripts/build/buildWeb.mjs b/scripts/build/buildWeb.mjs
index e4eeb53e..353f4e06 100644
--- a/scripts/build/buildWeb.mjs
+++ b/scripts/build/buildWeb.mjs
@@ -145,11 +145,11 @@ async function loadDir(dir, basePath = "") {
/**
* @type {(target: string, files: string[]) => Promise}
*/
-async function buildExtension(target, files, noMonaco = false) {
+async function buildExtension(target, files) {
const entries = {
"dist/Vencord.js": await readFile("dist/extension.js"),
"dist/Vencord.css": await readFile("dist/extension.css"),
- ...(noMonaco ? {} : await loadDir("dist/monaco")),
+ ...await loadDir("dist/monaco"),
...Object.fromEntries(await Promise.all(RnNoiseFiles.map(async file =>
[`third-party/rnnoise/${file.replace(/^dist\//, "")}`, await readFile(`node_modules/@sapphi-red/web-noise-suppressor/${file}`)]
))),
@@ -195,8 +195,11 @@ const appendCssRuntime = readFile("dist/Vencord.user.css", "utf-8").then(content
await Promise.all([
appendCssRuntime,
buildExtension("chromium-unpacked", ["modifyResponseHeaders.json", "content.js", "manifest.json", "icon.png"]),
- buildExtension("firefox-unpacked", ["content.js", "manifestv2.json", "icon.png"], true),
+ buildExtension("firefox-unpacked", ["background.js", "content.js", "manifestv2.json", "icon.png"]),
]);
-Zip.sync.zip("dist/chromium-unpacked").compress().save("dist/extension.zip");
-console.info("Packed Chromium Extension written to dist/extension.zip");
+Zip.sync.zip("dist/chromium-unpacked").compress().save("dist/extension-chrome.zip");
+console.info("Packed Chromium Extension written to dist/extension-chrome.zip");
+
+Zip.sync.zip("dist/firefox-unpacked").compress().save("dist/extension-firefox.zip");
+console.info("Packed Firefox Extension written to dist/extension-firefox.zip");
diff --git a/src/api/MemberListDecorators.ts b/src/api/MemberListDecorators.ts
index fade2a7c..e148bb0a 100644
--- a/src/api/MemberListDecorators.ts
+++ b/src/api/MemberListDecorators.ts
@@ -20,7 +20,6 @@ import { Channel, User } from "discord-types/general/index.js";
interface DecoratorProps {
activities: any[];
- canUseAvatarDecorations: boolean;
channel: Channel;
/**
* Only for DM members
@@ -52,9 +51,9 @@ export function removeDecorator(identifier: string) {
decorators.delete(identifier);
}
-export function __addDecoratorsToList(props: DecoratorProps): (JSX.Element | null)[] {
+export function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] {
const isInGuild = !!(props.guildId);
- return [...decorators.values()].map(decoratorObj => {
+ return Array.from(decorators.values(), decoratorObj => {
const { decorator, onlyIn } = decoratorObj;
// this can most likely be done cleaner
if (!onlyIn || (onlyIn === "guilds" && isInGuild) || (onlyIn === "dms" && !isInGuild)) {
diff --git a/src/api/Settings.ts b/src/api/Settings.ts
index a803b8d4..8e2a1c79 100644
--- a/src/api/Settings.ts
+++ b/src/api/Settings.ts
@@ -253,7 +253,8 @@ type ResolvePropDeep = P extends "" ? T :
export function addSettingsListener(path: Path, onUpdate: (newValue: Settings[Path], path: Path) => void, exact?: boolean): void;
export function addSettingsListener(path: Path, onUpdate: (newValue: Path extends "" ? any : ResolvePropDeep, path: Path extends "" ? string : Path) => void, exact?: boolean): void;
export function addSettingsListener(path: string, onUpdate: (newValue: any, path: string) => void, exact = true) {
- ((onUpdate as SubscriptionCallback)._paths ??= []).push(path);
+ if (path)
+ ((onUpdate as SubscriptionCallback)._paths ??= []).push(path);
(onUpdate as SubscriptionCallback)._exact = exact;
subscriptions.add(onUpdate);
}
diff --git a/src/components/ThemeSettings/ThemesTab.tsx b/src/components/ThemeSettings/ThemesTab.tsx
index 1c99df80..297fbfe3 100644
--- a/src/components/ThemeSettings/ThemesTab.tsx
+++ b/src/components/ThemeSettings/ThemesTab.tsx
@@ -20,13 +20,11 @@ import "./themesStyles.css";
import { Settings, useSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles";
-import { ErrorCard } from "@components/ErrorCard";
import { Flex } from "@components/Flex";
import { CogWheel, DeleteIcon } from "@components/Icons";
import { Link } from "@components/Link";
import { AddonCard } from "@components/VencordSettings/AddonCard";
import { SettingsTab, wrapTab } from "@components/VencordSettings/shared";
-import { IsFirefox } from "@utils/constants";
import { Margins } from "@utils/margins";
import { classes } from "@utils/misc";
import { openModal } from "@utils/modal";
@@ -353,14 +351,12 @@ function ThemesTab() {
>
Load missing Themes
- {!IsFirefox && (
-
- )}
+
>
@@ -435,15 +431,6 @@ function ThemesTab() {
return (
- {IsFirefox && (
-
- Warning
-
- You are using Firefox. Expect the vast majority of themes to not work.
- If this is a problem, use a chromium browser or Discord Desktop / Vesktop.
-
-
- )}
)}
- {!IsFirefox && (
-
- )}
+
{!IS_WEB && (
)}
);
}
-function ToggleActivityComponentWithBackground({ activity }: { activity: IgnoredActivity; }) {
- return (
-