toggle fullscreen

try to take over the world!

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

  1. // ==UserScript==
  2. // @name toggle fullscreen
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description try to take over the world!
  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. // get window width height
  21. var ht = $(window).height();
  22. var wd = $(window).width();
  23.  
  24. window.setTimeout(function(){
  25. $('.player-placeholder').after(
  26. '<div id="blockingdiv" style="width:100%; height:200px; background-color: pink;" ></div>'
  27. );
  28.  
  29. $('#blockingdiv').on('click', function(){
  30.  
  31. window.setTimeout(function(){
  32. $('.ytp-unmute-text').trigger('click');
  33. }, 500);
  34.  
  35. window.setTimeout(function(){
  36. $('.fullscreen-icon').find('path').trigger('click');
  37. }, 500);
  38.  
  39. window.setTimeout(function(){
  40. $('.video-stream').width(wd);
  41. $('.video-stream').height(ht);
  42. }, 2000);
  43. });
  44.  
  45. }, 1000);
  46.  
  47.  
  48.  
  49.  
  50.  
  51. }
  52. );
  53.  
  54. })();