From b8818e73c9a80035035ccbbef43784371e3708a0 Mon Sep 17 00:00:00 2001 From: Samidy Date: Wed, 8 Apr 2026 22:12:58 +0300 Subject: [PATCH] im such a fat chud Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- js/themeStore.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/themeStore.js b/js/themeStore.js index 27d2bb3..9ddeb80 100644 --- a/js/themeStore.js +++ b/js/themeStore.js @@ -416,7 +416,15 @@ export class ThemeStore { const customUrl = urlMatch[1].trim().replace(/['"]/g, ''); console.log(`Applying custom font URL: ${customUrl}`); - if (customUrl.match(/\.(css)$/i) || customUrl.includes('fonts.googleapis.com')) { + let isGoogleFontsHost = false; + try { + const parsedUrl = new URL(customUrl, window.location.href); + isGoogleFontsHost = parsedUrl.hostname === 'fonts.googleapis.com'; + } catch (_e) { + isGoogleFontsHost = false; + } + + if (customUrl.match(/\.(css)$/i) || isGoogleFontsHost) { if (!link) { link = document.createElement('link'); link.id = FONT_LINK_ID;