Greasy Fork is available in English.
simple script to add html5 controls to 9gag gif and video post. Set default volume to 50%
当前为
// ==UserScript==
// @name 9gag show video control
// @namespace http://javalatte.xyz
// @version 1.3.1
// @description simple script to add html5 controls to 9gag gif and video post. Set default volume to 50%
// @author JavaLatte
// @match https://9gag.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var timer;
function addVideoControl(){
var vids = document.getElementsByTagName('video');
for( var i = 0; i < vids.length; i++ ){
var elem = vids.item(i);
if(!elem.hasAttribute("controls")){
elem.setAttribute("controls", "");
elem.volume = 0.5;
console.log('video controls added');
}
}
}
timer = setInterval(addVideoControl, 1000);
})();