Auto Pause Youtube Channel Homepage Video

auto pause the channel homepage video

目前为 2022-12-07 提交的版本。查看 最新版本

// ==UserScript==
// @name               Auto Pause Youtube Channel Homepage Video
// @name:zh-TW         Auto Pause Youtube Channel Homepage Video
// @namespace          https://greasyfork.org/scripts/453851
// @version            1.0.5
// @description        auto pause the channel homepage video
// @description:zh-TW  自動暫停Youtube頻道首頁的影片
// @author             Derek
// @match              *://www.youtube.com/*
// @grant              none
// @noframes
// ==/UserScript==

let main = () => {
  if (window.location.href.includes('/@')) {
    setTimeout(() => {
      let player = document.querySelector('ytd-browse video')
      if (player && !player.paused) player.pause()
    }, 1000)
  }
}

document.addEventListener('yt-navigate-finish', main)