9gag.com video controls on hover

Show video controls on mouse hover

  1. // ==UserScript==
  2. // @name 9gag.com video controls on hover
  3. // @namespace pl.srsbiz
  4. // @description Show video controls on mouse hover
  5. // @include https://9gag.com/*
  6. // @require https://code.jquery.com/jquery-3.7.1.slim.min.js
  7. // @grant none
  8. // @version 0.0.1.20250713082501
  9. // ==/UserScript==
  10.  
  11. jQuery(document).ready(function($){
  12. var attachVideoControls = function(){
  13. var containers = $('#list-view-2,#individual-post,.listview,.post-page');
  14. if (containers.length) {
  15. containers.on('mouseenter', 'video', function(evt){
  16. $(this).prop('controls', true);
  17. }).on('mouseleave', 'video', function(evt){
  18. $(this).prop('controls', false);
  19. });
  20. } else {
  21. window.setTimeout(attachVideoControls, 250);
  22. }
  23. };
  24. window.setTimeout(attachVideoControls, 250);
  25. });

QingJ © 2025

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