Use much stricter, whitelist based CSP (#3162)

This commit is contained in:
Vending Machine 2025-06-06 18:30:19 +02:00 committed by GitHub
parent 0ce7772500
commit e7076f5aee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 221 additions and 74 deletions

View file

@ -33,7 +33,7 @@ import definePlugin from "@utils/types";
import { Forms, Toasts, UserStore } from "@webpack/common";
import { User } from "discord-types/general";
const CONTRIBUTOR_BADGE = "https://vencord.dev/assets/favicon.png";
const CONTRIBUTOR_BADGE = "https://cdn.discordapp.com/emojis/1092089799109775453.png?size=64";
const ContributorBadge: ProfileBadge = {
description: "Vencord Contributor",

View file

@ -91,7 +91,7 @@ function parseNode(node: Node) {
function initWs(isManual = false) {
let wasConnected = isManual;
let hasErrored = false;
const ws = socket = new WebSocket(`ws://localhost:${PORT}`);
const ws = socket = new WebSocket(`ws://127.0.0.1:${PORT}`);
ws.addEventListener("open", () => {
wasConnected = true;

View file

@ -53,14 +53,12 @@ function makeSearchItem(src: string) {
<Flex style={{ alignItems: "center", gap: "0.5em" }}>
<img
style={{
borderRadius: i >= 3 // Do not round Google, Yandex & SauceNAO
? "50%"
: void 0
borderRadius: "50%",
}}
aria-hidden="true"
height={16}
width={16}
src={new URL("/favicon.ico", Engines[engine]).toString().replace("lens.", "")}
src={`https://icons.duckduckgo.com/ip3/${new URL(Engines[engine]).host}.ico`}
/>
{engine}
</Flex>