NGA ++

NGA 显示所有头像,屏蔽广告

Tính đến 19-06-2019. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         NGA ++
// @namespace    shfeat
// @author       shfeat
// @version      0.1
// @description  NGA 显示所有头像,屏蔽广告
// @include      http*://bbs.nga.cn/*
// @include      http*://nga.178.com/*
// @include      http*://ngabbs.com/*
// @grant        GM_xmlhttpRequest
// @grant        GM_getResourceText
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_download
// @grant        GM_addStyle
// @require      http://libs.baidu.com/jquery/2.1.3/jquery.min.js
// @homepageURL  https://greasyfork.org/zh-CN/scripts/386552-nga
// @run-at       document-end
// ==/UserScript==

(function() {
	$(document).ready(function() {
        if(/adpage_insert/.test(window.location.href))
            getJump();
        $("#m_posts_c > table.postbox").each(function(i, el){
            var uid = $(el).find("a[name=uid]").text();
            if(uid && commonui.userInfo.users[uid].avatar) {
                var avatar_type = typeof(commonui.userInfo.users[uid].avatar);
                //console.log(avatar_type);
                if(avatar_type == 'object') {
                    for(i in commonui.userInfo.users[uid].avatar) {
                        if(/^http/.test(commonui.userInfo.users[uid].avatar[i])) {
                            if(!$(el).find('span.posterinfo > img[src="'+commonui.userInfo.users[uid].avatar[i]+'"]').length > 0) {
                                $(el).find("a[name=uid]").parent().after('<img src="'+commonui.userInfo.users[uid].avatar[i]+'" style="max-width:180px;max-height:255px" class="avatar">');
                            }
                        }
                    }
                } else if(avatar_type == 'string') {
                    if(!$(el).find('span.posterinfo > img[src="'+commonui.userInfo.users[uid].avatar+'"]').length > 0) {
                        $(el).find("a[name=uid]").parent().after('<img src="'+commonui.userInfo.users[uid].avatar+'" style="max-width:180px;max-height:255px" class="avatar">');
                    }
                }
            }
        });
        //__COOKIE.setMiscCookieInSecond('pv_count_for_insad', 0);
    });
})();