Auto Pause Youtube Channel Homepage Video

自動暫停Youtube頻道首頁的影片

  1. // ==UserScript==
  2. // @name Auto Pause Youtube Channel Homepage Video
  3. // @name:zh-TW Auto Pause Youtube Channel Homepage Video
  4. // @namespace https://gf.qytechs.cn/scripts/453851
  5. // @version 1.1.2
  6. // @description auto pause the channel homepage video
  7. // @description:zh-TW 自動暫停Youtube頻道首頁的影片
  8. // @author Derek
  9. // @match *://www.youtube.com/*
  10. // @grant none
  11. // @noframes
  12. // ==/UserScript==
  13.  
  14. const $ = (element) => document.querySelector(element)
  15.  
  16. const main = () => {
  17. if (/\/(@|channel|user|c)/.test(window.location.pathname)) {
  18. const observer = new MutationObserver(() => {
  19. const moviePlayer = $('ytd-browse video')
  20. if (moviePlayer && !moviePlayer.paused) {
  21. moviePlayer.pause()
  22. observer.disconnect()
  23. }
  24. })
  25. observer.observe(document.body, { attributes: false, childList: true, subtree: true })
  26. }
  27. }
  28.  
  29. document.addEventListener('yt-navigate-finish', main)

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址