Skip to content

Check if navigator.sendBeacon is defined before calling it #56

Description

@PascalKoe

When browsing the DaisyUI Website that uses minimal-analytics, the navigation to links does not work. In the console of the browser an error is displayed linking to code of minimal-analytics: Uncaught (in promise) TypeError: navigator.sendBeacon is not a function. Source Location.
I guess my company modified the default Firefox installation to disable sending beacons using this API.

Is it possible to check if the API is available before calling it, so in case of corporate browsers like mine we do not run into exception but degrade gracefully?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions