Google Optimization

Google Search Page Optimization

// ==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://gf.qytechs.cn/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);
}

QingJ © 2025

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