Skip to content

Instantly share code, notes, and snippets.

@dorentus
Forked from lyricat/novice_killer.user.js
Created December 3, 2012 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dorentus/4192703 to your computer and use it in GitHub Desktop.
Save dorentus/4192703 to your computer and use it in GitHub Desktop.
干掉V2EX上所有使用默认头像用户的发言(去jQuery版)
// ==UserScript==
// @name v2ex novice killer
// @namespace http://shellex.info
// @author shellex(5h3ll3x@gmail.com)
// @description 干掉使用默认头像的人的发言
// @include http://www.v2ex.com/go/*
// @include http://v2ex.com/go/*
// @include http://www.v2ex.com/?tab=*
// @include http://v2ex.com/?tab=*
// @include http://www.v2ex.com/
// @include http://v2ex.com/
// @version 0.2
// @grant none
// ==/UserScript==\
(function(docEl) {
var sel = '#Main img[src$="v2ex.com/static/img/avatar_large.png"], #Main img[src$="v2ex.com/static/img/avatar_normal.png"]';
var matches = docEl.matchesSelector
|| docEl.mozMatchesSelector
|| docEl.webkitMatchesSelector
|| docEl.oMatchesSelector
|| docEl.msMatchesSelector;
Array.prototype.slice.call(document.querySelectorAll(sel)).forEach(function (item) {
var element = item;
while (element.parentNode) {
element = element.parentNode;
if (matches.call(element, '.cell, .inner:last-child')) {
element.parentNode.removeChild(element);
break;
}
}
});
})(document.documentElement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment