This is very handy.
Is this what's referred to as a Bookmarklet?
Also, everyone should be cautious about copy/pasting JavaScript code into their browser. This is a common attack vector on the internet.
ETA: I wrote about something similar to this in #161752
I looked up the definition of a bookmarklet here:
A bookmarklet is a bookmark stored in a web browser that contains JavaScript commands that add new features to the browser. They are stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. Bookmarklets are usually small snippets of JavaScript executed when user clicks on them. When clicked, bookmarklets can perform a wide variety of operations, such as running a search query from selected text or extracting data from a table.
So, yes, the code snippet that I shared would indeed be considered a bookmarklet.
Cool, I never knew it was called that until you mentioned it. Thanks!
reply
Also...
Once you've created a shortlink to a page that you've archived using the bookmarklet, if you highlight something within the archived page, the URL of that archived page will instantly change to reference the exact part(s) you've highlighted. That way if you need to refer to a specific part of some page to someone else, you can just share the shortened URL with the reference included in the shared URL, like this.
reply