Greasy Fork 还支持 简体中文。

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)

目前為 2018-05-17 提交的版本,檢視 最新版本

  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.95
  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 link = document.createElement('a');
  16.  
  17. link.innerHTML = 'Google';
  18. link.href = 'https://www.google.com/search?q=' + encodeURIComponent(query);
  19. link.style.verticalAlign = 'top';
  20. link.style.fontWeight = "bold";
  21. //wdt.parentNode.parentNode.insertBefore(link, wdt.parentNode);
  22. var link2 = link.cloneNode();
  23. link2.innerHTML = 'Google';
  24. link2.style.position = 'fixed';
  25. link2.style.right = "110px";
  26. link2.style.bottom = "20px";
  27. link2.style.zIndex = "11";
  28. link2.style.fontSize = "xx-large";
  29.  
  30. ds.parentNode.appendChild(link);
  31. document.body.appendChild(link2);
  32.  
  33. function googleKey(e)
  34. {
  35. e = e || window.event;
  36. if(e.keyCode == '220' && !e.shiftKey)
  37. {
  38. document.location.href = link.href;
  39. }
  40. }
  41.  
  42. document.onkeydown = googleKey;
  43. }, 1000);