toggle fullscreen

toggle fullscreen on youtube auto

当前为 2022-03-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name toggle fullscreen
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description toggle fullscreen on youtube auto
  6. // @author You
  7. // @match https://m.youtube.com/watch*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  9. // @grant none
  10. // @require http://code.jquery.com/jquery-latest.js
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Your code here...
  17. $(document).ready(
  18. function() {
  19.  
  20.  
  21. $(document.body).prepend(
  22. '<div id="blockingdiv" style="z-index: 1123123; width:100%; height:100%; position: fixed;" ></div>'
  23. );
  24.  
  25.  
  26. $('#blockingdiv').on('click', function(){
  27. $('#blockingdiv').remove();
  28.  
  29. window.setTimeout(function(){
  30. $('.ytp-unmute-text').trigger('click');
  31. }, 500);
  32.  
  33. window.setTimeout(function(){
  34. $('.fullscreen-icon').find('path').trigger('click');
  35. }, 500);
  36. });
  37.  
  38. }
  39. );
  40.  
  41. })();