From 1767a611a6cb456cb504c97a3e1be04c710bc844 Mon Sep 17 00:00:00 2001 From: Dan Jenkins Date: Wed, 6 May 2020 16:23:06 +0100 Subject: [PATCH] set the meta tag for theme-color to the same theme css background --- src/theme.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/theme.js b/src/theme.js index ab5974f207..2ccce81a8d 100644 --- a/src/theme.js +++ b/src/theme.js @@ -242,6 +242,10 @@ export async function setTheme(theme) { if (a == styleElements[stylesheetName]) return; a.disabled = true; }); + const bodyStyles = global.getComputedStyle(document.getElementsByTagName("body")[0]); + if (bodyStyles.backgroundColor) { + document.querySelector('meta[name="theme-color"]').content = bodyStyles.backgroundColor; + } Tinter.setTheme(theme); resolve(); };