移除换行符
// ==UserScript==
// @name PDF复制翻译自动去掉换行符
// @namespace https://github.com/Wijipedia
// @version 1.0
// @description 移除换行符
// @author Wijipedia
// @match https://www.deepl.com/*
// @grant none
// ==/UserScript==
function new_version(){
var url = window.location.href
if(url.includes("deepl.com")){
var a = document.querySelector("#textareasContainer > div > section > div > div > d-textarea > div");
}
a.addEventListener("paste",function(event){
let paste = (event.clipboardData || window.clipboardData).getData('text');
paste = paste.replaceAll("\n"," ")
paste = paste.replaceAll("\r"," ")
document.execCommand("insertText",false,paste)
event.preventDefault();
})
}
(function() {
'use strict';
new_version();
})();