GIF Blocker *OLD*

Disables animated avatars and replaces them with a default

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name          GIF Blocker *OLD*
// @description   Disables animated avatars and replaces them with a default
// @include       http://www.kongregate.com/*
// @version 0.0.1.20160401063918
// @namespace https://greasyfork.org/users/32649
// ==/UserScript==
function gtv(t) {
	var v = 0;
	t = t.toString().split("");
	for(var d = 0;d<t.length;d++) {
		v += t[d].charCodeAt();
	}
	return v;
}
var avs = document.getElementsByClassName ? document.getElementsByClassName("user_avatar") : document.images, defs = ["theclaw", "chicken", "duck", "beefairy", "lolcake", "slimyghost", "devilish", "bird", "general", "robotboy", "yummy", "snooze", "death", "headbot", "frog", "wrestleboy", "darkninja", "emo", "triggers", "robot", "lizardboy", "fluff", "bug"];
for(var i = 0;i<avs.length;i++)
if(/^http:\/\/cdn\d\.kongregate\.com\/user_avatars\/\d{4}\/\d{4}\/.+\.gif(\?.*)?$/i.test(avs[i].src))
avs[i].src = "http://cdn4.kongregate.com/assets/avatars/defaults/"+defs[gtv(avs[i].alt.split(" ")[2])%defs.length]+".jpg";