mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix: custom seqta icon not displaying in most cases
This commit is contained in:
+2
-7
@@ -4,7 +4,7 @@ import loading, { AppendLoadingSymbol } from './seqta/ui/Loading'
|
||||
import IconFamily from './resources/fonts/IconFamily.woff'
|
||||
import LogoLight from './resources/icons/betterseqta-light-icon.png'
|
||||
import LogoLightOutline from './resources/icons/betterseqta-light-outline.png'
|
||||
import icon48 from './resources/icons/icon-48.png'
|
||||
import icon48 from './resources/icons/icon-48.png?base64'
|
||||
|
||||
import Color from 'color'
|
||||
import MenuitemSVGKey from './seqta/content/MenuItemSVGKey.json'
|
||||
@@ -39,7 +39,6 @@ export let MenuOptionsOpen = false
|
||||
let currentSelectedDate = new Date()
|
||||
let LessonInterval: any
|
||||
|
||||
var NonSEQTAPage = false
|
||||
var IsSEQTAPage = false
|
||||
|
||||
// This check is placed outside of the document load event due to issues with EP (https://github.com/BetterSEQTA/BetterSEQTA-Plus/issues/84)
|
||||
@@ -75,10 +74,6 @@ async function init() {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasSEQTAText) {
|
||||
NonSEQTAPage = true
|
||||
}
|
||||
}
|
||||
|
||||
function SetDisplayNone(ElementName: string) {
|
||||
@@ -1952,7 +1947,7 @@ export async function loadHomePage() {
|
||||
}
|
||||
|
||||
const icon = document.querySelector('link[rel*="icon"]')! as HTMLLinkElement
|
||||
icon.href = browser.runtime.getURL(icon48)
|
||||
icon.href = icon48
|
||||
|
||||
currentSelectedDate = new Date()
|
||||
|
||||
|
||||
Vendored
+25
@@ -3,3 +3,28 @@ declare module '*.woff';
|
||||
declare module '*.scss';
|
||||
declare module '*.png';
|
||||
declare module '*.html';
|
||||
|
||||
declare module "*.png?base64" {
|
||||
const value: string;
|
||||
export default value;
|
||||
}
|
||||
|
||||
declare module "*.jpg?base64" {
|
||||
const value: string;
|
||||
export default value;
|
||||
}
|
||||
|
||||
declare module "*.jpeg?base64" {
|
||||
const value: string;
|
||||
export default value;
|
||||
}
|
||||
|
||||
declare module "*.gif?base64" {
|
||||
const value: string;
|
||||
export default value;
|
||||
}
|
||||
|
||||
declare module "*.svg?base64" {
|
||||
const value: string;
|
||||
export default value;
|
||||
}
|
||||
@@ -4,14 +4,11 @@ import { lightenAndPaleColor } from './lightenAndPaleColor';
|
||||
import ColorLuminance from './ColorLuminance';
|
||||
import { settingsState } from '../../utils/listeners/SettingsState';
|
||||
|
||||
import icon48 from '../../../resources/icons/icon-48.png';
|
||||
|
||||
import darkLogo from '../../../resources/icons/betterseqta-light-full.png';
|
||||
import lightLogo from '../../../resources/icons/betterseqta-dark-full.png';
|
||||
|
||||
// Helper functions
|
||||
const setCSSVar = (varName: any, value: any) => document.documentElement.style.setProperty(varName, value);
|
||||
const getChromeURL = (path: any) => browser.runtime.getURL(path);
|
||||
const applyProperties = (props: any) => Object.entries(props).forEach(([key, value]) => setCSSVar(key, value));
|
||||
|
||||
|
||||
@@ -57,11 +54,6 @@ export function updateAllColors() {
|
||||
// Apply all the properties
|
||||
applyProperties({ ...commonProps, ...modeProps, ...dynamicProps });
|
||||
|
||||
// Set favicon, if storedSetting is provided
|
||||
if (settingsState.DarkMode !== null) {
|
||||
(document.querySelector('link[rel*=\'icon\']')! as HTMLLinkElement).href = getChromeURL(icon48);
|
||||
}
|
||||
|
||||
let alliframes = document.getElementsByTagName('iframe');
|
||||
|
||||
for (let i = 0; i < alliframes.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user