Created
August 19, 2011 09:49
-
-
Save tordans/1156477 to your computer and use it in GitHub Desktop.
Bookmarklet: Get a clean, shareable Google Maps Place URL on every Google Maps Place-Page
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
/** | |
* How to install: | |
* 1. Open the Firefox or Chrome and Add a new Bookmark-Dialogue | |
* 2. Copy the line of JS from below and provide whatever name and shortcut-tags you whant | |
* | |
* How to use and test it: | |
* 1. Search for a place in Google Maps, click on the title to get to the place's details page. This is where google could just place a clean place-url in your browser bar but doen't. | |
* 2. Click the bookmarklet and the Page reloads so you get a clean google place URL in your browser-bar. | |
* 3. Jump to your browserbar with cmd+L (strg+L) and press strg+c to copy the clean URL. | |
**/ | |
var urlchunks = document.getElementById('link').getAttribute('href').split(/[&?]+/); for(key in urlchunks) { if(urlchunks[key].indexOf('cid')===0) { window.location.href = (urlchunks[0] + "?" + urlchunks[key]); } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment