您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Disable Google URL redirector (i.e. user data tracking) on Google Search result, including Google Custom Search Engine (CSE) which is used by many websites.
当前为
- // ==UserScript==
- // @name Disable Google Search Result URL Redirector
- // @namespace DisableGoogleSearchResultURLRedirector
- // @version 1.0.6
- // @license GNU AGPLv3
- // @description Disable Google URL redirector (i.e. user data tracking) on Google Search result, including Google Custom Search Engine (CSE) which is used by many websites.
- // @author jcunews
- // @include *://*/*
- // @grant unsafeWindow
- // @run-at document-start
- // ==/UserScript==
- (function(createElement_, appendChild_, insertBefore_) {
- //===== CONFIGURATION BEGIN =====
- var disableGoogleAdSense = true;
- //===== CONFIGURATION END =====
- function checkElement(ele, m, obj, fn) {
- if (ele.tagName === "SCRIPT") {
- if (disableGoogleAdSense && (/:\/\/cse\.google\.com\/adsense\/search\/(async-)?ads\.js/).test(ele.src)) {
- return false;
- } else if (m = ele.src.match(/:\/\/www.googleapis.com\/customsearch\/.*callback=([^?]+)/)) {
- obj = unsafeWindow;
- m[1].split(".").forEach(function(k, i, a) {
- if (i < (a.length - 1)) {
- obj = obj[k];
- } else {
- fn = obj[k];
- obj[k] = function(data) {
- data.results.forEach(function(res) {
- delete res.clicktrackUrl;
- });
- return fn.apply(this, arguments);
- };
- }
- });
- }
- }
- return true;
- }
- if ((/www\.google\.[a-z]+(\.[a-z]+)?/).test(location.hostname)) {
- //Google site
- var t = 0;
- function disableRwt() {
- unsafeWindow.rwt = function() { return true };
- unsafeWindow.rwt.hook = true;
- }
- (function waitRwt() {
- clearTimeout(t);
- if (unsafeWindow.rwt && !unsafeWindow.rwt.hook) {
- disableRwt();
- } else setTimeout(waitRwt, 20);
- })();
- addEventListener("load", function check() {
- clearTimeout(t);
- disableRwt();
- });
- } else {
- //other sites
- appendChild_ = Node.prototype.appendChild;
- Node.prototype.appendChild = function(ele) {
- if (checkElement(ele)) {
- return appendChild_.apply(this, arguments);
- } else return ele;
- };
- insertBefore_ = Node.prototype.insertBefore;
- Node.prototype.insertBefore = function(ele) {
- if (checkElement(ele)) {
- return insertBefore_.apply(this, arguments);
- } else return ele;
- };
- }
- })();