Skip to content

Commit 3cb3dca

Browse files
authored
Refactor: simplify compilation constants (darkreader#11148)
- remove unused isThunderbird constant - reorder conditions to compile out isSafari constant
1 parent a9f1f47 commit 3cb3dca

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/inject/dynamic-theme/style-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ export function manageStyle(element: StyleElement, {update, loadingStart, loadin
230230
}
231231

232232
if (
233-
(!cssRules && !accessError && !isSafari) ||
234233
(isSafari && !element.sheet) ||
234+
(!isSafari && !cssRules && !accessError) ||
235235
isStillLoadingError(accessError!)
236236
) {
237237
try {

src/utils/platform.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const platform = isNavigatorDefined ? (navigator.userAgentData && typeof navigat
3030

3131
// Note: if you are using these constants in tests, make sure they are not compiled out by adding __TEST__ to them
3232
export const isChromium = __CHROMIUM_MV2__ || __CHROMIUM_MV3__ || (!__FIREFOX__ && !__THUNDERBIRD__ && (userAgent.includes('chrome') || userAgent.includes('chromium')));
33-
export const isThunderbird = __THUNDERBIRD__ || (!__CHROMIUM_MV2__ && !__CHROMIUM_MV3__ && userAgent.includes('thunderbird'));
3433
export const isFirefox = __FIREFOX__ || __THUNDERBIRD__ || ((__TEST__ || (!__CHROMIUM_MV2__ && !__CHROMIUM_MV3__)) && (userAgent.includes('firefox') || userAgent.includes('thunderbird') || userAgent.includes('librewolf')));
3534
export const isVivaldi = (__CHROMIUM_MV2__ || __CHROMIUM_MV3__) && (!__FIREFOX__ && !__THUNDERBIRD__ && userAgent.includes('vivaldi'));
3635
export const isYaBrowser = (__CHROMIUM_MV2__ || __CHROMIUM_MV3__) && (!__FIREFOX__ && !__THUNDERBIRD__ && userAgent.includes('yabrowser'));

0 commit comments

Comments
 (0)