Skip to content

Instantly share code, notes, and snippets.

@ashtonmeuser
Last active August 22, 2024 16:24
Show Gist options
  • Save ashtonmeuser/6e3869d8e468e016f22a4b4de79509bd to your computer and use it in GitHub Desktop.
Save ashtonmeuser/6e3869d8e468e016f22a4b4de79509bd to your computer and use it in GitHub Desktop.
//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();
//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)]);
//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()))
//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))
//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();
//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