Skip to content

Instantly share code, notes, and snippets.

Last active May 1, 2021 16:55
What would you like to do?
post link and optional selection to mac app
javascript:if(document.getSelection().rangeCount > 0){s='> '+document.getSelection()+'\n\n';}else{s='';};t=document.title;l=location.href;p='['+t+']'+'('+l+')';document.location='microblog://post?text='+encodeURIComponent(s+p);
Copy link

rdela commented May 16, 2020

added check against document.getSelection().rangeCount > 0 instead of for the existence of document.getSelection because I was getting false positive when nothing selected, leading to the top lines having:


...above the linked title. This seems to fix that in Safari. Gonna test Chrome and Firefox now.

Copy link

manton commented May 1, 2021

Thanks for the reminder about this! If anyone wants to update it to start a post on the web version of, they can replace the microblog://post?text= with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment