translation replace character

first press F5

  1. // ==UserScript==
  2. // @name translation replace character
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description first press F5
  6. // @author XMAN
  7. // @match https://fanyi.baidu.com/*
  8. // @match http://fanyi.youdao.com/
  9. // @match https://translate.google.cn/*
  10. // @match https://translate.google.com/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. var txt = "";
  16. var id = "";
  17. var host = window.location.host;
  18. if( host == "fanyi.baidu.com" )
  19. {
  20. id = "baidu_translate_input";
  21. }
  22. if( host == "fanyi.youdao.com" )
  23. {
  24. id = "inputOriginal";
  25. }
  26. if( host == "translate.google.cn" || host == "translate.google.com" )
  27. {
  28. id = "source";
  29. }
  30.  
  31. txt = document.getElementById(id).value;
  32. for (var i=0;i<txt.length;i++)
  33. {
  34. if(txt.indexOf("\n"))txt = txt.replace("\n"," ");
  35. }
  36. document.getElementById(id).value = txt;
  37.  
  38. })();
  39.  
  40. setTimeout("self.location.reload();",15000);//15s
  41.  

QingJ © 2025

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