From ca7340747be44ea08a178e09320c840410fe8e21 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Sun, 14 Aug 2022 23:51:50 +0900 Subject: [PATCH] create youtube-restore-to-scroll.user.js --- README.md | 4 ++++ youtube-restore-to-scroll.user.js | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 youtube-restore-to-scroll.user.js diff --git a/README.md b/README.md index 3626a28..ca13e8a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ YouTube から piped.kavin.rocks にリダイレクトする Twitter の画像 URL を短縮する +## youtube-restore-to-scroll.user.js + +YouTube をスペースキーでスクロールできるように戻す + ## ライセンス MIT License diff --git a/youtube-restore-to-scroll.user.js b/youtube-restore-to-scroll.user.js new file mode 100644 index 0000000..2350b46 --- /dev/null +++ b/youtube-restore-to-scroll.user.js @@ -0,0 +1,13 @@ +// ==UserScript== +// @match https://www.youtube.com/* +// ==/UserScript== +"use strict"; + +function main() { + const { yt } = window; + if (yt) yt.config_.EXPERIMENT_FLAGS.global_spacebar_pause = false; +} + +const script = document.createElement("script"); +script.textContent = `"use strict";${main.name}();${String(main)}`; +document.head.append(script);