Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created July 19, 2023 14:06
Show Gist options
  • Save jpluimers/562331002c6b6f5ebdfe87edcd9ffcfd to your computer and use it in GitHub Desktop.
Save jpluimers/562331002c6b6f5ebdfe87edcd9ffcfd to your computer and use it in GitHub Desktop.
Bookmarklet which prompts an HTML anchor with the canonical post address
javascript:{var postID=document.getElementsByName("comment_post_ID")[0]?.value; a=document.createElement("a"); a.href=HighlanderComments.connectURL; a.pathname=''; a.search=`?p=${postID}`; a.hash=''; a.target="blank"; a.rel="noopener"; a.text=document.querySelector('meta[property="og:title"]')?.content; prompt("Anchor", a.outerHTML); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment