V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
shellex
V2EX  ›  分享创造

UserScripts - 干掉V2EX上所有使用默认头像的用户的发言

  •  
  •   shellex ·
    shellex · 2012-11-30 16:39:22 +08:00 · 8350 次点击
    这是一个创建于 4136 天前的主题,其中的信息可能已经有所发展或是发生改变。
    原因很明显

    地址在此
    https://gist.github.com/4174530

    代码在此


    下载或者复制粘贴到空文件,文件名为novice_killer.user.js

    下载解压后,把其中的js文件拖拽到chrome的扩展管理介面 chrome://chrome/extensions/

    即可
    66 条回复    1970-01-01 08:00:00 +08:00
    romoo
        1
    romoo  
       2012-11-30 16:41:22 +08:00
    我要不要 fork 出来一个 Chrome extension 版呢。
    shellex
        2
    shellex  
    OP
       2012-11-30 16:42:46 +08:00
    @romoo 我太懒了。懒得做project。你来吧。
    chloerei
        3
    chloerei  
       2012-11-30 16:49:33 +08:00   ❤️ 1
    哈哈哈
    cranej
        4
    cranej  
       2012-11-30 17:09:47 +08:00
    世界清净多了,thx
    iwinux
        5
    iwinux  
       2012-11-30 17:14:29 +08:00
    第一次看活的 user script 代码……话说可以用 jQuery 的么 = =
    shellex
        6
    shellex  
    OP
       2012-11-30 17:23:07 +08:00   ❤️ 1
    @iwinux 在Chrome中得手工加载,Firefox下可以直接require。于是你看刚开始那行乱七八糟的代码就是加载用的。
    chrisyipw
        7
    chrisyipw  
       2012-11-30 17:42:35 +08:00
    @iwinux 给 Firefox、Chrome 用的话,没必要用 jQuery 吧……
    Sukizen
        8
    Sukizen  
       2012-11-30 17:48:17 +08:00
    看来我这类的人被隔离了。。。。。。我可不想随便上传一个图片代表自己。
    iwinux
        9
    iwinux  
       2012-11-30 18:11:17 +08:00
    谢谢壳酱的启发,我之前还一直以为搞这种定制很麻烦的,看来可以干很多坏事了 ><
    DeepBlue
        10
    DeepBlue  
       2012-11-30 18:22:07 +08:00
    看来以我的智商还是不能理解这样很明显的原因。要不请 @Livid 设定一下不修改头像不许发言?
    cpylua
        11
    cpylua  
       2012-11-30 18:29:14 +08:00
    不解。。。这是个人自由
    andy12530
        12
    andy12530  
       2012-11-30 18:29:42 +08:00
    额,代码不是异步加载了v2ex上的jQuery了么,那为啥还有用原生的事件处理addEventLiistener以及节点操作函数,不觉得麻烦么?
    cst4you
        13
    cst4you  
       2012-11-30 18:43:02 +08:00
    无故中枪
    freeznet
        14
    freeznet  
       2012-11-30 18:45:18 +08:00
    我是觉得默认头像挺好看所以才用的= =中枪倒地不起
    mytharcher
        15
    mytharcher  
       2012-11-30 19:13:54 +08:00
    呵呵
    kendisk
        16
    kendisk  
       2012-11-30 19:17:09 +08:00
    Google Chrome Version 25.0.1323.1

    这个版本怎么没干掉?
    gratuit
        17
    gratuit  
       2012-11-30 19:23:39 +08:00
    上传次默认头像就复活了
    PrideChung
        18
    PrideChung  
       2012-11-30 19:28:34 +08:00   ❤️ 1
    我擦,用默认头像没人权?我不就懒得上传么
    fanzeyi
        19
    fanzeyi  
       2012-11-30 19:49:03 +08:00
    只能屏蔽主题啊,不能屏蔽回复啊……
    timonwong
        20
    timonwong  
       2012-11-30 20:40:30 +08:00   ❤️ 1
    @fanzeyi
    加上

    // @include http://www.v2ex.com/t/*
    // @include http://v2ex.com/t/*

    这些即可,如果你用 fast.v2ex.comus.v2ex.com 还要多加几个include规则。


    另外fork了个,不再加载一份jQuery:

    http://gist.github.com/4175517
    sharpnk
        21
    sharpnk  
       2012-11-30 20:55:34 +08:00   ❤️ 7
    年轻的我会下载默认头像然后更改文件名再上传. 现在的我只是默默地屏蔽楼主..... 青春小鸟一去不复返啊....
    shellex
        22
    shellex  
    OP
       2012-11-30 20:57:11 +08:00   ❤️ 1
    @timonwong 原来可以用 unsafeWindow
    iqav
        23
    iqav  
       2012-11-30 20:58:13 +08:00
    其实,要不然弄个识别人头的,不是人头的再咔嚓,多好啊。
    timonwong
        24
    timonwong  
       2012-11-30 21:18:16 +08:00   ❤️ 1
    @shellex
    也不是很全,unsafeWindow在Chrome下不能访问js对象,TamperMonkey可以。绕过方法也有,Tricky:

    window.unsafeWindow || (
    unsafeWindow = (function() {
    var el = document.createElement('p');
    el.setAttribute('onclick', 'return window;');
    return el.onclick();
    }())
    );
    shellex
        25
    shellex  
    OP
       2012-11-30 21:19:35 +08:00
    @timonwong 嗯嗯,感谢感谢
    pengjiayou
        26
    pengjiayou  
       2012-11-30 21:34:21 +08:00
    @freeznet 哈哈,将这个默认图片保存,改名,然后再上传上去用作头像应该就可以了。

    这个插件是根据路径来判断的,木有图像识别功能,到底不怕,死不了,哈哈
    shellex
        27
    shellex  
    OP
       2012-11-30 21:41:05 +08:00
    @timonwong 测试了一下,unsafeWindow得不到jQuery对象呢。
    shellex
        28
    shellex  
    OP
       2012-11-30 21:42:48 +08:00
    @timonwong 嗯,使用这个tricky可以了。
    haxe
        29
    haxe  
       2012-11-30 22:19:20 +08:00
    多大仇
    best1a
        30
    best1a  
       2012-11-30 22:23:11 +08:00
    - -等下有人小改一下,变成专门屏蔽楼主的的script就好玩了。。
    siw
        31
    siw  
       2012-11-30 22:40:40 +08:00
    var dA = $('#Main a[href$="/member/........"] ');

    haha...
    quora
        32
    quora  
       2012-11-30 22:51:13 +08:00
    我承认我是马甲。
    hewigovens
        33
    hewigovens  
       2012-11-30 22:55:18 +08:00
    Chrome可以装Tampermonkey,管理在线的user scripts还不错
    cutehalo
        34
    cutehalo  
       2012-11-30 23:00:11 +08:00
    $('img.avatar').attr('src','http://cdn.v2ex.com/static/img/avatar_normal.png');
    这样最好了XD
    muzuiget
        35
    muzuiget  
       2012-11-30 23:02:01 +08:00
    @shellex Greasemonkey 1.0 后如果没有使用 GM_XXX 之类的扩展函数,默认就是 content scope 了,不是运行在沙盒里了,所以 Firefox 就这么一行就搞定了。

    <pre>$('#Main img[src$="v2ex.com/static/img/avatar_large.png"],#Main img[src$="v2ex.com/static/img/avatar_normal.png"]').parents('.cell').remove();</pre>

    就不知道其它浏览器的兼容扩展有没有跟进。
    muzuiget
        36
    muzuiget  
       2012-11-30 23:02:39 +08:00
    我擦,v2ex 到底用啥格式的。
    jedicxl
        37
    jedicxl  
       2012-11-30 23:10:34 +08:00
    表示理解不能
    chloerei
        38
    chloerei  
       2012-11-30 23:39:00 +08:00
    // @include http://www.v2ex.com/t/*
    这行没加?

    还有最后一楼是 .inner
    chloerei
        39
    chloerei  
       2012-11-30 23:42:58 +08:00
    哎呀真清爽,以前就是懒啊。
    caomu
        40
    caomu  
       2012-11-30 23:55:45 +08:00
    @muzuiget v2ex没有任何格式化文本的功能,要贴代码只能放gist,然后直接贴gist的不带https而是用http的地址。
    Mutoo
        41
    Mutoo  
       2012-12-01 00:17:03 +08:00
    要不要提供一个放在站外的默认头像图片……
    Mutoo
        42
    Mutoo  
       2012-12-01 00:17:45 +08:00
    @Mutoo 我傻了,直接下载来再上传就行了……
    inroading
        43
    inroading  
       2012-12-01 07:50:33 +08:00
    每天都逛的中枪,话说默认也挺好的
    linuz
        44
    linuz  
       2012-12-01 10:20:00 +08:00
    "年轻的我会下载默认头像然后更改文件名再上传. 现在的我只是默默地屏蔽楼主....." +1
    archeryan
        45
    archeryan  
       2012-12-01 10:28:11 +08:00
    意义不明……
    zckevin
        46
    zckevin  
       2012-12-01 11:29:35 +08:00   ❤️ 2
    怎么干掉这楼主这样的优越逼呢?
    shuidi
        47
    shuidi  
       2012-12-01 12:42:31 +08:00
    潜水也中枪
    SAGAN
        48
    SAGAN  
       2012-12-01 13:06:15 +08:00
    中枪+1. 对LZ无话可说.
    zhangsanren
        49
    zhangsanren  
       2012-12-01 14:36:01 +08:00
    楼主太狠了,要干掉所以没有头像的用户的发言...
    dripple
        50
    dripple  
       2012-12-03 08:46:10 +08:00
    让我想到了一篇文章 《一场引号惹来的风波:知乎团队如何华丽自残?》
    kamal
        51
    kamal  
       2012-12-03 09:21:32 +08:00
    把默认头像重新上传一遍不就行了
    neildd
        52
    neildd  
       2012-12-03 09:24:40 +08:00
    没头像被无视咯
    ryanliketea
        53
    ryanliketea  
       2012-12-03 12:53:30 +08:00
    哈哈,相信楼主看不到我的发言了~~
    dorentus
        54
    dorentus  
       2012-12-03 13:04:25 +08:00
    https://gist.github.com/4192703
    fork 了一个彻底没 jQuery 的版本……

    @neildd 你的这个头像不错,哈哈
    rorvn
        55
    rorvn  
       2012-12-07 04:26:48 +08:00
    楼主是个troll
    认真你们就输了
    marguerite
        56
    marguerite  
       2012-12-07 05:32:02 +08:00
    壳酱第一帖送你了。谢谢噢,b 掉这个帖子的蛋头能成功规避大部分活跃的刺头。
    shellex
        57
    shellex  
    OP
       2012-12-07 16:45:35 +08:00
    @marguerite 谢谢苏姐
    too
        58
    too  
       2012-12-07 17:21:27 +08:00
    多谢楼主,多谢协助测试的马甲们,有几个用默认头像上传做头像的干扰了测试哈。
    zimo
        59
    zimo  
       2012-12-07 17:25:56 +08:00
    冒个泡好了
    meteor
        60
    meteor  
       2012-12-07 17:39:02 +08:00
    我把它发布到了userscripts上面.
    http://userscripts.org/scripts/show/153611
    meteor
        61
    meteor  
       2012-12-12 23:34:55 +08:00
    这个脚本现在好像失效了?
    头像的地址现在好像改成了
    http://cdn.v2ex.com/avatar/a364/70cf/12182_normal.png

    http://cdn.v2ex.com/avatar/a364/70cf/12182_large.png
    fanzeyi
        62
    fanzeyi  
       2012-12-12 23:37:27 +08:00
    @meteor 这是他们自己下载了默认头像再上传的…… 遇到这样的人手工 Block 掉
    meteor
        63
    meteor  
       2012-12-12 23:49:03 +08:00
    @fanzeyi 好像得加这句。
    不然好像有些页面没启动。
    // @include http://www.v2ex.com/t/*
    meteor
        64
    meteor  
       2012-12-12 23:52:17 +08:00
    013231
        65
    013231  
       2012-12-13 00:40:56 +08:00
    @meteor
    @fanzeyi
    我的頭像可不是默認頭像.
    meteor
        66
    meteor  
       2012-12-18 22:20:37 +08:00
    V2ex好像升级了页面结构了。
    现在的默认头像去不掉了。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3162 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 00:37 · PVG 08:37 · LAX 17:37 · JFK 20:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.