Details
Description
Chromium has a function called net::registry_controlled_domains::GetDomainAndRegistry() that allows to retrieve the domain from an URL.
In this context domain means the highest domain that is not an effective top-level domain (eTLD).
host | domain |
---|---|
www.google.com | google.com |
www.google.co.uk | google.co.uk |
Having access to this function can be useful for integrating features based on the domain.
An example is integrating 'adblock-rust' which recommend to use the same logic than the one used by the browser itself (see https://github.com/brave/adblock-rust#external-domain-resolution).