谷歌在线翻译替换%0A为%20

try to take over the world!

目前為 2018-06-26 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 谷歌在线翻译替换%0A为%20
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description try to take over the world!
  6. // @include https://translate.google.*/*
  7. // @include http://fanyi.baidu.com/*
  8. // @author wxj
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12.  
  13.  
  14. //window.alert(input);
  15. var preinput="";
  16. window.setInterval(comp,2000);
  17. function comp(){
  18. var input=window.location.href;
  19. if(preinput!==input){ //说明改变了输入
  20. preinput=input;
  21. rep(input);
  22. }
  23. else{
  24. }
  25. }
  26. //替换函数
  27. function rep(input){
  28. if(input.indexOf("%0A")!=-1||input.indexOf("Fig.%20")!=-1){ //含有%0A
  29. var newinput=input.replace(/\%0A/g,"\%20");
  30. var newinput1=newinput.replace(/Fig\.\%20/g,"Fig\.");
  31. //var newiput1=newinput.replace(/Fig\.\%20/g,"Fig\.");
  32. //window.alert(newinput);
  33. location.href= newinput1;
  34. //alert("包含");
  35. }
  36. else{
  37. //alert("不包含");
  38. }
  39. }
  40.  

QingJ © 2025

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