Skip to content

Conditionally exposing share() is not great #59

@marcoscaceres

Description

@marcoscaceres

Spec says:

User agents that do not support sharing SHOULD NOT expose share on the Navigator interface.

This doesn't seem great. A share target can be removed/added, etc. making this super weird if the API vanishes from one page load to the next.

What we should have a is static method a on Navigator, or just normal method even, as navigator is just a singleton:

if(await navigator.canShare()){
   await navigator.share(stuff);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions