Skip to content

Bug 1315558 documentation for the publicSuffix API - #44401

Merged
rebloor merged 8 commits into
mdn:mainfrom
rebloor:Bug-1315558-tld-service-for-webextensions
Jun 11, 2026
Merged

Bug 1315558 documentation for the publicSuffix API#44401
rebloor merged 8 commits into
mdn:mainfrom
rebloor:Bug-1315558-tld-service-for-webextensions

Conversation

@rebloor

@rebloor rebloor commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

Addresses the dev-docs needed requirements of Bug 1315558 "tld service for webextensions", including:

  • publicSuffix API namespace page, describing the API, its permission requirement ("publicSuffix", silently granted), and its availability limited to background scripts.
  • publicSuffix.DomainEncoding type page
  • publicSuffix.isKnownSuffix(), publicSuffix.getKnownSuffix() andpublicSuffix.getDomain() method pages.
  • "publicSuffix" to the API permissions list in permissions and optional_permissions.
  • Firefox 153 release note for the API.

Related issues and pull requests

Related BCD changes in mdn/browser-compat-data#29822

@rebloor
rebloor requested review from Rob--W and bacharakis June 9, 2026 18:08
@rebloor rebloor self-assigned this Jun 9, 2026
@rebloor
rebloor requested review from a team as code owners June 9, 2026 18:08
@rebloor rebloor added the Content:WebExt WebExtensions docs label Jun 9, 2026
@rebloor
rebloor requested review from dipikabh and removed request for a team June 9, 2026 18:08
@github-actions github-actions Bot added Content:Firefox Content in the Mozilla/Firefox subtree size/m [PR only] 51-500 LoC changed labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Preview URLs (8 pages)
External URLs (8)

URL: /en-US/docs/Mozilla/Add-ons/WebExtensions/API/publicSuffix
Title: publicSuffix


URL: /en-US/docs/Mozilla/Add-ons/WebExtensions/API/publicSuffix/DomainEncoding
Title: publicSuffix.DomainEncoding


URL: /en-US/docs/Mozilla/Add-ons/WebExtensions/API/publicSuffix/getKnownSuffix
Title: publicSuffix.getKnownSuffix()


URL: /en-US/docs/Mozilla/Add-ons/WebExtensions/API/publicSuffix/isKnownSuffix
Title: publicSuffix.isKnownSuffix()


URL: /en-US/docs/Mozilla/Firefox/Releases/153
Title: Firefox 153 release notes for developers (Nightly)

(comment last updated: 2026-06-11 16:50:09)

Comment thread files/en-us/mozilla/add-ons/webextensions/api/publicsuffix/getdomain/index.md Outdated

```js
console.log(
browser.publicSuffix.getDomain("192.0.2.1", { allowIPAddress: true }),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Trailing comma in the function parameters are syntactically allowed in JS, but I think that they may cause confusion. Let's drop them from all examples here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I still see trailing commas in the diff.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So you do, but hopefully not now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the local linting is adding the back - trying again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now done!

Comment thread files/en-us/mozilla/add-ons/webextensions/api/publicsuffix/index.md Outdated
Comment thread files/en-us/mozilla/add-ons/webextensions/api/publicsuffix/index.md Outdated
Comment thread files/en-us/mozilla/firefox/releases/153/index.md Outdated
Comment thread files/en-us/mozilla/add-ons/webextensions/api/publicsuffix/getdomain/index.md Outdated
@github-actions github-actions Bot added the merge conflicts 🚧 [PR only] label Jun 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions Bot removed the merge conflicts 🚧 [PR only] label Jun 10, 2026
rebloor and others added 2 commits June 11, 2026 05:06
Co-authored-by: Rob Wu <rob@robwu.nl>
Co-authored-by: rebloor <git@sherpa.co.nz>
Removed explicit mention of error message content
Tidied up glossary references
@rebloor
rebloor requested a review from Rob--W June 10, 2026 17:32
Comment thread files/en-us/mozilla/add-ons/webextensions/api/publicsuffix/index.md Outdated

```js
console.log(
browser.publicSuffix.getDomain("192.0.2.1", { allowIPAddress: true })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
browser.publicSuffix.getDomain("192.0.2.1", { allowIPAddress: true })
browser.publicSuffix.getDomain("192.0.2.1", { allowIPAddress: true }),

browser.publicSuffix.getDomain("192.0.2.1", { allowIPAddress: true })
); // "192.0.2.1"
console.log(
browser.publicSuffix.getDomain("[2001:db8::1]", { allowIPAddress: true })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
browser.publicSuffix.getDomain("[2001:db8::1]", { allowIPAddress: true })
browser.publicSuffix.getDomain("[2001:db8::1]", { allowIPAddress: true }),


```js
console.log(
browser.publicSuffix.getDomain("co.uk", { allowPlainSuffix: true })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
browser.publicSuffix.getDomain("co.uk", { allowPlainSuffix: true })
browser.publicSuffix.getDomain("co.uk", { allowPlainSuffix: true }),

Comment on lines +86 to +87
allowUnknownSuffix: true
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
allowUnknownSuffix: true
})
allowUnknownSuffix: true,
}),

})
); // "mydevice.local"
console.log(
browser.publicSuffix.getDomain("host.intranet", { allowUnknownSuffix: true })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
browser.publicSuffix.getDomain("host.intranet", { allowUnknownSuffix: true })
browser.publicSuffix.getDomain("host.intranet", { allowUnknownSuffix: true }),

Comment on lines +100 to +101
encoding: "display"
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
encoding: "display"
})
encoding: "display",
}),

Comment on lines +108 to +109
encoding: "display"
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
encoding: "display"
})
encoding: "display",
}),

@rebloor
rebloor requested a review from Rob--W June 11, 2026 00:13

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we somehow suppress the linter, so that autofix will not reapply the commas?

@github-actions github-actions Bot added the merge conflicts 🚧 [PR only] label Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions Bot removed the merge conflicts 🚧 [PR only] label Jun 11, 2026
@rebloor
rebloor merged commit 5054fb7 into mdn:main Jun 11, 2026
8 of 9 checks passed
@rebloor
rebloor deleted the Bug-1315558-tld-service-for-webextensions branch June 11, 2026 16:55
@rebloor

rebloor commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Could we somehow suppress the linter, so that autofix will not reapply the commas?

@Rob--W A failing linter doesn't block merging, so this is merged without the commas.

@Rob--W

Rob--W commented Jun 11, 2026

Copy link
Copy Markdown
Member

Could we somehow suppress the linter, so that autofix will not reapply the commas?

@Rob--W A failing linter doesn't block merging, so this is merged without the commas.

Wouldn't the commas return if someone were to update the article in the future? As you noticed, the linting issue was autofixed. Unless an exception is added somehow, the commas will return eventually.

@Rob--W

Rob--W commented Jun 11, 2026

Copy link
Copy Markdown
Member

FYI to fix it is is probably helpful to know where it is coming from.

mdn/content relies on prettier to format the code, and does not set any rules other than: https://github.com/mdn/content/blob/bfaf90116752cffcff6098be4d40f843b8e9f6ee/.prettierrc.json

Notably, the trailingComma option is not set and uses the default: https://prettier.io/docs/options#trailing-commas

To fix it, you could put <!-- prettier-ignore --> before the code block

or if that does not capture the desired part (I think it should!), <!-- prettier-ignore-start --> and <!-- prettier-ignore-end -->.

These comments are documented at https://prettier.io/docs/ignore/

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

Labels

Content:Firefox Content in the Mozilla/Firefox subtree Content:WebExt WebExtensions docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants