Skip to content

api.Navigator.setAppBadge - Safari does not fully support spec as documented by MDN #19300

Description

@rejhgadellaa

What type of issue is this?

Browser bug (a bug with a feature that may impact site compatibility)

What information was incorrect, unhelpful, or incomplete?

According to the setAppBadge page, Safari offers full support. However, it incorrectly handles no or 0 as an argument.

A number which will be used as the value of the badge. If contents is 0 then a badge not containing a count will be displayed.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/setAppBadge#parameters

Instead, Safari does not show a badge or removes it (if it was set with a number before).

What browsers does this problem apply to, if applicable?

Safari 16.4

What did you expect to see?

Calling setAppBadge() and setAppBadge(0) should show a badge without a number.

Did you test this? If so, how?

Run navigator.setAppBadge() and navigator.setAppBadge(0) via dev tools for any installed web app.

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

Intended behavior:

A number which will be used as the value of the badge. If contents is 0 then a badge not containing a count will be displayed.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/setAppBadge#parameters

WebKit bug:
https://bugs.webkit.org/show_bug.cgi?id=254884

Do you have anything more you want to share?

No response

MDN URL

No response

MDN metadata

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    data:apiCompat data for Web APIs. https://developer.mozilla.org/docs/Web/API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions