darkreader / darkreader

Dark Reader Chrome and Firefox extension
https://darkreader.org/
MIT License
19.08k stars 2.33k forks source link

[Bug] Inconsistent behavior in Site List entries #12699

Open AliRezayiNejad opened 1 month ago

AliRezayiNejad commented 1 month ago

Prerequisites

Bug Description

(At least in "Invert listed only" mode,) Using .example.com will affect www.example.com and any subdomains like sub1.example.com. However, If a website omits the www. part from it's URL (like archlinux.org), then the .example.com format does not affect the site, a separate entry of example.com must be created for that. This behavior is consistent on Firefox on multiple platform.

Website Address

archlinux.org vs aur.archlinux.org or any other websites like it

Steps To Reproduce

  1. Switch to Invert listed only mode.
  2. Add a URL like .archlinux.org and another website that does not omit "www." like .darebee.com to the site list.
  3. Visit archlinux.org and darebee.com.

Expected Behavior

Either the main domain of both websites has to be affected by Dark Reader, or neither. I personally prefer both.

Actual Behavior

archlinux.org is not affected by Dark Reader, while darebee.com is. This behavior is consistent for all similar websites, based on how they handle the "www." in their URL.

Screenshots

No response

Operating System

Windows 10, Arch Linux, Android

Web Browser name and version

Firefox 125.0.3

Dark Reader version

4.9.84

Additional Context

No response

oberrich commented 1 month ago

I have investigated this issue and unless I am misunderstanding, this is intended and semantically correct. In order to match both www.example.tld as well as example.tld you can simply use example.tld and it will handle both domains correctly.

ahai64 commented 1 month ago

Yes, now my list is full of duplicate urls like example.com and *.example.com. The way it used to work was more reasonable. Because example.com, foo.example.com and bar.example.com generally use the same style. If not, in rare cases, just add this special case to another list.