Last active
May 1, 2021 16:55
-
-
Save rdela/0adf0692583d64a9842eef59c36ffa02 to your computer and use it in GitHub Desktop.
post link and optional selection to micro.blog mac app
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
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); |
Thanks for the reminder about this! If anyone wants to update it to start a post on the web version of Micro.blog, they can replace the microblog://post?text=
with https://micro.blog/post?text=
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
added check against
document.getSelection().rangeCount > 0
instead of for the existence ofdocument.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.