autoplay and rewind - fix stutter jjj66

force auto open in new tab

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         autoplay and rewind - fix stutter jjj66
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  force auto open in new tab
// @author       You
// @match      https://m.youtube.com/watch*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant        none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...\
    $(document).ready(
        function() {

            window.setTimeout(function(){
                // Get the element
                let element = document.querySelector('.ytp-unmute-icon');

                // Create a new 'click' event
                let clickEvent = new MouseEvent("click", {
                    bubbles: true,
                    cancelable: true,
                    view: window
                });

                element.dispatchEvent(clickEvent);
            }, 1000);

            window.setTimeout(function(){
                // Get the element
                let element = document.querySelector('.player-controls-content');

                // Create a new 'click' event
                let clickEvent = new MouseEvent("click", {
                    bubbles: true,
                    cancelable: true,
                    view: window
                });

                element.dispatchEvent(clickEvent);
            }, 2000);


            window.setTimeout(function(){
                // Get the element
                let element = document.querySelector('.player-controls-double-tap-to-seek-static-circle');

                // Create a new 'click' event
                let clickEvent = new MouseEvent("click", {
                    bubbles: true,
                    cancelable: true,
                    view: window
                });

                // Function to dispatch the event
                function doubleTap() {
                    element.dispatchEvent(clickEvent);
                    setTimeout(() => {
                        element.dispatchEvent(clickEvent);
                    }, 200); // 200ms delay between taps
                }

                // Execute the double tap
                doubleTap();
            }, 2000);

        }
    );
})();