Greasy Fork

Dailymotion Fix Sexy Images

Restores preview images of adult videos

当前为 2014-09-09 提交的版本,查看 最新版本

// ==UserScript==
// @name          Dailymotion Fix Sexy Images
// @namespace     http://www.SavageCabbage.com
// @description   Restores preview images of adult videos
// @include       http://www.dailymotion.com/*
// @grant         GM_getValue
// @grant         GM_setValue
// @version 0.0.1.20140909195612
// ==/UserScript==

// Previews of adult videos in dailymotion are not working on Firefox anymore
// This script restores them, by using the img's datasrc instead of src
 
var imgs = document.getElementsByTagName('img');
for (i=0; i<imgs.length; i++)
{
  // find only elements of "preview blurred" class
  if (imgs[i].className == "preview blurred")
  {
    // fix the src of the img
    imgs[i].src = imgs[i].dataset.src; 
    // remove the class, so Dailymotion's original js won't run on it
    imgs[i].className = null;
  }
}