fix icons not loading properly

This commit is contained in:
SethBurkart123
2023-12-21 13:23:31 +11:00
parent b565993fbe
commit d56e5b1474
+11 -11
View File
@@ -674,11 +674,13 @@ function main(storedSetting: SettingsState) {
waitForElm('.code').then(AppendElementsToDisabledPage) waitForElm('.code').then(AppendElementsToDisabledPage)
} }
if (storedSetting.DarkMode) { console.log("Enabled > ", storedSetting.onoff)
if (storedSetting.onoff) {
console.log('[BetterSEQTA+] Enabled') console.log('[BetterSEQTA+] Enabled')
if (DarkMode) { if (DarkMode) document.documentElement.classList.add('dark')
document.documentElement.classList.add('dark')
} new StorageListener()
new MessageHandler()
updateAllColors(storedSetting) updateAllColors(storedSetting)
loading() loading()
@@ -695,16 +697,17 @@ function main(storedSetting: SettingsState) {
} }
function InjectCustomIcons() { function InjectCustomIcons() {
console.log('[BetterSEQTA+] Injecting Icons')
const fontURL = browser.runtime.getURL('fonts/IconFamily.woff') const fontURL = browser.runtime.getURL('fonts/IconFamily.woff')
const style = document.createElement('style') const style = document.createElement('style')
style.setAttribute('type', 'text/css') style.setAttribute('type', 'text/css')
style.innerHTML = ` style.innerHTML = `
@font-face { @font-face {
font-family: 'IconFamily' font-family: 'IconFamily';
src: url('${fontURL}') format('woff') src: url('${fontURL}') format('woff');
font-weight: normal font-weight: normal;
font-style: normal font-style: normal;
}` }`
document.head.appendChild(style) document.head.appendChild(style)
} }
@@ -741,9 +744,6 @@ export function AppendElementsToDisabledPage() {
document.head.append(settingsStyle) document.head.append(settingsStyle)
} }
new StorageListener()
new MessageHandler()
var PageLoaded = false var PageLoaded = false
async function CheckLoadOnPeriods() { async function CheckLoadOnPeriods() {
if (!PageLoaded) { if (!PageLoaded) {