NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Tumblr GIFV to GIF
// @namespace Nilesy
// @match https://*.tumblr.com/*
// @license MIT
// @grant none
// ==/UserScript==
var interval = setInterval(replaceGifvs, 1000);
function replaceGifvs(){
var imgs = document.getElementsByTagName("img");
var links = document.getElementsByTagName("a");
var pattern = new RegExp(".*\.gifv");
for(var i=0; i<imgs.length; i++){
if(pattern.test(imgs[i].src)){
imgs[i].src = imgs[i].src.substr(0, imgs[i].src.length-1);
}
}
for(i=0; i<links.length; i++){
if(pattern.test(links[i].href)){
links[i].href = links[i].href.substr(0, links[i].href.length-1);
}
}
}