Bitsoup Stop Whining

Removes begspam from Bitsoup

目前為 2015-09-01 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Bitsoup Stop Whining
// @namespace    http://takebackbitsoup.com
// @version      1.0
// @description    Removes begspam from Bitsoup
// @include        http://www.bitsoup.me/*
// @include        https://www.bitsoup.me/*
// @run-at         document-end
// @author       bitskewer
// @match        http://www.bitsoup.me/*
// @match        https://www.bitsoup.me/*
// @locale         en
// @require       http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js

// ==/UserScript==

window.addEventListener("load", function(e) {
  addButton();
}, false);
 
function addButton(){
    $("#restoreButton").html('<input id="restoreButton" type="button" value="Begging message removed - Click here to view it" />');
    $("#restoreButton").bind('click', doRestore);
}
 
function doRestore() {
    var spam = $(".main > span:nth-child(2)");
    if (spam) {
        spam.show();
        $("#restoreButton").hide();
    }
}


var dismiss = function() {
    var link = $("a[href*='announcement.php']");
    if (link && link.attr("href")) {
        // jquery doesn't seem to do position absolute so use DOM directly
        var iframe = document.createElement('iframe');
        iframe.style.width = '1px';
        iframe.style.height = '1px';
        iframe.style.position = 'absolute';
        iframe.style.top = '10px';
        iframe.style.left = '10px';
        iframe.src = link.attr("href");
        document.body.appendChild(iframe);    
    }
};
    
var spam = $(".main > span:nth-child(2)");
if (spam) {
    spam.hide(1000);
    setTimeout(dismiss, 3000 + (Math.random() * 7000));

    var sp1 = document.createElement("button");
    sp1.id = "restoreButton";
    $( "<button id='restoreButton'></button>" ).insertAfter(spam);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址