Yahoo direct non-tracking search

Strips tracking and redirection from Yahoo search urls

  1. // ==UserScript==
  2. // @name Yahoo direct non-tracking search
  3. // @description Strips tracking and redirection from Yahoo search urls
  4. // @match *://*.yahoo.com/*
  5. // @match *://*.yahoo.co.jp/*
  6. // @match *://*.yahoo.cn/*
  7. // @include /https?:\/\/(\w+\.)*yahoo.(com|\w\w(\.\w\w)?)\/.*/
  8. // @version 1.1.4
  9. // @author wOxxOm
  10. // @namespace wOxxOm.scripts
  11. // @license MIT License
  12. // @run-at document-start
  13. // @require https://gf.qytechs.cn/scripts/12228/code/setMutationHandler.js?version=175122
  14. // ==/UserScript==
  15.  
  16. /* jshint lastsemic:true, multistr:true, laxbreak:true, -W030, -W041, -W084 */
  17.  
  18. setMutationHandler(document, 'form, a', function(nodes) {
  19. nodes.forEach(function(node) {
  20. switch (node.localName) {
  21. case 'form':
  22. if (node.action.indexOf('/search') > 0) {
  23. node.addEventListener('submit', function(e){
  24. e.preventDefault();
  25. stopPropagation(e);
  26. e.target.action = e.target.action.replace(/_yl[tu]=[\w;_=.-]+/, '');
  27. e.target.submit();
  28. });
  29. }
  30. break;
  31. case 'a':
  32. node.href = node.href.replace(/;?_yl[tu]=[\w;_=.-]+\/?/, '')
  33. .replace(/^.+?\/RU=(http[^\/]+)\/?.*$/, function(s, url) { return decodeURIComponent(url) });
  34. node.removeAttribute('onmousedown');
  35. node.removeAttribute('data-sb');
  36. break;
  37. }
  38. });
  39. return true;
  40. });
  41.  
  42. document.addEventListener('click', stopPropagation, true);
  43. document.addEventListener('mousedown', stopPropagation, true);
  44. window.addEventListener('click', stopPropagation, true);
  45. window.addEventListener('mousedown', stopPropagation, true);
  46.  
  47. function stopPropagation(e) {
  48. if (e.target.href) {
  49. e.stopPropagation();
  50. e.stopImmediatePropagation();
  51. }
  52. }

QingJ © 2025

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