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.
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.
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
- there's a giant banner on the left saying "unofficial"
- The "Status of this document" section states the following:
--- start quote ---
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.
--- end quote ---
But just because it was shipped in Chrome and has some napkin scribbles resembling an official spec, people will both claim it's a spec and expect everyone to implement it.
https://github.com/mdn/browser-compat-data/blob/main/manifes... (data integrated into the MDN page I linked)
Chromium: https://chromestatus.com/feature/5662315307335680, implemented on Android from M71 and desktop from M89.
WebKit: standards position is neutral <https://github.com/WebKit/standards-positions/issues/11>, and https://bugs.webkit.org/show_bug.cgi?id=194593 shows plenty of developer interest but doesn’t look to have been touched by Apple.
Firefox: standards position is positive <https://mozilla.github.io/standards-positions/#web-share-tar...>, but https://bugzilla.mozilla.org/show_bug.cgi?id=1476515 has languished.
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.
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.
> 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...>
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.
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.
nashashmi•2h ago