- 在Chrome商店下载Tampermonkey插件
- 在Chrome右上角找到Tampermonkey,点击“添加新脚本”
- 将UserScript中的@match后的网址该为https://translate.google.cn/
- 在function中写入自己的代码
var textArea = document.getElementById('source')
textArea.addEventListener('input',function(){
var reg = new RegExp('\n','g')
this.value = this.value.replace(reg,' ')
})
window.onload = function(){
textArea.value = ''
}
- 保存脚本,并启用Tampermonkey和脚本。
- 如果页面没反应刷新一下。