From 41f5d71e38f785786656e111cf2ea1200e45886d Mon Sep 17 00:00:00 2001 From: V Date: Tue, 19 Sep 2023 04:07:24 +0200 Subject: Bundle dependencies with extensions for webstore rule compliance (#1740) --- browser/VencordNativeStub.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'browser/VencordNativeStub.ts') diff --git a/browser/VencordNativeStub.ts b/browser/VencordNativeStub.ts index 664e9ee..e3df0d6 100644 --- a/browser/VencordNativeStub.ts +++ b/browser/VencordNativeStub.ts @@ -19,9 +19,11 @@ /// /// -import monacoHtml from "~fileContent/../src/components/monacoWin.html"; +import monacoHtmlLocal from "~fileContent/monacoWin.html"; +import monacoHtmlCdn from "~fileContent/../src/main/monacoWin.html"; import * as DataStore from "../src/api/DataStore"; import { debounce } from "../src/utils"; +import { EXTENSION_BASE_URL } from "../src/utils/web-metadata"; import { getTheme, Theme } from "../src/utils/discord"; import { getThemeInfo } from "../src/main/themes"; @@ -80,6 +82,7 @@ window.VencordNative = { return; } + win.baseUrl = EXTENSION_BASE_URL; win.setCss = setCssDebounced; win.getCurrentCss = () => VencordNative.quickCss.get(); win.getTheme = () => @@ -87,7 +90,7 @@ window.VencordNative = { ? "vs-light" : "vs-dark"; - win.document.write(monacoHtml); + win.document.write(IS_EXTENSION ? monacoHtmlLocal : monacoHtmlCdn); }, }, -- cgit