Last active
August 22, 2024 16:24
-
-
Save ashtonmeuser/6e3869d8e468e016f22a4b4de79509bd to your computer and use it in GitHub Desktop.
Misc. bookmarklets from https://news.ycombinator.com/item?id=38014069
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
//bookmarklet-title: Canvas DL | |
//bookmarklet-about: When playing skribbl.io and someone has made a nice drawing, this lets you download the current drawing as a PNG. | |
var w = window.wdq || (window.wdq = document.createElement("a")); | |
var p = /The word was '([^']*)'/g, | |
pp = /<span>([^<>]+) is drawing now!/g, | |
tt = document.body.innerHTML; | |
var mm, nn, xx; | |
while (mm = p.exec(tt)) nn = mm; | |
while (mm = pp.exec(tt)) xx = mm; | |
w.download = location.host + "_" + (nn ? nn[1] + "_" : "") + (xx ? xx[1] + "_" : "") + new Date().toISOString().replace(/:/g, "_"); | |
w.href = document.querySelector("canvas").toDataURL(); | |
w.click(); |
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
//bookmarklet-title: Markdown Link | |
//bookmarklet-about: Get Markdown link of the current page as [Title](url). | |
function e() { | |
var e = ""; | |
if (window.getSelection) e = window.getSelection().toString(); | |
else if (document.getSelection) e = document.getSelection().toString(); | |
else { | |
if (!document.selection) return null; | |
e = document.selection.createRange().text | |
} | |
return e | |
} | |
var t = e(), | |
n = window.document.title, | |
o = window.location.href, | |
i = []; | |
if (t) { | |
i.push("[" + t + "]") | |
} else { | |
i.push("[" + n + "]"), i.push("(" + o + ")") | |
} | |
window.prompt("created link", i.join("")) |
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
//bookmarklet-title: Nitter | |
//bookmarklet-about: Twitter to Nitter. | |
h = ['nitter.it', 'nitter.snopyta.org', 'nitter.net']; | |
location.href = location.href.replace(window.location.host, h[Math.floor(Math.random() * h.length)]); |
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
//bookmarklet-title: Nebula No-Alt-# | |
//bookmarklet-about: Nebula's video viewer annoying captures e.g. alt-3 to do the same as plain 3 (seek to 3/10 of the video currently playing), but I expect it to switch to the 3rd browser tab instead. YouTube doesn't do this. Luckily I can just activate this bookmarklet. | |
document.addEventListener("keydown", (e) => void(e.altKey && !isNaN(+e.key) && e.stopPropagation())) |
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
//bookmarklet-title: Don't Mess With Paste | |
//bookmarklet-about: For when signup forms expect you to hand-type your email address twice. | |
["contextmenu", "copy", "paste", "selectstart"].map(e => document.addEventListener(e, e => e.stopPropagation(), true)) |
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
//bookmarklet-title: Unfuck Slack | |
//bookmarklet-about: Restore Slack's old UI. | |
localStorage.setItem("localConfig_v2", localStorage.getItem("localConfig_v2").replace(/\"is_unified_user_client_enabled\":true/g, '\"is_unified_user_client_enabled\":false')); | |
location.reload(); |
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
//bookmarklet-title: Wayback | |
//bookmarklet-about: See current page on the Wayback Machine. | |
window.open('https://web.archive.org/web/*/' + location.href.replace(/\/$/, '')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment