0

Tor browser's default theme uses os's color scheme. Just like firefox. If os is set to dark grey colors lets say, tor uses the same palette. If os is set to shades of black, tor uses the same palette of shades of black. If os white, pale yellow, whatever, tor browser uses the same colors.

So i am asking: Is this something new (like less than a year old) and tor browser used to not do it but now it does and it's fine? or not?(i didn't find anything that answers this question) Can this affect privacy,anonymity etc?

Could a script/program/something in a website see what colors are used and use this information for fingerprinting?

If this is possible without javascript (it is possible with javascript in general (i don't know if the tor browser has any specific configuration that would prevent javascript see that kind of things even if it was enabled)) would it be better to use tor browser's (firefox's) pre-installed dark/light theme (dark theme as more people would have enabled it), or modify some setting in the tor browser or the os (i don't think i would be better, just asking)?

I mean, a script/program/something in a website can possibly see dark theme/light theme is enabled (like check the values default/dark/light) and therefore use this information for fingerprinting. That's why it is advised to not enable themes other than the default. But if in the default theme the tor browser is using the os's color scheme could a script/program/something in the website see some kind of information and use this for fingerprinting? (and I acknowledge that possibly a lot of things can be done, just, what are your thoughts on this?)

1

No, even if the user is using dark mode, light mode, or some other theme (system theme or app theme), this cannot be used to fingerprint the user if they are using the Tor browser. Detecting dark mode or light mode does not even work with the Tor browser. This does not affect the user's anonymity, privacy, or security in any way.


Normally you can use CSS, JavaScript, or HTML to detect if the user has a light theme or dark theme. I didn't fiind any code on how to detect a custom theme if that is even possible. This is the CSS that can be used:

@media (prefers-color-scheme: light) {
  // light mode
}
@media (prefers-color-scheme: dark) {
  // dark mode
}

or this is the JavaScript that can be used (I've found different code online, but they all rely on window.matchMedia):

if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
    // dark mode
}

else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
    // light mode
}

or this is the HTML that can be used (buttons and other HTML content will be what the color scheme is):

<meta name="color-scheme" content="dark light">

I created a JsFiddle to demo this (https://jsfiddle.net/pky84faj/4/). It correctly detects the user's theme on conventional browsers (Google Chrome, Firefox, etc.). However, with the Tor browser, it always returns "light mode" even if I have dark mode enabled. You can test it out yourself with the JsFiddle (if you get different results, tell me).

Also, your statement here:

I mean, a script/program/something in a website can possibly see dark theme/light theme is enabled (like check the values default/dark/light) and therefore use this information for fingerprinting. That's why it is advised to not enable themes other than the default.

won't hold true for the Tor browser because as you can see, you can't detect the user's theme if they use the Tor browser.

You can see that in the Tor browser design and inmplementation, this fingrprinting method has been blocked:

Click to view the image

Also, the Tor browser protects CSS prefers-color-scheme through privacy.resistFingerprinting so that it always returns that the user is using light theme.

Resources:

4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.