Skip to content

Instantly share code, notes, and snippets.

@mrabbitt
Last active August 29, 2015 14:00
Show Gist options
  • Save mrabbitt/11194350 to your computer and use it in GitHub Desktop.
Save mrabbitt/11194350 to your computer and use it in GitHub Desktop.
Tweaked version of Pinboard "popup with tags" bookmarklet.
/**
* 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