Last active
February 5, 2025 14:36
-
-
Save CTimmerman/cb304d55e436dab093aad882e10d4494 to your computer and use it in GitHub Desktop.
Bookmarklets / Favelets - Drag to bookmarks bar and rename, then click on page to affect.
This file contains hidden or 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
// Speed up / slow down HTML5 videos! Just set as URLs of bookmark bar items: | |
javascript:(function(){v = []; for(x of document.querySelectorAll("audio, video")) v.push(x); try{v.push(window.frames[0].document.querySelector("audio, video"))}catch(ex){}; for(i of v) i.playbackRate += .4}()) | |
javascript:(function(){v = []; for(x of document.querySelectorAll("audio, video")) v.push(x); try{v.push(window.frames[0].document.querySelector("audio, video"))}catch(ex){}; for(i of v) i.playbackRate -= .4}()) | |
// Highlight new Facebook notifications. | |
javascript:(function(){var s = document.createElement('style'); s.appendChild(document.createTextNode(".jewelItemNew ._33e{background-color:lightgreen!important;}")); document.head.appendChild(s)}()) | |
// Show videos from messy framework HTML, can't show toolbar in popup due to Chrome bug 82522. | |
javascript:(function(){var w=window.open();var d=w.document;d.title='Videos';d.body.style.backgroundColor='0';for(var v of document.getElementsByTagName('video')){v.style='';v.controls=1;v.loop=1;d.body.innerHTML+='<div>'+v.outerHTML+'</div>'}})() | |
// List images. | |
javascript:(function(){for(img of document.getElementsByTagName('img')) console.log(img.width, img.height, img.src)})() | |
// Talk. | |
javascript:(function(){s=window.speechSynthesis;u=new SpeechSynthesisUtterance("Hi, I'm free!");u.voice=s.getVoices()[2];u.pitch=1.0;u.rate=1.0;s.speak(u)})() | |
// Talk foreign without checking each voice, possibly with phrases from Google Translate which i don't think works without internet access. | |
javascript:(function(){s=window.speechSynthesis;u=new SpeechSynthesisUtterance("Hi, I'm free!");u.lang="en-US";u.pitch=1.0;u.rate=1.0;s.speak(u)})() | |
// Sort YouTube playlists | |
javascript:(()=>{let a=document.querySelector('#playlists');[...a.children].sort((a,b)=>a.innerText>b.innerText?1:-1).forEach(node=>a.appendChild(node))})() | |
// Open open YouTube transcript in a popup window to simply read/search/save it. | |
javascript:(()=>{var transcript = [...document.querySelectorAll('div.ytd-transcript-segment-renderer')].map(e=>e.innerText).join("\n"); var popup = window.open('', 'yt-transcript', `scrollbars=yes,resizable=yes,status=yes,location=no,toolbar=no,menubar=no,width=0,height=0,left=-1000,top=-1000`); popup.focus(); popup.document.body.style.color='white'; popup.document.body.style.backgroundColor='black'; popup.document.body.innerHTML=trustedTypes.createPolicy("forceInner",{createHTML:(s)=>s}).createHTML("<h3><a href='"+document.location+"'>"+document.title+"</a></h3><a download='"+document.title+" transcript.html' onclick='this.href=\"data:text/plain;charset=utf-8,\"+encodeURIComponent(document.documentElement.outerHTML)'>Download transcript</a><br><br>"+transcript.replaceAll(/ u[hm]\b/g, ' ').replaceAll(/\n[ :0-9]+\n/g, '\n').replaceAll(/\n([ :0-9]+)\n/g, '<br>$1 '))})() | |
// Dark mode | |
javascript:(() => { let ok = false; for (let i = 0; i < 100; ++i) { try { let s = document.styleSheets[i]; s.insertRule("* {background-color: #000!important; color: #FFF!important}", s.cssRules.length); ok = true; break } catch (ex) { console.log("Dark Mode " + ex) } } if (!ok) { let s = document.body.style; s.backgroundColor = "#000"; s.color = "#FFF"; console.log("Dark Mode fallback.") } })() | |
// Rotten Tomatoes rating dates | |
javascript:(()=>{collection = document.getElementsByClassName('rating-json'); for (o of collection) o.parentNode.children[1].innerHTML += " - " + new Date(JSON.parse(o.innerText).createTime)})() | |
// KTDash.app inches | |
javascript:document.querySelectorAll('.material-symbols-outlined').forEach(e => { e.innerHTML = e.innerHTML.replaceAll("change_history", '1"').replaceAll("radio_button_unchecked", '2"').replaceAll("crop_square", '3"').replaceAll("pentagon", '6"')}) |
Firefox (57.0.2) needed the self-invocation wrappers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also use ++ and -- from https://www.squarefree.com/bookmarklets/misc.html