What about using rel="share-url" to expose sharing intents?

(shkspr.mobi)

66 points | by edent 8 hours ago ago

28 comments

  • chrismorgan 7 hours ago ago

    There’s already a better spec from 2016, which has even been shipping in the Chromium family since 2019 (Android) or 2021 (desktop):

    https://w3c.github.io/web-share-target/

    https://developer.mozilla.org/en-US/docs/Web/Progressive_web...

    Use that, and the browser/native platform integration is already there, and ShareOpenly becomes more of stopgap measure.

    The only real problem is that you can’t feature-detect share_target support—so you can’t detect if the user is able to add a web app to the user agent’s share targets.

    As for ShareOpenly using these things, see https://shareopenly.org/share/?url=https://example.com, and it requires the user to paste a value in once, and then by the looks of it it will remember that site via a cookie. Not great, but I guess it works. But I’m sceptical anyone will really use it.

    • bryanrasmussen 3 hours ago ago

      OK well I think there's one superior aspect to the main post which is that it is short and not difficult to understand all of what will happen. This web-share-target requires more thinking about.

      Also some stuff I dislike:

      >The user agent MAY automatically register all web share targets as the user visits the site, but it is RECOMMENDED that more discretion is applied, to avoid overwhelming the user with the choice of a large number of targets.

      Yeah, specs that leave it open to site discretion whether or not to be abusive have a great deal of success.

      >This specification has no known accessibility considerations.

      No really!?

      Yeah a screenreader functions as a sequential medium, so what happens with registry of all share targets with screenreader, in fact what happens when screenreader comes to site, screenreader now will tell you that you have shares first? This is up to the browser how they tell the user that there are shares and ask for their input? So it will work differently between browsers?

      I have found some bugs before in Google provided specs that were somewhat annoying for screenreader usage, and evidently the reasoning they must have had was that there were no known accessibility considerations because they sure didn't specify any.

    • quectophoton 7 hours ago ago

      > The only real problem is that you can’t feature-detect share_target support

      I didn't know this existed, so the first thing I did is check the caniuse website, and yeah not even they have info about the Web Share Target API[1][2]. As of writing this comment, they only have info about the Web Share API[3].

      [1]: https://github.com/Fyrd/caniuse/issues/4670

      [2]: https://github.com/Fyrd/caniuse/issues/4906

      [3]: https://caniuse.com/web-share

    • troupo 5 hours ago ago

      > There’s already a better spec from 2016

      aka

      This document is a draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organization.

      • chrismorgan 5 hours ago ago

        It’s been implemented in Chromium for 4–6 years, Firefox’s position is positive (admittedly that was 2019), WebKit’s is neutral, and there are bugs open in both Firefox and WebKit.

        I regularly criticise Google-only specs and point out how they’re not standards in any way, but this one is not really like that—it’s just that the other two platforms are missing a couple of other pieces that are better to get in place first, and it’s not a high priority for them.

        And certainly in the context of this rel="share-url" outsider proposal, nah, the share_target manifest reference is still way more “official” than that.

  • procaryote 4 hours ago ago

    Exposing the sharing intent is a problem, not a goal.

    Sharing a link is easy. That's why URLs were invented. Exposing the sharing intent is only beneficial to companies that want to track you.

    Sure, pressing "share on facebook" might be slightly lower friction than copy-pasting the link, but if the sharing isn't worth that friction, perhaps don't?

  • biggestfan 6 hours ago ago

    Does anyone even use share buttons? I always just copy the link, and it seems that anyone I see sharing things does the same. It feels more like a way for the social media companies to advertise/track, and those sites have been sending less and less traffic for years, so I wonder why every site still has them.

    • afavour 3 hours ago ago

      Yeah, they do. We’ve hooked up analytics to test it in the past and the average user absolutely uses them.

    • 0x00000000 4 hours ago ago

      tiktok share links also dox you. they have a banner with the name and profile picture of the person that shared it

    • hahn-kev 4 hours ago ago

      Yeah I don't know if I've ever used them. Maybe once or twice ever. For me the main problem is UX. Sharing from my platform (copy url on computer, share button on android) is always in the same place. But the share button built in is never in the same place across different websites, how could it be?

    • Workaccount2 2 hours ago ago

      People use apps nowadays to do everything, the only way to get links out of apps is share buttons.

    • hombre_fatal 4 hours ago ago

      The TFA is about how to craft a "Share on {ExternalSite}" URL, not a "Share this page" button.

    • efilife 3 hours ago ago

      They do. I built a file sharing page for friends and most were confused how to share me a link to a file. I implemented the copy url button they asked for and no complaints, even though the url is always visible on every browser they use

  • rs186 6 hours ago ago

    The article is proposing a technical solution to a business problem.

    I have no doubt this proposal or any other similar proposal would work well in the 90s or early 2000s. Let's go one step further and let browsers work with all those third party website and figure all the details for sharing, and websites never embed anything.

    But you see, that's not the problem. These share buttons are often trojans on websites. Facebook tracks you via those share buttons even if you have never had a Facebook account. And people come up with various solutions to tackle that -- adblockers just block network traffic, while a small amount of website owners create a separate switch which you can toggle and then share with Facebook. Isn't all of that stupid? I don't see why Facebook, Instagram will be eager to opt in to this solution and make the experience good.

    • johannes1234321 6 hours ago ago

      Yeah, for those branded buttons on websites this isn't an alternative. They want all their JavaScript for collect information on the user, even if they don't press the button.

      I believe this is to play with (mobile) browser's share button, while even there I don't get how this is supposed to work.

      First: How does this figure out where I want to share to? And then: Would it have to load the shared-to page first, parse it to see if there is such a Tag and then interpret it?

      Maybe I am missing something.

    • defraudbah 6 hours ago ago

      exactly my thought, links work fine as they are, my biggest problem with them is 9 times of 10 I don't know where they lead. Fixing one "share" use case isn't solving a misuse

  • cxr 7 hours ago ago

    Only tangentially related to the main subject, but the post ends with:

    > Extensions to the predefined set of link types may be registered on the microformats page for existing rel values.

    Please don't. WHATWG's tendency to self-anoint and all its idiosyncrasies notwithstanding, the IANA maintains the link relation registry[1]. Use the procedure prescribed in the RFCs.

    1. <https://www.iana.org/assignments/link-relations/link-relatio...>

  • blahgeek 6 hours ago ago

    Does this mean that, when the user clicks a "share to social.network" button in random.com, the browser would first request the full html page of social.network (in the background) only to parse the rel="share-url" link? Seems a bad design.

  • foxfired an hour ago ago

    This is what I currently use on my blog and it works particularly well:

      navigator.share({
        title: "hello",
        text: "World",
        url: window.location.href
      });
    
    Plus if the page has images, the browser will automatically use it.
  • kemayo 4 hours ago ago

    Looking at ShareOpenly, I think this is basically a reaction to "Mastodon instances make social sharing complicated from the web". A "share to Mastodon" button is impossible, and a button for every Mastodon instance in existence is impractical. Thus a "fuck it, I guess just put in a URL and we'll work out how to send something to it" solution.

    Speaking as someone who never ever uses a share button I think this is misguided, we should just remove that entire class of widget from the web, and people who want to share things can copy-paste the URL into their platforms of choice.

    • tegiddrone 4 hours ago ago

      I agree. Except we aren't there with web literacy and having that integrated UX is significant.

      • kemayo an hour ago ago

        I think the sort of person who would paste/type the URL for another social service into the freeform "or some other service" input on ShareOpenly is exactly the sort of person who has that web literacy, though. Which I guess doesn't support my "delete them all!" desire, but rather sadly reinforces keeping the status quo.

  • hombre_fatal 4 hours ago ago

    So, it's a way to tell other applications how they would craft a URL on your site such that they can prefill a form on your site?

    A meta tag in the html of your webpages seems like the wrong place for that info since it's not something that changes per page unlike the OpenGraph/TwitterCard meta tags that tell third-party apps how to generate a preview of the page.

    Surely a better place would be example.com/.well-known/share-url.

  • geocar 7 hours ago ago

    One thing I really don't like about it is the implication that the url and the share-button could refer to different things. I feel like browser vendors probably care about knowing whether users use the share button or copy/paste the URL, but hypothetically they know already and I don't feel like most (any?) websites need that information -- it might correlate to a sophistication-level of the user and be used for targeting by scammers, and that could be bad.

    For me, I use history.replaceState to change the url after I've got my campaign tracking to the share link, this way the browser's built-in share button does all the work for me. I can detect trivial-reload by checking the cookie I dropped when the page came in, so I don't mis-attribute shares. It is a shame I cannot do this so easily without JavaScript, but I'm sure I can actually buy non-JavaScript users from Google (and other ad platforms) so I'm not sure it's worth worrying about.

  • uberman 7 hours ago ago

    I don't care for the dash myself. I would have chosen something more like rel="shareable"

  • nashashmi 7 hours ago ago

    I was thinking A button can also be an alternative with all data sent as post, but apparently the button attributes don’t include any ability to specify form values. This has to be done via JS or via additional tags (which is still an option).