clean-search-extension

Auto-clean popular search engine URLs for a faster, cleaner experience. | made by conflicted

  1. // ==UserScript==
  2. // @name clean-search-extension
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.1
  5. // @description Auto-clean popular search engine URLs for a faster, cleaner experience. | made by conflicted
  6. // @author conflicted @kittenware on discord
  7. // @match *://www.google.com/search*
  8. // @match *://www.google.*.*/search*
  9. // @match *://search.yahoo.com/search*
  10. // @match *://*.search.yahoo.com/search*
  11. // @match *://www.bing.com/search*
  12. // @match *://duckduckgo.com/*
  13. // @match *://yandex.com/search/*
  14. // @match *://yandex.ru/search/*
  15. // @grant none
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20.  
  21. const url = new URL(window.location.href);
  22.  
  23. let cleaned = false; // Flag to detect if cleaning happened
  24.  
  25. // GOOGLE
  26. if (url.hostname.includes('google.')) {
  27. if (url.searchParams.get('udm') !== '14') {
  28. url.searchParams.set('udm', '14');
  29. window.location.replace(url.toString());
  30. }
  31. }
  32.  
  33. // YAHOO
  34. else if (url.hostname.includes('yahoo.com')) {
  35. const p = url.searchParams.get('p');
  36. if (p) {
  37. const cleanUrl = `${url.origin}${url.pathname}?p=${encodeURIComponent(p)}`;
  38. if (window.location.href !== cleanUrl) {
  39. window.location.replace(cleanUrl);
  40. }
  41. }
  42. }
  43.  
  44. // BING
  45. else if (url.hostname.includes('bing.com')) {
  46. const q = url.searchParams.get('q');
  47. if (q) {
  48. const cleanUrl = `${url.origin}${url.pathname}?q=${encodeURIComponent(q)}`;
  49. if (window.location.href !== cleanUrl) {
  50. window.location.replace(cleanUrl);
  51. }
  52. }
  53. }
  54.  
  55. // DUCKDUCKGO
  56. else if (url.hostname.includes('duckduckgo.com')) {
  57. const q = url.searchParams.get('q');
  58. if (q) {
  59. const cleanUrl = `${url.origin}${url.pathname}?q=${encodeURIComponent(q)}`;
  60. if (window.location.href !== cleanUrl) {
  61. window.location.replace(cleanUrl);
  62. }
  63. }
  64. }
  65.  
  66. // YANDEX
  67. else if (url.hostname.includes('yandex.com') || url.hostname.includes('yandex.ru')) {
  68. const text = url.searchParams.get('text');
  69. if (text) {
  70. const cleanUrl = `${url.origin}${url.pathname}?text=${encodeURIComponent(text)}`;
  71. if (window.location.href !== cleanUrl) {
  72. window.location.replace(cleanUrl);
  73. }
  74. }
  75. }
  76.  
  77. // AFTER THE PAGE LOADS
  78. window.addEventListener('load', () => {
  79. showPopup();
  80. });
  81.  
  82. // Little Popup
  83. function showPopup() {
  84. const popup = document.createElement('div');
  85. popup.innerText = 'Results Cleaned by Conflicted @kittenware';
  86. popup.style.position = 'fixed';
  87. popup.style.top = '20px';
  88. popup.style.right = '20px';
  89. popup.style.backgroundColor = '#222';
  90. popup.style.color = '#fff';
  91. popup.style.padding = '10px 15px';
  92. popup.style.borderRadius = '10px';
  93. popup.style.boxShadow = '0px 0px 10px rgba(0,0,0,0.5)';
  94. popup.style.zIndex = '99999';
  95. popup.style.fontFamily = 'Arial, sans-serif';
  96. popup.style.fontSize = '14px';
  97. popup.style.opacity = '0.9';
  98. document.body.appendChild(popup);
  99.  
  100. setTimeout(() => {
  101. popup.remove();
  102. }, 2000); // Remove popup after 2 seconds
  103. }
  104. })();

QingJ © 2025

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