The Web Share API in Safari on iOS

if (navigator.share) {
navigator.share(
{
title: document.querySelector('title').textContent,
text: document.querySelector('meta[name="description"]').getAttribute('content'),
url: document.querySelector('link[rel="canonical"]').getAttribute('href')
}
);
}
if (navigator.share) {
navigator.share(
{
title: document.querySelector('title').textContent,
url: document.querySelector('link[rel="canonical"]').getAttribute('href')
}
);
}

--

--

--

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jeremy Keith

Jeremy Keith

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

More from Medium

How to resolve the swiping right action when trying to navigate to a previous screen in iOS.

Generating and Uploading an iOS Symbol File Using Crash

You put a constraint on core data and your app bricked?

Swift 5.6: Property Wrappers