JS bookmarklet that clips selected text and page source

Not sure if someone else has posted this, but I’ve made (modified) a bookmarklet that clips text from a web page along with the page title and link, in md format.

The original code comes from here: Bookmarklet to copy current page title and url in Markdown format to clipboard - Usual for posting links to resources in README.md files

I’ve modified it so it also copies plain text selections. The gist lives here.

example:

image

usage:

  1. copy the above code
  2. open your browser, add a bookmark, paste the code in the address field and save
  3. now click on it and you should have the text copied
5 Likes

This is great!! Exactly what I was trying to find. Thanks

That is amazing, thanks

i want to give the data to this script via system clipboard instead of selection. can someone help me with that. it looks so simple but i can’t make it work

I fixed the js bookmarklet to also work when copying html lists (like copying ChatGPT responses that contain lists)

Feel free to update your gist with this version.