Google Translate Remove Line break

Remove Line break

  1. // ==UserScript==
  2. // @name Google Translate Remove Line break
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Remove Line break
  6. // @author miniJoy
  7. // @match https://translate.google.cn/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // 粘贴的时候移除换行符
  15. var input = document.querySelector("#source")
  16. input.addEventListener('paste', (event) => {
  17. event.preventDefault();
  18. input.value = (event.clipboardData || window.clipboardData).getData('text');
  19. input.value = input.value.replace(/\n/g,"");
  20. });
  21. })();

QingJ © 2025

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