不知道找了多少禁止 google 搜索跳转的方法了,都不靠谱,要么就导致功能不全了,今天终于找到一个终极的解决方案,记录下。

stackoverflow Turning off Google search results indirection

油猴脚本如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// ==UserScript==
// @name Don't track me Google
// @namespace Rob W
// @version 2.0
// @match https://encrypted.google.com/*
// @match http://www.google.com/*
// @match https://www.google.com/*
// @match http://www.google.com.hk/*
// @match https://www.google.com.hk/*
// @match http://www.google.*/*
// @match https://www.google.*/*

// @match https://www.google.cat/*
// ==/UserScript==

// http://webapps.stackexchange.com/questions/22291/turning-off-google-search-results-indirection
// Injection through `javascript:...` because there's no other way to modify a window variable in Chrome
// http://code.google.com/chrome/extensions/content_scripts.html#execution-environment
location.href = "javascript:void(function(){" +
" Object.defineProperty(window, 'rwt', { " +
" value: function(a) { return a; }, " +
" writable: false, " +
" configurable: false, " +
" enumerable: false " +
" }); " +
"})(); ";