Greasy Fork 还支持 简体中文。

Yahoo direct non-tracking search

Strips tracking and redirection from Yahoo search urls

As of 25. 03. 2015. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name          Yahoo direct non-tracking search
// @description   Strips tracking and redirection from Yahoo search urls
// @include       https://*yahoo.com/*
// @version       1.0.1
// @author        wOxxOm
// @namespace     wOxxOm.scripts
// @license       MIT License
// @grant         none
// @run-at        document-start
// ==/UserScript==

setMutationHandler(document, '.search-assist-form-wrapper form, a', function(observer, nodes) {
  Array.prototype.forEach.call(nodes, function(node) {
    switch (node.localName) {
      case 'form':
        if (e.target.action.indexOf('/search') > 0 {
            node.addEventListener('submit', function(e){
              e.preventDefault();
              e.stopPropagation();
              e.target.action = e.target.action.replace(/?_yl[tu]=[\w;_=.-]+/, '');
              e.target.submit();
            });
        }
        break;
      case 'a':
        node.href = node.href.replace(/;?_yl[tu]=[\w;_=.-]+\/?/, '')
                             .replace(/^.+?\/RU=(http[^\/]+)\/?.*$/, function(s, url) { return decodeURIComponent(url) });
        break;
    }
  });
  return true;
});

function setMutationHandler(baseNode, selector, cb) {
  var ob = new MutationObserver(function(mutations){
    for (var i=0, ml=mutations.length, m; (i<ml) && (m=mutations[i]); i++)
      for (var j=0, nodes=m.addedNodes, nl=nodes.length, n; (j<nl) && (n=nodes[j]); j++)
        if (n.nodeType == 1) 
          if ((n = n.matches(selector) ? [n] : n.querySelectorAll(selector)) && n.length)
            if (!cb(ob, n))
              return;
  });
  ob.observe(baseNode, {subtree:true, childList:true}); 
}