Last active
August 29, 2015 14:00
-
-
Save mrabbitt/11194350 to your computer and use it in GitHub Desktop.
Tweaked version of Pinboard "popup with tags" bookmarklet.
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
/** | |
* Tweaked version of Pinboard "popup with tags" bookmarklet from | |
* https://pinboard.in/howto/ | |
* | |
* - Explicitly focuses on new window to workaround window opening in the | |
* background on iPhone. | |
*/ | |
(function() { | |
var url = location.href; | |
var description; | |
if (document.getSelection) { | |
description = document.getSelection(); | |
} | |
else { | |
description = ''; | |
} | |
var pinboardWindow = open('https://pinboard.in/add?showtags=yes&url=' + | |
encodeURIComponent(url) + '&description=' + encodeURIComponent(description) + | |
'&title=' + encodeURIComponent(document.title), | |
'Pinboard', 'toolbar=no,scrollbars=yes,width=750,height=700'); | |
pinboardWindow.focus(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment