Youtube Mobile Toggle Show Controls Overlay

Adds a button below player to show/hide controls on hover

  1. // ==UserScript==
  2. // @name Youtube Mobile Toggle Show Controls Overlay
  3. // @version 1
  4. // @grant none
  5. // @match https://m.youtube.com/watch*
  6. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  7. // @description Adds a button below player to show/hide controls on hover
  8. // @namespace asleepysamurai.com
  9. // @license BSD Zero Clause License
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. const done = false
  15.  
  16. function init(){
  17. const player = document.querySelector('.watch-below-the-player')
  18. if(!player){
  19. setTimeout(init, 300)
  20. return
  21. }
  22.  
  23. let showingControls = true
  24. const button = document.createElement('button')
  25. button.addEventListener('click',()=>{
  26. document.querySelector('#player-control-container').setAttribute('style',`display:${showingControls? 'none':'inherit'} !important`);
  27. button.innerText = `${showingControls ? 'Hide': 'Show'} Controls`
  28. showingControls = !showingControls
  29. })
  30. button.innerText="Hide Controls"
  31. button.setAttribute('style','font-size:x-large;padding:10px 20px')
  32.  
  33. player.before(button)
  34. }
  35.  
  36. init();
  37. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址