Skip to content

Instantly share code, notes, and snippets.

@troy
Last active December 11, 2020 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troy/02e69e885b0d66eda65f7ee632dbd596 to your computer and use it in GitHub Desktop.
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)
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,", ")); }) ();
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