Google Optimization

Google Search Page Optimization

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Google Optimization
// @namespace   0x123.com
// @author      Elf Sundae
// @description Google Search Page Optimization
// @copyright   www.0x123.com
// @icon        http://img-cdn.0x321.com/stuff/googleg_lodp.png
// @encoding    utf-8
// @run-at      document-end
// @include     /^https?://www\.google\.com
// @date        28/07/2014
// @modified    19/07/2016
// @version     1.0.2
// ==/UserScript==

/**
 * https://greasyfork.org/scripts/20228-google-optimization
 */

if (document.URL.match(/[\?#&]q=/g)) {
  remove_url_tracker();
}

function remove_url_tracker() {
  window.RemoveURLTrackerTimer = setInterval(function() {
    var iresDiv = document.getElementById('ires');
    if (!iresDiv) {
      return;
    }

    clearInterval(window.RemoveURLTrackerTimer);
    var links = iresDiv.getElementsByTagName('a');
    Array.prototype.slice.call(links).forEach(function(a) {
      a.removeAttribute("onmousedown");
      var url = a.getAttribute('data-href');
      if (url) {
        a.setAttribute('href', url);
      }
    });

    var resultStats = document.getElementById('resultStats');
    resultStats.innerHTML += "<nobr>&nbsp;<i>Removed URL tracker.</i>&nbsp;</nobr>";

  }, 100);
}