Skip to content

Instantly share code, notes, and snippets.

@Whoaa512
Created September 26, 2023 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whoaa512/afa7b81dd210a35278100cf7a829047c to your computer and use it in GitHub Desktop.
Save Whoaa512/afa7b81dd210a35278100cf7a829047c to your computer and use it in GitHub Desktop.
Useful bookmarklets
javascript: (function () {
const vids = [
...document.querySelectorAll('video'),
...document.querySelectorAll('audio'),
...[...document.querySelectorAll('iframe').values()].flatMap(el => {
try {
return [
...el.querySelectorAll('video').values(),
...el.querySelectorAll('audio').values(),
];
} catch (e) {
return [];
}
}),
];
const defaultRate = 1.75;
if (vids.length > 0) {
const old = vids[0].playbackRate;
const rate = prompt(`New rate? Current:${old}`);
vids.forEach((vid) => {
vid.playbackRate = +(rate || (old === defaultRate ? 1 : defaultRate));
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment