hugo-sid/hugo-blog-awesome

Dark theme doesn't work when using Mullvad browser (based on tor browser) with security slider at anything other than "standard"

AmyMoriyama opened this issue · 6 comments

Describe the bug
A clear and concise description of what the bug is.
When using the Mullvad browser (basically tor browser without the tor stuff, so this probably applies to tor browser too), the default theme is always light even when set to dark if the security slider is set to anything other than "standard".

Steps to reproduce
Steps to reproduce the behavior:

  1. Get Mullvad browser: https://mullvad.net/en/download/browser/linux
  2. Extract, execute
  3. Set security slider to anything other than standard
  4. MY EYES o_o

Expected behavior
I would think the security slider would have no effect on whether a site theme is dark or light.

Screenshots
If applicable, add screenshots to help explain your problem.
n/a

Device information (please complete the following information):
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Mullvad browser: 12.0.6 (based on Mozilla Firefox 102.11.0esr) (64-bit)

Additional context
Add any other context about the problem here.
Trying to get a simple and fast website that is dark and doesn't need javascript. Which reminds me, seems javascript still is included in the public website even when configured not to be used. Of course, I am new to this whole hugo thing so could be user error.

Thanks for reporting this bug @AmyMoriyama.

I guess when the security slider is set to anything other than "standard", scripts are blocked. Can you confirm this?

Trying to get a simple and fast website that is dark and doesn't need JavaScript. Which reminds me, seems JavaScript still is included in the public website even when configured not to be used.

This theme uses JavaScript to implement several features.

As far as I know privacy oriented browsers (brave, mullvad etc.) prevent detecting system-level dark mode. And in case JS is disabled in your browser you will not be able to switch theme manually. Probably there is ability to enable dark-mode detection on browser flags page (not settings) chrome://flags for chrome based or about:config for firefox based. Or you can set dark mode by default in theme configuration for your website.

As an option we can add configuration param to hide theme switching button. So you can configure your website to hide theme switcher and use theme in dark only mode.

Or you can set dark mode by default in theme configuration for your website.

I tried that. Either I changed the wrong thing or it still defaults to light theme even when set to dark. And yes, the website is meant to be loaded without javascript needed.

This issue has been marked stale due to inactivity. It will auto-close in 7 days without an update.

This issue was auto-closed due to inactivity.

Or you can set dark mode by default in theme configuration for your website.

@AmyMoriyama
I'm sorry for long response time. This wasn't working correctly. Even when you set default color to dark, it's still using theme detection in no-script browsers. I've made a PR to fix this. #85