From 2ecd995e474f99244fc8721836e32b4d6b75d9dc Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Fri, 19 Jul 2024 06:24:17 +0700 Subject: [PATCH] Minor updates --- src/assets/css/global-settings.styl | 4 ++++ src/modules/ui/global-settings.ts | 4 ++-- src/utils/bx-flags.ts | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/assets/css/global-settings.styl b/src/assets/css/global-settings.styl index 28f8d19..6587bf2 100644 --- a/src/assets/css/global-settings.styl +++ b/src/assets/css/global-settings.styl @@ -217,5 +217,9 @@ border: 1px solid #2d2d2d; background: #212121; white-space: break-spaces; + + &:hover { + background: #272727; + } } } diff --git a/src/modules/ui/global-settings.ts b/src/modules/ui/global-settings.ts index 9adde9b..5c7127a 100644 --- a/src/modules/ui/global-settings.ts +++ b/src/modules/ui/global-settings.ts @@ -476,7 +476,7 @@ export function setupSettingsUi() { const $debugInfo = CE('div', {class: 'bx-debug-info'}, createButton({ label: 'Debug info', - style: ButtonStyle.GHOST | ButtonStyle.FULL_WIDTH, + style: ButtonStyle.GHOST | ButtonStyle.FULL_WIDTH | ButtonStyle.FOCUSABLE, onClick: e => { console.log(e); (e.target as HTMLElement).closest('button')?.nextElementSibling?.classList.toggle('bx-gone'); @@ -494,7 +494,7 @@ export function setupSettingsUi() { } }, }, - }, JSON.stringify(debugInfo, null, ' ')), + }, '```\n' + JSON.stringify(debugInfo, null, ' ') + '\n```'), ); $wrapper.appendChild($debugInfo); diff --git a/src/utils/bx-flags.ts b/src/utils/bx-flags.ts index f8bb8c5..a995f7d 100644 --- a/src/utils/bx-flags.ts +++ b/src/utils/bx-flags.ts @@ -14,7 +14,7 @@ type BxFlags = Partial<{ DeviceInfo: Partial<{ deviceType: 'android' | 'android-tv' | 'webos' | 'unknown', - userAgent: string, + userAgent?: string, }>, }> @@ -33,7 +33,6 @@ const DEFAULT_FLAGS: BxFlags = { DeviceInfo: { deviceType: 'unknown', - userAgent: window.navigator.userAgent, }, } @@ -42,4 +41,8 @@ try { delete window.BX_FLAGS; } catch (e) {} +if (!BX_FLAGS.DeviceInfo!.userAgent) { + BX_FLAGS.DeviceInfo!.userAgent = window.navigator.userAgent; +} + export const NATIVE_FETCH = window.fetch;