From 19b3846a5a75c260e592d41a25a5e6bb93580e1d Mon Sep 17 00:00:00 2001 From: John Livingston Date: Tue, 4 Jan 2022 05:05:32 +0100 Subject: [PATCH] Fix Autocolors on chrome browser. --- CHANGELOG.md | 6 ++++++ client/videowatch/colors.ts | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b258b58..1ad17c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 5.2.4 + +### Fixes + +* Fix Autocolors on chrome browser + ## 5.2.3 ### Fixes diff --git a/client/videowatch/colors.ts b/client/videowatch/colors.ts index dc521c0b..6ac5cefb 100644 --- a/client/videowatch/colors.ts +++ b/client/videowatch/colors.ts @@ -20,18 +20,18 @@ function computeAutoColors (): AutoColors | null { const buttonStyles = window.getComputedStyle(button) const autocolors: AutoColors = { - mainForeground: styles.getPropertyValue('--mainForegroundColor'), - mainBackground: styles.getPropertyValue('--mainBackgroundColor'), - greyForeground: styles.getPropertyValue('--greyForegroundColor'), - greyBackground: styles.getPropertyValue('--greyBackgroundColor'), - menuForeground: styles.getPropertyValue('--menuForegroundColor'), - menuBackground: styles.getPropertyValue('--menuBackgroundColor'), - inputForeground: styles.getPropertyValue('--inputForegroundColor'), - inputBackground: styles.getPropertyValue('--inputBackgroundColor'), - buttonForeground: buttonStyles.color, - buttonBackground: styles.getPropertyValue('--mainColor'), - link: styles.getPropertyValue('--mainForegroundColor'), - linkHover: styles.getPropertyValue('--mainForegroundColor') + mainForeground: styles.getPropertyValue('--mainForegroundColor').trim(), + mainBackground: styles.getPropertyValue('--mainBackgroundColor').trim(), + greyForeground: styles.getPropertyValue('--greyForegroundColor').trim(), + greyBackground: styles.getPropertyValue('--greyBackgroundColor').trim(), + menuForeground: styles.getPropertyValue('--menuForegroundColor').trim(), + menuBackground: styles.getPropertyValue('--menuBackgroundColor').trim(), + inputForeground: styles.getPropertyValue('--inputForegroundColor').trim(), + inputBackground: styles.getPropertyValue('--inputBackgroundColor').trim(), + buttonForeground: buttonStyles.color.trim(), + buttonBackground: styles.getPropertyValue('--mainColor').trim(), + link: styles.getPropertyValue('--mainForegroundColor').trim(), + linkHover: styles.getPropertyValue('--mainForegroundColor').trim() } const autoColorsTest = areAutoColorsValid(autocolors) if (autoColorsTest !== true) {