diff options
Diffstat (limited to 'browser/content.js')
-rw-r--r-- | browser/content.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/browser/content.js b/browser/content.js index 2c4b40e..e47ef83 100644 --- a/browser/content.js +++ b/browser/content.js @@ -2,7 +2,18 @@ if (typeof browser === "undefined") { var browser = chrome; } -var script = document.createElement("script"); +const script = document.createElement("script"); script.src = browser.runtime.getURL("dist/Vencord.js"); -// documentElement because we load before body/head are ready -document.documentElement.appendChild(script); + +const style = document.createElement("link"); +style.type = "text/css"; +style.rel = "stylesheet"; +style.href = browser.runtime.getURL("dist/Vencord.css"); + +document.documentElement.append(script); + +document.addEventListener( + "DOMContentLoaded", + () => document.documentElement.append(style), + { once: true } +); |