Skip to content
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

client: add native sharer #1035

Merged
merged 5 commits into from
Oct 16, 2019
Merged

client: add native sharer #1035

merged 5 commits into from
Oct 16, 2019

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Apr 23, 2018

Using Web Share API for browsers that support it

Closes: #719

@jtojnar jtojnar force-pushed the share-fun branch 2 times, most recently from 4dfdd9c to 2ca1e6e Compare April 23, 2018 17:38
@jtojnar
Copy link
Member Author

jtojnar commented Apr 23, 2018

It is not supported outside of Chrome, and even there it is behind a flag. It probably should not be merged yet.

@jtojnar jtojnar closed this Apr 23, 2018
@jtojnar jtojnar deleted the share-fun branch April 23, 2018 17:38
@jtojnar jtojnar restored the share-fun branch October 15, 2019 15:10
@jtojnar jtojnar reopened this Oct 15, 2019
@jtojnar
Copy link
Member Author

jtojnar commented Oct 15, 2019

This is supported by Safari in addition to Chrome on Android so it is time to add this.

@jtojnar jtojnar added this to the 2.19 milestone Oct 15, 2019
@jtojnar
Copy link
Member Author

jtojnar commented Oct 16, 2019

I successfully shared a link on Chrome for Android. Though, currently, the sharers have a bug, where they will include some accessibility markup.

Also on desktop Chromium, the button is shown, even when there are no targets, resulting in DomException. Looking at the spec, it does not appear to be possible to distinguish the case when there are no sharers (6.1) from one where user cancels the sharing (6.3)

@jtojnar
Copy link
Member Author

jtojnar commented Oct 16, 2019

Also this feature is secure-context only (HTTPS).

using Web Share API for browsers that support it

https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share

Note that this is still experimental and it will also only work in secure contexts (HTTPS).

Closes: #719
Use ES6 syntax

selfoss.shares.register now has the following signature:

    (name: String
    , id: String
    , fontawesomeIconClass: String
    , ({url: String, title: String} -> Void
    ) -> bool
During the accessibility improvements we changed the structure of entry title but forgot to update the sharers to reflect the changes.
Instead of just “facebook” or “pocket”, use “Share on Facebook” and “Save to Pocket” as the labels and tooltips of the sharing buttons. This will make it slightly clearer.

This again changes the signature of selfoss.shares.register:

    (name: String
    , id: String
    , label: String
    , fontawesomeIconClass: String
    , ({url: String, title: String} -> Void
    ) -> bool
so that users can register their own with emoji icons.

Also update NEWS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat. req.: Share with anything on Android
1 participant