-
Notifications
You must be signed in to change notification settings - Fork 12
BREAKING CHANGE: remove permissions check #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request clarifies how the Badging API interacts with permissions and system-level controls by removing the requirement for explicit permission checks before setting badges. The key change is that applications can always set badges successfully if the API is supported, but actual badge visibility depends on operating system settings and potentially notification permissions on some platforms.
- Updates API behavior to allow badge setting without permission requirements
- Clarifies that operating systems control badge visibility, not the web platform
- Removes normative permission checking requirements from the specification
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
index.html | Updates specification language, example code, and explanatory text to remove permission requirements and clarify OS-controlled badge visibility |
explainer.md | Clarifies that no permission is needed to use the badging API, though OS controls actual display |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
button.addEventListener("click", async () => { | ||
await Notification.requestPermission(); | ||
checkPermission(); | ||
checkNotificationPermissionForBadge(); |
Copilot
AI
Sep 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recursive call to checkNotificationPermissionForBadge()
will set the badge again unnecessarily. Consider extracting the permission checking logic into a separate function to avoid redundant badge setting operations.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this lgtm - I think it makes the API much nicer to use 😄
// Errors are rare and typically indicate API unavailability | ||
// or security restrictions, not permission issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: think its probably worth removing typically here
// Errors are rare and typically indicate API unavailability | |
// or security restrictions, not permission issues. | |
// Errors are rare and indicate API unavailability security restrictions, not permission | |
// issues. |
Closes #110
This pull request clarifies how the Badging API interacts with permissions and system-level controls, both in the documentation (
explainer.md
) and in the example code and explanatory text (index.html
). The main focus is to make it clear that setting a badge does not require explicit permission, but actual badge visibility may depend on notification permissions on some platforms. The changes also update the example code and specification language to reflect this behavior.Clarifications to Badging API Permission Behavior:
explainer.md
to state that applications do not need to request permission to set a badge, but actual display may depend on notification permissions on some platforms.index.html
to clarify that setting a badge always succeeds if the API is supported, but the operating system controls whether the badge is displayed. [1] [2]index.html
to remove the requirement for explicit user permission to set a badge, instead explaining that the operating system determines badge visibility and that the user agent should allow setting badges regardless of permission state. [1] [2]Example Code Improvements:
index.html
to demonstrate that badges can be set regardless of notification permissions, and added an optional check for notification permission to help ensure badge visibility on relevant platforms.This change (choose at least one, delete ones that don't apply):
Implementation commitment (delete if not making normative changes):
Preview | Diff