refac: improve multi browser support

This commit is contained in:
sethburkart123
2024-08-29 16:28:56 +10:00
parent f996e4bf19
commit 125ebfbaea
26 changed files with 519 additions and 133 deletions
+1 -1
View File
@@ -8,6 +8,6 @@ export async function appendBackgroundToUI() {
background.id = 'background';
background.classList.add('imageBackground');
background.setAttribute('excludeDarkCheck', 'true');
background.src = browser.runtime.getURL('src/seqta/ui/background/background.html');
background.src = browser.runtime.getURL('seqta/ui/background/background.html');
parent!.appendChild(background);
}
+1 -1
View File
@@ -11,7 +11,7 @@ export function OpenThemeCreator( themeID: string = '' ) {
const width = '310px';
const themeCreatorIframe: HTMLIFrameElement = document.createElement('iframe');
themeCreatorIframe.src = `${browser.runtime.getURL('src/interface/index.html')}${ themeID != '' ? `?themeID=${themeID}` : '' }#themeCreator`;
themeCreatorIframe.src = `${browser.runtime.getURL('interface/index.html')}${ themeID != '' ? `?themeID=${themeID}` : '' }#themeCreator`;
themeCreatorIframe.id = 'themeCreatorIframe';
themeCreatorIframe.setAttribute('allowTransparency', 'true');
themeCreatorIframe.setAttribute('excludeDarkCheck', 'true');
+1 -1
View File
@@ -93,7 +93,7 @@ class StorageManager {
/**
* Register a listener for a setting.
* @param prop The setting to listen to.
* @param listener The listener to call when the setting changes.
* @param listener The listener to call when the setting changes -> takes two arguments, (newValue, oldValue)
*/
public register(prop: keyof SettingsState, listener: ChangeListener): void {
if (!this.listeners[prop]) {
+2 -1
View File
@@ -36,7 +36,8 @@ export class StorageChangeHandler {
updateAllColors();
}
private handleOnOffChange() {
private handleOnOffChange(newValue: boolean) {
if (newValue) return;
browser.runtime.sendMessage({ type: 'reloadTabs' });
}