<p dir="auto">I wanted to check if <a href="https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share" rel="nofollow">navigator.share</a> works. This PR adds a hidden button for native share and unhides it if native share is available. On desktops it may not be available but it worked for me in Chrome on an Android phone.<sup><a href="#user-content-fn-1-a4776d9632e4db39f689e03bc0112eda" id="user-content-fnref-1-a4776d9632e4db39f689e03bc0112eda" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup></p>
<p dir="auto">I'm not sure if it's very useful because you can just share the current page url from the browser menu.</p>
<p dir="auto"><a href="https://github.com/user-attachments/assets/61df323d-6a2e-4b73-b6e2-05820feccc8a">image.png (view on web)</a></p>
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only" dir="auto">Footnotes</h2>
<ol dir="auto">
<li id="user-content-fn-1-a4776d9632e4db39f689e03bc0112eda">
<p dir="auto">The server needs to run either on https or localhost, so you'll likely need to enable port forwarding on chrome://inspect/#devices to test this locally. <a href="#user-content-fnref-1-a4776d9632e4db39f689e03bc0112eda" data-footnote-backref="" aria-label="Back to reference 1" class="data-footnote-backref">↩</a></p>
</li>
</ol>
</section>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5882'>https://github.com/openstreetmap/openstreetmap-website/pull/5882</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/commits/c29dbbbb0a58a1e4b5e3a7cac404fa50d6e06967" class="commit-link">c29dbbb</a> Add focus ring to share buttons</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/commits/8b8287a4d268a4dd5b7353986bb71aba1e2060ae" class="commit-link">8b8287a</a> Replace .ssb-icon with [data-share-type]</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/commits/a9b03ef557861c2db8fc4354b2011631741e5f25" class="commit-link">a9b03ef</a> Add hidden share button</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/commits/f3eb473f3eb6df9c5c001e12ac4a7aa53194d49a" class="commit-link">f3eb473</a> Enable share button to do native share</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/files">4 files</a>)</p>
<ul>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/files#diff-d0a409cb78b699e51d1807f7ec01ee9d1e1218efdbef9947f7290b406628db4e">app/assets/images/social_icons/share.svg</a>
(3)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/files#diff-9e37e7466f247be7327cecd430a685e9b9ccbe305f99549e2106ee7607b91e1f">app/assets/javascripts/social_share_button.js</a>
(18)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/files#diff-22f6dbff3e22400e636b6f70bcaef16d9b6038aad4ac96daa11350633272bfc6">app/helpers/social_share_button_helper.rb</a>
(25)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882/files#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7">config/locales/en.yml</a>
(3)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5882.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5882.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5882.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5882.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5882">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLIT6DMV5YWI3I323L2XVEEZAVCNFSM6AAAAAB2MOSAVKVHI2DSMVQWIX3LMV43ASLTON2WKOZSHE3DSOBZHA3DONI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPJRLA2WAP6HRTGQL32XVEEZA5CNFSM6AAAAAB2MOSAVKWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHLCBIOWM.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5882</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5882",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5882",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>