toggle fullscreen

try to take over the world!

目前为 2022-03-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         toggle fullscreen
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  try to take over the world!
// @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() {

            // get window width height
            var ht = $(window).height();
            var wd = $(window).width();

            window.setTimeout(function(){
                $('.player-placeholder').after(
                    '<div id="blockingdiv" style="width:100%; height:200px; background-color: pink;" ></div>'
                );

                $('#blockingdiv').on('click', function(){

                    window.setTimeout(function(){
                        $('.ytp-unmute-text').trigger('click');
                    }, 500);

                    window.setTimeout(function(){
                        $('.fullscreen-icon').find('path').trigger('click');
                    }, 500);

                    window.setTimeout(function(){
                        $('.video-stream').width(wd);
                        $('.video-stream').height(ht);
                    }, 2000);
                });

            }, 1000);





        }
    );

})();