您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A script which removes the google plus +1 sign
当前为
- // ==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;
- });
- }