Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub domain control #147

Closed
sxp opened this issue Dec 13, 2017 · 14 comments
Closed

Sub domain control #147

sxp opened this issue Dec 13, 2017 · 14 comments

Comments

@sxp
Copy link

sxp commented Dec 13, 2017

If I use to invert the only mode, I add xxx.com to the site list, then I visit sub.xxx.com, I don't want to invert this domain. I can't exclude it. When I use the shortcut key to toggle the domain, extension just adds or remove the sub.xxx.com from site list, but the page has no effect.

I suggest a feature:
If current need add domain is a subdomain of a domain that already exists in the list. Then we do the opposite of the parent domain(add the subdomain to a exclude list?), or we remove the parent domain from the list(When user go back to the parent domain, he can re-add it to the list).

If current need add domain is a parent domain of a exists domain. Then we add it to the list, and don't change the exists domain. (When the parent remove from list, the old subdomain will be saved in the list, so the function of the subdomain has no effect)

In general, I want to add some features to avoid frequent visits to a website, toggle dark reader, but no effect problem.
(Sorry for my poor English)

@RalphLesch
Copy link

RalphLesch commented Jan 6, 2018

If I understand you correctly, you want to include a domain, but exclude a subdomain or vise versa.
This is already possible, in both "Invert listed only" (include) and "Not invert listed" (exclude) mode:

ModeIncludeExcludeList entry
includexxx.comsub.xxx.com`^xxx.com`
sub.xxx.comxxx.com`^sub.xxx.com`
excludexxx.comsub.xxx.com`^sub.xxx.com`
sub.xxx.comxxx.com`^xxx.com`

Problematic is the case of including/excluding all subdomains except for one or more, like include "*.xxx.com", but exclude "www.xxx.com".
Currently, the only way I can think of, would be to add an invert fix (developer tools) for "*.xxx.com", and exclude "www.xxx.com" (in exclude mode).

For DarkReader, I would suggest to either use both include and exclude lists together or to change to pattern syntax, for e.g. full regex support (see my comment about the syntax).

Related: #147

@alexanderby
Copy link
Member

^ meaning the beginning of the string works. What about both exclude and include lists, I plan to make unlimited count of groups with different settings.

@RalphLesch
Copy link

RalphLesch commented Jan 10, 2018

Sub groups for domains should be enough to solve most URL match problems.
I would suggest an extended hierarchy:

  • common/shared group, with inversion fixes that are always used (unless deactivated by an option in the other rules maybe?).
  • site / domain groups for URL pattern, will be used unless subdomain matches are found.
    • subdomain groups: overwrite (super)domain rules.

Then a layout like this is possible:

{
    "common": { "invert etc (fixes)": "", 
    },
    "sites": {
        "*": {
            "fixes": "",
            "subsites": {
                "domain1-pattern": {
                    "fixes": "",
                    "subsites": {
                      "subdomain1-pattern": {},
                      "subdomain2-pattern": {}
                    }
                },
                "domain2-pattern": {}
            }
        }
    }
}

You can probably combine "sites" with "*" to save one tree level.

Side note: collapsible sub groups in the editor and/or a complete separation for the sites (show only site config) would help a lot in the new UI.

@alexanderby
Copy link
Member

Here is what I'm going to do with the list, similar to glob file patterns #373

@Gusted
Copy link
Contributor

Gusted commented Apr 19, 2020

As of #2327 you can simply exlude an subdomain by !subdomain.example.com

@aogier
Copy link

aogier commented Dec 14, 2020

Hi, I'm having probably the same problem here: I'd want to exclude github.com (which has his own dark theme now), but include docs.github.com, and this does not seem possible with the button.

@0xallie
Copy link
Contributor

0xallie commented Dec 24, 2020

@aogier The solution was explained a few comments above. You can manually change the exclude list to have ^github.com instead of github.com.

@psarno
Copy link

psarno commented May 19, 2021

I am unable to get this to work.

I have a "Not Invert List" with "twitter.com", because I am using their dark theme.

I want "blogs.twitter.com" to let Dark Reader handle it as their theme doesn't apply there.

I tried entering "^blogs.twitter.com" and "!blogs.twitter.com" in the list and they don't have any effect, it seems the presence of "twitter.com" already in the list prevents Dark Reader from working on the subdomain.

@Gusted
Copy link
Contributor

Gusted commented May 19, 2021

Add ^twitter.com that will disable it just for twitter and not for any subdomains like blogs.twitter.com

@ackvf
Copy link

ackvf commented Jan 5, 2022

@RalphLesch

For DarkReader, I would suggest to either use both include and exclude lists together or to change to pattern syntax, for e.g. full regex support (see my comment about the syntax).

This is the first time I am seeing a mention about using both include and exclude lists together. How can I do that?

@megamorphg
Copy link

As of #2327 you can simply exlude an subdomain by !subdomain.example.com

If we can get "!" to work, this would be a great band-aid for now.
Currently "!" doesn't work to whitelist a subdomain (while the overall domain is blacklisted). Maybe ! URLs needs to be allowed precedence no matter where it is in the list?

@mattwelke
Copy link

mattwelke commented Feb 22, 2022

Was talking in #7503 about my issue with the GCP console.

Here's a detailed explanation of my use case.

For google.com, I don't want to use Dark Reader because they support a proper dark theme. So I disable Dark Reader on google.com by clicking that rectangle button in the top left corner:

image

For cloud.google.com, I also don't want to use Dark Reader because even though their documentation doesn't have a dark theme, that site doesn't yet behave nicely with Dark Reader. I'm okay sticking to the site's default CSS.

So, on cloud.google.com, I could click the top left rectangle button to override how I disabled it for google.com:

image

But instead, I don't. I leave it alone:

image

For console.cloud.google.com, I do want Dark Reader enabled because it doesn't have a dark theme and Dark Reader just a good job creating one for it. I try to override the disable I did for google.com by clicking the top left rectangle button:

dark_reader_gcp_console

When I click the button, nothing happens. I believe that's the issue with subdomains I'm running into here. If I do the override of my settings for google.com at the cloud.google.com level (making it dark), then the console becomes dark and I can do another override at the console.google.com level to make it light. But that's the opposite of what I want. I want cloud.google.com to be light and console.cloud.google.com to be dark:

dark_reader_gcp_console_2

@Revadike
Copy link

same thing for https://console.firebase.google.com

@alexanderby
Copy link
Member

Fixed by 5546bd5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants