Wondering I've I as a developer of a web app could develop sth like a receiver for the navigator.share() action, e.g.:
On some random Website https://share-some.info the Share API is called:
navigator.share({
title: document.title,
text: "Hello World",
url: window.location.href
}).then(() => console.log('Successful share'))
.catch(() => console.log('Error sharing:', error));
Then the browser handles the request as described but, additionally shows web apps between the native apps installed on the users device:
Share using: Whatsapp, Save to Google Keep, ShareRecieverWA, Inbox, ...
And in the Share receiver web app https://share-using-wa.new:
sw.js
self.addEventListener('share', function(evt) {
// TODO: add share logic here
});
I think this would be awesome as we currently have this new Share API and more and more sites register a service worker on their sites and this would improve the experiences for web apps.
What do you think about such a feature?
0voters
Votes are public.