Bookmarklets
I run my bookmarklets from KM like so:
Bookmarklets I use
- Go to first commit of currently open repo
- Online article discussion finder - Lets you see where the link you are watching right now has been discussed before.
Notes
- You can add bookmarklets in Safari either by:
- Dragging a bookmarklet from a webpage to your bookmarks bar then moving it from there.
- Creating a random bookmark, then editing it and changing the URL to the bookmarklet JavaScript.
Code
Go to initial commit on GitHub repo. Must have GitHub repo open in active tab.
js
javascript: ((b) =>
fetch("https://api.github.com/repos/" + b[1] + "/commits?sha=" + (b[2] || ""))
.then((c) => Promise.all([c.headers.get("link"), c.json()]))
.then((c) => {
if (c[0]) {
var d = c[0].split(",")[1].split(";")[0].slice(2, -1);
return fetch(d).then((e) => e.json());
}
return c[1];
})
.then((c) => c.pop().html_url)
.then((c) => (window.location = c)))(
window.location.pathname.match(/\/([^\/]+\/[^\/]+)(?:\/tree\/([^\/]+))?/)
);
Links
- Powerlet - Chrome Extension to quickly find and run bookmarklets.
- Awesome Bookmarklets
- Awesome Userscripts (HN)
- Userscripter - Create userscripts in a breeze.
- Cherry - Collection of handcrafted resources.
- Scriptbar Snippets - Handy and easy to understand snippets to keep in your browser. (Code)
- userscript.zone - Search for userscripts by URL, domain or search term. (HN)
- HN Anti Paywall - Userscript that adds archive URLs below the paywalled HN submissions. (HN)
- Hacker News userscript to make this site more legible (HN)
- Bookmarklet Editor (Lobsters)
- esbuild-plugin-bookmarklet - Esbuild plugin to generate bookmarklets.