Who the Fuck uses GOOGLE+?

A script which removes the google plus +1 sign

目前為 2016-05-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name        Who the Fuck uses GOOGLE+?
// @namespace   MegaByteWTFUG
// @description A script which removes the google plus +1 sign
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @run-at      document-idle
// @include     *
// @version     0.2
// @grant       none
// ==/UserScript==


    if(!('contains' in String.prototype)) {
       	String.prototype.contains = function(str, startIndex) {
            return -1 !== String.prototype.indexOf.call(this, str, startIndex);
       	};
 	}
 	if (!Array.prototype.forEach) {
        Array.prototype.forEach = function(callback, thisArg) {
            var T, k;
            if (this == null) throw new TypeError(' this is null or not defined');
            var O = Object(this);
            var len = O.length >>> 0;
            if (typeof callback !== "function") throw new TypeError(callback + ' is not a function');
            if (arguments.length > 1) T = thisArg;
            k = 0;
            while (k < len) {
                var kValue;
                if (k in O) {
                    kValue = O[k];
                    callback.call(T, kValue, k, O);
                }
                k++;
            }
        };
    }

    this.$ = this.jQuery = jQuery.noConflict(true);
    
    var attr = ["class", "id", "title", "tooltip"];
    var filter = ["googleplus", "google_plus", "gplus", "g_plus", "google+"];
    
    attr.forEach(function(i) {
        filter.forEach(function(j) {
            $("["+attr[i]+"*="+filter[j]+"]").remove();
        });
    });
    
    
    var site = window.location.href || document.URL;
    if(site.contains("plus.google.com")) {
        var content = $("body > *");
        content.remove();
        $("body").append("                                                      \
           <center style='margin-top: 25px;'>              \
              <h1 style='margin-bottom: 10px;'>Are you sure you want to be here?</h1>                        \
              <input type='button' value='Take me Away!' class='_away' />       \
              <input type='button' value='Show site!' class='_show' />          \
           </center>                                                            \
        ");
        $("._show").click(function() {
           $("body > *").remove();
            $("body").append(content);
        });
        $("._away").click(function() {
           window.location.href = document.referrer;
        });
    }

QingJ © 2025

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