publicSuffix
Use the publicSuffix API to work with domain names and public suffixes (effective top-level domains, or eTLDs) from the Public Suffix List. Because the browser's built-in Public Suffix List is always up to date, extensions don't need to bundle a copy.
Use the publicSuffix API to work with domain names and public suffixes (effective top-level domains, or eTLDs) from the Public Suffix List. Because the browser's built-in Public Suffix List is always up to date, extensions don't need to bundle a copy.
Common use cases include:
- Identifying the registrable domain (eTLD+1) of a hostname to group related domains or detect third-party requests.
- Checking whether a hostname is itself a public suffix.
- Extracting the public suffix portion of a hostname.
To use this API, you must have the "publicSuffix" permission.
Types
- publicSuffix.DomainEncoding
- : Specifies the encoding format for domain names returned by publicSuffix.getDomain().
Functions
- publicSuffix.isKnownSuffix()
- : Returns
trueif the hostname is a known public suffix. - publicSuffix.getKnownSuffix()
- : Returns the known public suffix of a hostname, or
nullif none exists. - publicSuffix.getDomain()
- : Returns the registrable domain (eTLD+1) of a hostname.
h2