Last active
December 11, 2020 14:04
-
-
Save troy/02e69e885b0d66eda65f7ee632dbd596 to your computer and use it in GitHub Desktop.
Browser bookmarklet to view a highlighted venue name, highlighted street address, or the place about the current URL in Google Maps (where you can click Save to save it to a list)
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
javascript:( function() {q = window.getSelection().toString(); if (q.length == 0) {q = window.location.hostname.replace(/^www./,''); if (['instagram.com', 'facebook.com'].includes(q)) {q = window.location.hostname + '/' + window.location.pathname.split('/')[1] } else if (['yelp.com'].includes(q)) { q = document.title.split(' - ')[0] } } window.open('http://maps.google.com?q='+q.trim().replace(/\r\n|\r|\n/g,", ")); }) (); |
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
javascript:( function() { | |
q = window.getSelection().toString(); | |
if (q.length == 0) { | |
q = window.location.hostname.replace(/^www./,''); | |
if (['instagram.com', 'facebook.com'].includes(q)) { | |
q = window.location.hostname + '/' + window.location.pathname.split('/')[1] | |
} else if (['yelp.com'].includes(q)) { | |
q = document.title.split(' - ')[0] | |
} | |
} | |
window.open('http://maps.google.com?q='+q.trim().replace(/\r\n|\r|\n/g,", ")); | |
}) (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment