From 961fd6b37d0959b4a100f4ebc6306f1db44d94b7 Mon Sep 17 00:00:00 2001 From: phga Date: Fri, 17 Apr 2026 11:39:29 +0200 Subject: [PATCH] init: mep --- rewrite-reddit.js | 10 ++++++++++ stack_datetime.js | 15 +++++++++++++++ yt-default-speed.js | 29 +++++++++++++++++++++++++++++ yt-no-ads.js | 31 +++++++++++++++++++++++++++++++ yt-no-inline-ads.js | 16 ++++++++++++++++ yt-no-shorts.js | 16 ++++++++++++++++ 6 files changed, 117 insertions(+) create mode 100644 rewrite-reddit.js create mode 100644 stack_datetime.js create mode 100644 yt-default-speed.js create mode 100644 yt-no-ads.js create mode 100644 yt-no-inline-ads.js create mode 100644 yt-no-shorts.js diff --git a/rewrite-reddit.js b/rewrite-reddit.js new file mode 100644 index 0000000..8696515 --- /dev/null +++ b/rewrite-reddit.js @@ -0,0 +1,10 @@ +// ==UserScript== +// @name rewrite-reddit +// @namespace toerd +// @description Rewrite new to old reddit +// @include *www.reddit.com* +// @version 1 +// @run-at document-start +// ==/UserScript== + +// window.location.replace(window.location.toString().replace(/www/, 'old')); diff --git a/stack_datetime.js b/stack_datetime.js new file mode 100644 index 0000000..65f6828 --- /dev/null +++ b/stack_datetime.js @@ -0,0 +1,15 @@ +// ==UserScript== +// @name stack-date-time +// @namespace phga +// @description Display "normal" timestamps on SE Answers +// @include *stack* +// @version 1 +// @run-at document-load +// ==/UserScript== +(function() { + const reltimes = [...document.getElementsByClassName("relativetime")]; + console.log(reltimes); + reltimes.forEach(e => { + e.innerHTML = e.title; + }); +})(); diff --git a/yt-default-speed.js b/yt-default-speed.js new file mode 100644 index 0000000..89644a3 --- /dev/null +++ b/yt-default-speed.js @@ -0,0 +1,29 @@ +// ==UserScript== +// @name Default Speed for YT Videos +// @version 1.0.0 +// @description Speed up YouTube Videos +// @author phga +// @match *://*.youtube.com/* +// @exclude *://*.youtube.com/subscribe_embed?* +// ==/UserScript== +const speed = 1.5; +const timeout = 100; +const waitAndRunSpeed = () => { + setTimeout(setVideoSpeed, timeout); +} +const setVideoSpeed = () => { + const ad = [...document.querySelectorAll('.ad-showing')][0]; + const video = document.querySelector('video'); + // If no ad is playing and the video has really started + if (!ad && video.currentTime >= 1) { + video.playbackRate = speed; + console.log(`Set video speed to ${speed}`); + } else { + console.log("Ad is running. Retrying to set video speed..."); + setTimeout(setVideoSpeed, timeout); + } +} + +// So we do not have to constantly run the function with setInterval +window.navigation.addEventListener("navigate", waitAndRunSpeed); +waitAndRunSpeed(); diff --git a/yt-no-ads.js b/yt-no-ads.js new file mode 100644 index 0000000..7d5ef91 --- /dev/null +++ b/yt-no-ads.js @@ -0,0 +1,31 @@ +// ==UserScript== +// @name Auto Skip YouTube Ads +// @version 1.0.0 +// @description Speed up and skip YouTube ads automatically +// @author jso8910 +// @match *://*.youtube.com/* +// @exclude *://*.youtube.com/subscribe_embed?* +// ==/UserScript== + +// Does not work 2025-10-05T20:16 +//