Video controls on hover for i.imgur.com

Show video controls on mouse hover for for imgur.com

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           Video controls on hover for i.imgur.com
// @description    Show video controls on mouse hover for for imgur.com
// @include        https://i.imgur.com/*
// @grant          none
// @icon           https://imgur.com/favicon.ico
// @require        https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @author         flowscript
// @version 1.0
// @namespace https://greasyfork.org/users/158563
// ==/UserScript==

jQuery(document).ready(function($){    
  var attachVideoControls = function(){
    var containers = $('.video-container');
    if (containers.length) {
      containers.on('mouseenter', 'video', function(evt){
        $(this).prop('controls', true);
      }).on('mouseleave', 'video', function(evt){
        $(this).prop('controls', false);
      });
    } else {
      window.setTimeout(attachVideoControls, 250);
    }
  };
  window.setTimeout(attachVideoControls, 250);
});