I usually use chrome to test my development and went to use the theme manager component and it wasn’t working. I figured I was using it correctly since it’s not a very complex component so I tried the page in Safari and the theme manager worked as expected.
I also noticed that none of my custom javascript functions that I use runJS for were working so I wrote a simple function to show an alert when changing a select input to test. It doesn’t work in Chrome, but works in Safari.
Chrome you can see the theme stays light even though I have the theme manager component set to Dark. You can see the errors in the console when I change the select input. The alert doesn’t popup.
chrome
Everything works as expected in Safari. (the errors you see in safari are just map files)
safari
My chrome is the latest version 120.0.6099.234 (Official Build) (arm64) and Safari Version 17.2.1 (18617.1.17.11.12, 18617)
In my experience, when I have troubles with Chrome not displaying correctly it is a browser caching problem and clearing the browser cache generally fixes it. Maybe that could be the problem for you as well if you haven’t done that yet.
Yes, that is how I discovered runJS wasn’t working in chrome. When the theme manager component didn’t work, I was going to write custom js function to set the data-bs-theme attribute to dark or light. Both runJS and Theme manager component work as expected in Safari. I’m storing the color mode as a user preference stored in the mysql users table, not in local storage.