Closed Bug 2077408 Opened 1 month ago Closed 8 days ago

browser.publicSuffix.getDomain API does not handle some allowPlainSuffix+allowUnknownSuffix edge cases correctly

Categories

(WebExtensions :: General, defect, P2)

defect

Tracking

(firefox162 fixed)

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: kzar, Assigned: kzar)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 external file)

While working on the Web Platform Tests (WPT) for the browser.publicSuffix WebExtensions APIs, I noticed a couple of edge-cases with browser.publicSuffix.getDomain that aren't being handled correctly.

According to the API proposal:

  • allowPlainSuffix targets a hostname that "is itself a known eTLD".
  • allowUnknownSuffix targets a hostname that "lacks a known eTLD".
  • allowUnknownSuffix returns "last 2 labels, or input hostname if single label".

So for example, we should take care to handle some edge-cases as follows:

browser.publicSuffix.getDomain("unknown", {
  allowUnknownSuffix: false,
  allowPlainSuffix: true
}); // => null

browser.publicSuffix.getDomain("unknown", {
  allowUnknownSuffix: true,
  allowPlainSuffix: false
}); // => "unknown"

The "allowPlainSuffix" option should only apply to known eTLDs, so if an unknown
eTLD is passed to getDomain, the "allowUnknownSuffix" option should determine
what is returned.

Severity: -- → S4
Priority: -- → P2
Status: NEW → RESOLVED
Closed: 8 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: