mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 05:27:03 +03:00
25 lines
634 B
TypeScript
25 lines
634 B
TypeScript
import { localizeHtmlPage } from "../maze-utils/src/setup";
|
|
import Config from "./config";
|
|
import { showDonationLink } from "./utils/configUtils";
|
|
|
|
import { waitFor } from "../maze-utils/src";
|
|
|
|
if (document.readyState === "complete") {
|
|
init();
|
|
} else {
|
|
document.addEventListener("DOMContentLoaded", init);
|
|
}
|
|
|
|
async function init() {
|
|
localizeHtmlPage();
|
|
|
|
await waitFor(() => Config.config !== null);
|
|
|
|
if (!Config.config.darkMode) {
|
|
document.documentElement.setAttribute("data-theme", "light");
|
|
}
|
|
|
|
if (!showDonationLink()) {
|
|
document.getElementById("sbDonate").style.display = "none";
|
|
}
|
|
} |