🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

停用YouTube「播放已暫停,是否繼續觀看?」提示視窗與播放延遲

自動停用YouTube 的「播放已暫停,是否繼續觀看?」提示與初始播放延遲。

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         YouTube「再生が中断されていますか?」ポップアップと再生遅延の無効化
// @name:ja      YouTube「再生が中断されていますか?」ポップアップと再生遅延の無効化
// @name:en      Disable YouTube "Experiencing interruptions?" Popup and Playback Delay
// @name:zh-CN   禁用YouTube“播放暂停,是否继续观看?”弹窗及播放延迟
// @name:zh-TW   停用YouTube「播放已暫停,是否繼續觀看?」提示視窗與播放延遲
// @name:ko      YouTube "중단되었나요?" 팝업 및 재생 지연 비활성화
// @name:fr      Désactiver la fenêtre "Lecture interrompue ?" et le délai de lecture sur YouTube
// @name:es      Desactivar el mensaje "¿Se interrumpió la reproducción?" y el retraso de reproducción en YouTube
// @name:de      Deaktiviere das YouTube-Popup "Wiedergabe unterbrochen?" und die Wiedergabeverzögerung
// @name:pt-BR   Desativar o pop-up "A reprodução foi interrompida?" e o atraso de reprodução no YouTube
// @name:ru      Отключить всплывающее окно "Воспроизведение прервано?" и задержку воспроизведения на YouTube
// @version      1.0.2
// @description         YouTubeの「再生が中断されていますか?」ポップアップ(例: "Experiencing interruptions?")および初回再生時の遅延を自動で無効化します。
// @description:ja      YouTubeの「再生が中断されていますか?」ポップアップ(例: "Experiencing interruptions?")および初回再生時の遅延を自動で無効化します。
// @description:en      Automatically disables YouTube’s “Experiencing interruptions?” and “Video paused. Continue watching?” popups, as well as initial playback delay.
// @description:zh-CN   自动禁用YouTube“播放暂停,是否继续观看?”弹窗以及初始播放延迟。
// @description:zh-TW   自動停用YouTube 的「播放已暫停,是否繼續觀看?」提示與初始播放延遲。
// @description:ko      YouTube의 "중단되었나요?" 팝업 및 초기 재생 지연을 자동으로 비활성화합니다。
// @description:fr      Désactive automatiquement la fenêtre "Lecture interrompue ?" et le délai de lecture initial sur YouTube.
// @description:es      Desactiva automáticamente el mensaje "¿Se interrumpió la reproducción?" y el retraso inicial de reproducción en YouTube.
// @description:de      Deaktiviert automatisch das YouTube-Popup "Wiedergabe unterbrochen?" und die initiale Wiedergabeverzögerung.
// @description:pt-BR   Desativa automaticamente o pop-up "A reprodução foi interrompida?" e o atraso inicial de reprodução no YouTube.
// @description:ru      Автоматически отключает всплывающее окно "Воспроизведение прервано?" и начальную задержку воспроизведения на YouTube.
// @namespace    https://github.com/koyasi777/youtube-disable-experiencing-interruptions
// @author       koyasi777
// @match        https://www.youtube.com/*
// @run-at       document-start
// @grant        none
// @license      MIT
// @homepageURL  https://github.com/koyasi777/youtube-disable-experiencing-interruptions
// @supportURL   https://github.com/koyasi777/youtube-disable-experiencing-interruptions/issues
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @compatible   firefox
// ==/UserScript==

(function () {
    'use strict';

    // if (!navigator.userAgent.includes('Firefox')) return;

    const isWatchPage = location.pathname.startsWith('/watch');
    if (!isWatchPage) return;

    Object.defineProperty(window, 'ytInitialData', {
        configurable: true,
        set(value) {
            const patched = undefined;

            Object.defineProperty(window, 'ytInitialData', {
                value: patched,
                writable: false,
                configurable: true
            });
        },
        get() {
            return undefined;
        }
    });
})();