Skip to content

Make Navigator.canShare and Navigator.share methods optional #1748

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

Closed
wants to merge 1 commit into from

Conversation

rjimenezda
Copy link

Hi!

I've recently worked with navigator.share and navigator.canShare and have noticed that the types report them as non-optional.

I saw #837 where it's stated that the w3c says they are non-optional, but the truth is that most desktop browsers do not implement them and are only supported on secure contexts, so they can be undefined in certain cases.

I'm not sure if there's something else that should be changed, let me know.

Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

@chemitaxis
Copy link

Good job @rjimenezda LGTM!

Copy link
Contributor

Sorry @chemitaxis, you don't have access to these files:

@rjimenezda
Copy link
Author

@microsoft-github-policy-service agree company="Genially"

@saschanaz
Copy link
Contributor

As stated in #1486 I'd rather not do this only for this specific API. We could make any not-supported-everywhere things as optional but such breaking change needs agreement from TS team. Discussion can go on in #1486.

@rjimenezda
Copy link
Author

Fair enough, I'll close it then.

@rjimenezda rjimenezda closed this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants