mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
format: run prettify
This commit is contained in:
+31
-29
@@ -1,65 +1,67 @@
|
||||
import {
|
||||
initializeSettingsState,
|
||||
settingsState,
|
||||
} from "@/seqta/utils/listeners/SettingsState"
|
||||
import documentLoadCSS from "@/css/documentload.scss?inline"
|
||||
import icon48 from "@/resources/icons/icon-48.png?base64"
|
||||
import browser from "webextension-polyfill"
|
||||
} from "@/seqta/utils/listeners/SettingsState";
|
||||
import documentLoadCSS from "@/css/documentload.scss?inline";
|
||||
import icon48 from "@/resources/icons/icon-48.png?base64";
|
||||
import browser from "webextension-polyfill";
|
||||
|
||||
import * as plugins from "@/plugins"
|
||||
import { main } from "@/seqta/main"
|
||||
import * as plugins from "@/plugins";
|
||||
import { main } from "@/seqta/main";
|
||||
|
||||
export let MenuOptionsOpen = false;
|
||||
|
||||
export let MenuOptionsOpen = false
|
||||
|
||||
var IsSEQTAPage = false
|
||||
let hasSEQTAText = false
|
||||
var IsSEQTAPage = false;
|
||||
let hasSEQTAText = false;
|
||||
|
||||
// This check is placed outside of the document load event due to issues with EP (https://github.com/BetterSEQTA/BetterSEQTA-Plus/issues/84)
|
||||
if (document.childNodes[1]) {
|
||||
hasSEQTAText =
|
||||
document.childNodes[1].textContent?.includes(
|
||||
"Copyright (c) SEQTA Software",
|
||||
) ?? false
|
||||
init()
|
||||
) ?? false;
|
||||
init();
|
||||
}
|
||||
|
||||
async function init() {
|
||||
const hasSEQTATitle = document.title.includes("SEQTA Learn")
|
||||
const hasSEQTATitle = document.title.includes("SEQTA Learn");
|
||||
|
||||
if (hasSEQTAText && hasSEQTATitle && !IsSEQTAPage) { // Verify we are on a SEQTA page
|
||||
IsSEQTAPage = true
|
||||
console.info("[BetterSEQTA+] Verified SEQTA Page")
|
||||
if (hasSEQTAText && hasSEQTATitle && !IsSEQTAPage) {
|
||||
// Verify we are on a SEQTA page
|
||||
IsSEQTAPage = true;
|
||||
console.info("[BetterSEQTA+] Verified SEQTA Page");
|
||||
|
||||
const documentLoadStyle = document.createElement("style")
|
||||
documentLoadStyle.textContent = documentLoadCSS
|
||||
document.head.appendChild(documentLoadStyle)
|
||||
const documentLoadStyle = document.createElement("style");
|
||||
documentLoadStyle.textContent = documentLoadCSS;
|
||||
document.head.appendChild(documentLoadStyle);
|
||||
|
||||
const icon = document.querySelector('link[rel*="icon"]')! as HTMLLinkElement
|
||||
icon.href = icon48 // Change the icon
|
||||
const icon = document.querySelector(
|
||||
'link[rel*="icon"]',
|
||||
)! as HTMLLinkElement;
|
||||
icon.href = icon48; // Change the icon
|
||||
|
||||
try {
|
||||
await initializeSettingsState()
|
||||
await initializeSettingsState();
|
||||
|
||||
if (typeof settingsState.onoff === "undefined") {
|
||||
await browser.runtime.sendMessage({ type: "setDefaultStorage" })
|
||||
await browser.runtime.sendMessage({ type: "setDefaultStorage" });
|
||||
}
|
||||
|
||||
await main()
|
||||
await main();
|
||||
|
||||
if (settingsState.onoff) {
|
||||
// Initialize legacy plugins
|
||||
plugins.Monofile()
|
||||
plugins.Monofile();
|
||||
|
||||
// Initialize new plugin system
|
||||
await plugins.initializePlugins();
|
||||
}
|
||||
|
||||
|
||||
console.info(
|
||||
"[BetterSEQTA+] Successfully initialised BetterSEQTA+, starting to load assets.",
|
||||
)
|
||||
);
|
||||
} catch (error: any) {
|
||||
console.error(error)
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user