您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Script to disable autoplay.
当前为
// ==UserScript== // @name YouTube Autoplay Disable // @name:ja YouTube 自動再生 無効化 // @namespace https://midra.me // @version 0.0.1 // @description Script to disable autoplay. // @description:ja 自動再生を無効化するスクリプト。 // @author Midra // @license MIT // @match https://www.youtube.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @run-at document-start // @grant GM_getValue // @grant GM_setValue // @grant GM_registerMenuCommand // @require https://gf.qytechs.cn/scripts/7212-gm-config-eight-s-version/code/GM_config%20(eight's%20version).js?version=156587 // ==/UserScript== (() => { const language = (window.navigator.languages && window.navigator.languages[0]) || window.navigator.language || window.navigator.userLanguage || window.navigator.browserLanguage const lang = language === 'ja-JP' ? 'ja' : 'en' const i18n = { configTitle: { ja: '自動再生を無効化する対象', en: 'Target to disable autoplay', }, configSaveAlert: { ja: '設定の変更を反映させるにはページを再読み込みしてください。', en: 'Please reload the page for the configuration changes to take effect.', }, configItems: { default: { ja: '通常の動画', en: 'Normal video', }, live: { ja: 'ライブ', en: 'Live', }, channel: { ja: 'チャンネルのホーム', en: 'Channel home', }, iframe: { ja: '埋め込み動画', en: 'Embedded video', }, }, } const configInitData = { default: { label: i18n.configItems.default[lang], type: 'checkbox', default: true, }, live: { label: i18n.configItems.live[lang], type: 'checkbox', default: true, }, channel: { label: i18n.configItems.channel[lang], type: 'checkbox', default: true, }, iframe: { label: i18n.configItems.iframe[lang], type: 'checkbox', default: true, }, } GM_config.init(i18n.configTitle[lang], configInitData) GM_config.onload = () => { setTimeout(() => { alert(i18n.configSaveAlert[lang]) }, 200) } GM_registerMenuCommand('設定', GM_config.open) // 設定取得 const config = {} Object.keys(configInitData).forEach(v => { config[v] = GM_config.get(v) }) if (window === window.parent) { window.addEventListener('yt-player-updated', ({ target, detail }) => { if (!(target instanceof HTMLElement)) return const videoData = detail.getVideoData() if ( // 通常の動画 ( config['default'] && target.id === 'ytd-player' && !videoData.isLive ) || // ライブ ( config['live'] && target.id === 'ytd-player' && videoData.isLive ) || // チャンネルのホーム ( config['channel'] && target.classList.contains('ytd-channel-video-player-renderer') ) ) { target.stop() } }) } else if ( config['iframe'] && window.location.href.startsWith('https://www.youtube.com/embed/') ) { const url = new URL(window.location.href) if ( url.searchParams.get('autoplay') !== '0' || url.searchParams.get('auto_play') !== 'false' ) { url.searchParams.set('autoplay', '0') url.searchParams.set('auto_play', 'false') window.location.href = url.href } } })()
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址