Skip to content

Rename publicSuffix option encoding = unicode#1013

Open
mckenfra wants to merge 1 commit into
w3c:mainfrom
mckenfra:publicsuffix-encoding
Open

Rename publicSuffix option encoding = unicode#1013
mckenfra wants to merge 1 commit into
w3c:mainfrom
mckenfra:publicsuffix-encoding

Conversation

@mckenfra
Copy link
Copy Markdown
Contributor

@mckenfra mckenfra commented May 27, 2026

This is an update to the publicSuffix proposal to:

  • Rename getDomain() option { encoding: "unicode" } to { encoding: "display" }.
  • Note that unicode-encoded domains may be suspectible to Unicode Confusables risk.
  • Clarify that conversion to unicode should be done only if safe to do so for a given domain.

See #231 (comment) and PR #1012

@mckenfra mckenfra force-pushed the publicsuffix-encoding branch from f832be2 to 82b9dca Compare May 27, 2026 14:48
@kzar
Copy link
Copy Markdown

kzar commented May 27, 2026

FWIW I think this is a big improvement, and I'm not against going this way necessarily. I also think having a way to safely display a Unicode domain to the user is definitely a useful thing for the APIs to provide.

That said, I still wonder if it makes sense to include the display encoding option as a part of the publicSuffix API. To me, it would make more sense to split it out into its own API. I figure that displaying a domain to the user is quite a different thing to looking up a domain in the PSL. I figure that splitting that out would make the PSL API simpler, and it would make it easier for extensions to display domains in cases where a PSL lookup wasn't required.

In any case, it's not a hill I want to die on or anything like that, and I'm not too keen to slow things down if combining the display encoding option in the publicSuffix API works for everyone.

@Rob--W
Copy link
Copy Markdown
Member

Rob--W commented May 28, 2026

That said, I still wonder if it makes sense to include the display encoding option as a part of the publicSuffix API. To me, it would make more sense to split it out into its own API.

The use case of "get the public suffix, for display purposes" sounds well within the scope of the publicSuffix API to me. I can imagine use cases (some of which are already listed in the publicSuffix proposal, and @mckenfra also mentioned one at #1012 (comment)).

On the question of whether it should be a separate API - "Decode punycode except when there are confusables" sounds very niche, and I'm not sure if it's worth having a separate dedicated API for that specific use case.

Copy link
Copy Markdown
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for putting this fix up. This matches with what I was thinking of in #231 (comment)

I wonder whether we should try to emphasize more that the returned domain is intended to match what the browser displays in the URL bar. But even without that, the updated text looks good.

I have added @oliverdunk as a reviewer to this proposal update, to make sure that we have sufficient cross-browser coverage (and from more PSL maintainers; I already checked in with @simon-friedberger on Mozilla's side, but the more, the merrier!).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants