HostLoc Block

hostloc block list

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         HostLoc Block
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  hostloc block list
// @author       Golang
// @include      /https://www.hostloc.com/forum/
// @include      /https://www.hostloc.com/thread/
// @require      https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    let bl = localStorage.getItem('BlockList')

    if (location.href.indexOf('forum') > -1) {
        $("tbody[id^='normalthread']").each((i, e) => {
            let a = $(e).find('cite > a').first()
            let href = a.attr('href')
            let uid = href.match(/\d+/)[0]
            if (bl != null && bl.indexOf(uid) > -1) {
                $(e).remove()
            }
        })
    }

    if (location.href.indexOf('thread') > -1) {
        let bl = localStorage.getItem('BlockList')

        $('.authi > .xw1').each((i, e) => {
            let b = $('<a class="xi1" href="javascript:void(0);" style="float:right;margin-right:10px;">block</a>')
            $(e).after(b)
            let href = $(e).attr("href")
            let uid = href.match(/\d+/)[0]

            if (bl != null && bl.indexOf(uid) > -1) {
                $(e).parentsUntil("#postlist").last().remove()
            } else {
                b.click(() => {
                    let bl = localStorage.getItem('BlockList')
                    bl = bl ? `${list}|${uid}` : `${Date.now()}|${uid}`
                    localStorage.setItem('BlockList', bl)
                    location.reload()
                })
            }
        })
    }
})();