Allow users to manually whitelist Domains for use in themes (#3476)

This commit is contained in:
Vending Machine 2025-06-12 02:19:45 +02:00 committed by GitHub
parent 7f2c4a3566
commit ed5ed4b80a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 313 additions and 46 deletions

View file

@ -28,12 +28,15 @@ import { FSWatcher, mkdirSync, watch, writeFileSync } from "fs";
import { open, readdir, readFile } from "fs/promises";
import { join, normalize } from "path";
import { registerCspIpcHandlers } from "./csp/manager";
import { getThemeInfo, stripBOM, UserThemeHeader } from "./themes";
import { ALLOWED_PROTOCOLS, QUICKCSS_PATH, THEMES_DIR } from "./utils/constants";
import { makeLinksOpenExternally } from "./utils/externalLinks";
mkdirSync(THEMES_DIR, { recursive: true });
registerCspIpcHandlers();
export function ensureSafePath(basePath: string, path: string) {
const normalizedBasePath = normalize(basePath + "/");
const newPath = join(basePath, path);