DuckDuckGo - Add Google links with current query

Adds Google links with current query used at DuckDuckGo (for faster and more comfortable way to check alternative search results)

  1. // ==UserScript==
  2. // @name DuckDuckGo - Add Google links with current query
  3. // @namespace Violentmonkey Scripts
  4. // @description:en Adds Google links with current query used at DuckDuckGo (for faster and more comfortable way to check alternative search results)
  5. // @match https://duckduckgo.com/?*
  6. // @grant none
  7. // @run-at document-end
  8. // @version 0.96
  9. // @description Adds Google links with current query used at DuckDuckGo (for faster and more comfortable way to check alternative search results)
  10. // ==/UserScript==
  11.  
  12. setTimeout(function(){
  13. var query = '' + document.forms.x.q.value;
  14. //var ds = document.getElementById('duckbar_static');
  15. var ds = document.getElementById('react-duckbar').getElementsByTagName('nav')[0].lastChild;
  16. var link = document.createElement('a');
  17.  
  18. link.innerHTML = 'Google';
  19. link.href = 'https://www.google.com/search?q=' + encodeURIComponent(query);
  20. link.style.verticalAlign = 'top';
  21. link.style.fontWeight = "bold";
  22. //wdt.parentNode.parentNode.insertBefore(link, wdt.parentNode);
  23. var link2 = link.cloneNode();
  24. link2.innerHTML = 'Google';
  25. link2.style.position = 'fixed';
  26. link2.style.right = "110px";
  27. link2.style.bottom = "20px";
  28. link2.style.zIndex = "11";
  29. link2.style.fontSize = "xx-large";
  30.  
  31. ds.parentNode.appendChild(link);
  32. document.body.appendChild(link2);
  33.  
  34. function googleKey(e)
  35. {
  36. e = e || window.event;
  37. if(e.keyCode == '220' && !e.shiftKey)
  38. {
  39. document.location.href = link.href;
  40. }
  41. }
  42.  
  43. document.onkeydown = googleKey;
  44. }, 1000);

QingJ © 2025

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