-
-
Save billerickson/320e763506b5c61600c1ed54cbeb6f55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change Google Maps links to Apple Maps on iOS | |
var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; | |
if( !! iOS ) { | |
var links = document.body.querySelectorAll('.map-link'); | |
links.forEach( function(e) { | |
var url = e.getAttribute('href').replace('google', 'apple'); | |
e.setAttribute('href', url ); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a class="map-link" href="https://maps.google.com/?q=6750+West+Loop+South%2C+Suite+920+Bellaire+TX+77401">link to map</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment