diff --git a/src/background/extension.ts b/src/background/extension.ts index be29de0..ba6093a 100644 --- a/src/background/extension.ts +++ b/src/background/extension.ts @@ -572,13 +572,13 @@ export default class Extension { this.state.setNativeError(nativeError); if (!this.state.getNativeErrorMuted()) { - await this.nativeErrorPage.open(); + await this.nativeErrorPage.open(); } Messenger.UI.sendDebuggingInfo({ version: this.state.getVersion(), connected: false, - nativeError: nativeError, + nativeError, }); } diff --git a/src/background/state.ts b/src/background/state.ts index bf76294..59874a6 100644 --- a/src/background/state.ts +++ b/src/background/state.ts @@ -403,8 +403,8 @@ export default class State { } public async load(themeRefreshCallback: () => void) { - let shouldRefresh = false - const browserInfo = await browser.runtime.getBrowserInfo() + let shouldRefresh = false; + const browserInfo = await browser.runtime.getBrowserInfo(); this.currentState = await browser.storage.local.get(this.initialState); // Temporary state migration until a real migration system is implemented @@ -415,24 +415,24 @@ export default class State { // Fix for v89 tab border if (browserInfo?.version && browserInfo.version.split('.')[0] === '89') { - const { dark, light } = this.currentState.theme.templates + const { dark, light } = this.currentState.theme.templates; // We make sure to only change this property if it has not been modified by the user if (dark.browser.tab_line === PaletteColors.AccentPrimary) { - this.currentState.theme.templates.dark.browser.tab_line = PaletteColors.BackgroundLight - shouldRefresh = true + this.currentState.theme.templates.dark.browser.tab_line = PaletteColors.BackgroundLight; + shouldRefresh = true; } if (light.browser.tab_line === PaletteColors.AccentPrimary) { - this.currentState.theme.templates.light.browser.tab_line = PaletteColors.BackgroundLight - shouldRefresh = true + this.currentState.theme.templates.light.browser.tab_line = PaletteColors.BackgroundLight; + shouldRefresh = true; } } await browser.storage.local.set(this.currentState); if (shouldRefresh) { - themeRefreshCallback() + themeRefreshCallback(); } } diff --git a/src/communication/native-messenger.ts b/src/communication/native-messenger.ts index 01af19b..2af64f0 100644 --- a/src/communication/native-messenger.ts +++ b/src/communication/native-messenger.ts @@ -183,12 +183,15 @@ export default class NativeApp { switch (error.message) { case 'Error: No such native application pywalfox': nativeError.type = NativeAppErrors.ManifestNotInstalled; - case "Error: An unexpected error occurred": + break; + case 'Error: An unexpected error occurred': // BUG: For some reason, the "File at path does not exist, or is not executable" // error does not get set, so we will just assume that is the cause for this for now. nativeError.type = NativeAppErrors.UnexpectedError; + break; default: nativeError.type = NativeAppErrors.Unknown; + break; } nativeError.message = error.message; diff --git a/src/ui/native-error.ts b/src/ui/native-error.ts index 40f043b..6f11f51 100644 --- a/src/ui/native-error.ts +++ b/src/ui/native-error.ts @@ -1,7 +1,7 @@ import { NativeAppErrors, IExtensionMessage, - IDebuggingInfoData + IDebuggingInfoData, } from '@definitions'; import { @@ -9,8 +9,8 @@ import { requestNativeErrorPageMute, } from '@communication/content-scripts/ui'; +import initializeExtensionPage from '@ui/page'; import { EXTENSION_MESSAGES } from '@config/general'; -import { initializeExtensionPage } from '@ui/page'; const retryButton = document.getElementById('retry-button'); const disableButton = document.getElementById('disable-button'); diff --git a/src/ui/page.ts b/src/ui/page.ts index 0e1d84f..258ca47 100644 --- a/src/ui/page.ts +++ b/src/ui/page.ts @@ -34,9 +34,9 @@ function setThemeMode(mode: ThemeModes) { currentThemeMode = mode; } -export function initializeExtensionPage( +export default function initializeExtensionPage( versionLabel: HTMLElement, - callback: IExtensionMessageCallback + callback: IExtensionMessageCallback, ) { if (callback) { messageCallback = callback; diff --git a/src/ui/update.ts b/src/ui/update.ts index afdaf03..b54e75a 100644 --- a/src/ui/update.ts +++ b/src/ui/update.ts @@ -1,4 +1,4 @@ -import { initializeExtensionPage } from '@ui/page'; +import initializeExtensionPage from '@ui/page'; import { requestUpdatePageMute } from '@communication/content-scripts/ui'; const disableButton = document.getElementById('disable-button'); @@ -7,5 +7,5 @@ disableButton.addEventListener('click', requestUpdatePageMute); initializeExtensionPage( document.getElementById('version'), - null + null, );