Skip to content

Instantly share code, notes, and snippets.

@Chengings
Last active September 20, 2024 17:03
Show Gist options
  • Save Chengings/c63477b1481700c1431edaa5a25008c2 to your computer and use it in GitHub Desktop.
Save Chengings/c63477b1481700c1431edaa5a25008c2 to your computer and use it in GitHub Desktop.
Bookmarklets
javascript: (() => {
/mozilla.org/.test(document.location.host) &&
(document.location.hostname = "www-dev.allizom.org");
})();
javascript: (() => {
if (/reddit.com/.test(document.location.host)) {
document.location.assign(
`http://10.11.13.22:34567/${document.location.pathname}`,
);
} else if (/x.com/.test(document.location.host)) {
document.location.hostname = "xcancel.com";
} else if (/youtube.com/.test(document.location.host)) {
document.location.hostname = "piped.video";
} else if (/medium.com/.test(document.location.host)) {
document.location.hostname = "scribe.rip";
}
})();
javascript:(()=>{
const originalParams = (new URL(document.location)).searchParams;
const videoId = originalParams.get('v');
const timestamp = originalParams.get('t');
const url = new URL(`/embed/${videoId}`, "https://www.youtube-nocookie.com");
url.searchParams.set('iv_load_policy', '1'); /* show video annotations */
url.searchParams.set('modestbranding', '1'); /* disables showing the YouTube logo in the video control bar */
url.searchParams.set('cc_load_policy', '1'); /* closed captions to be shown by default */
if(timestamp){
url.searchParams.set('start', timestamp.replace('s', '')); /* remove 's' from timestamp */
}
document.location.href = url;
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment