您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
翻译去换行
当前为
// ==UserScript== // @name Translate Helper // @namespace http://tampermonkey.net/ // @version 2.0 // @description 翻译去换行 // @author o1hy // @match https://translate.google.com // @match https://translate.google.cn // @grant none // ==/UserScript== function injectText(){ var temp = document.createElement('input'); temp.type = 'text'; // temp.value = ''; temp.id = 'source_text'; temp.className = 'tlid-source-target main-header' temp.style = "border-bottom-width:0;height: 20px;padding-top: 0px;width: 50%; margin-top: 8px;" document.getElementsByClassName('tlid-result-view cllist')[0].append(temp); // document.body.append(temp); temp = document.createElement('button'); temp.textContent = 'Translate'; temp.id = 'my-trans' temp.className="tlid-input-button input-button header-button tlid-input-button-text" temp.style="padding-left: 16px; height: 24px;left: 10px;" document.getElementsByClassName('tlid-result-view cllist')[0].append(temp); // document.body.append(temp); temp = document.createElement('button'); temp.textContent = 'Clear'; temp.id = 'clear' temp.className="tlid-input-button input-button header-button tlid-input-button-text" temp.style="padding-left: 16px; height: 24px;left: 10px;" document.getElementsByClassName('tlid-result-view cllist')[0].append(temp); // document.body.append(temp); } function a2(){ document.getElementById('source_text').value = ''; } function a1(){ let message = document.getElementById('source_text') // console.log(message.value) let d = document.getElementById('source'); // console.log(d.value) d.value = message.value; } function new_version(){ var a = document.querySelector("body > c-wiz > div > div > c-wiz > div > c-wiz > div > div > div > c-wiz > span > span > div > textarea") a.addEventListener('input', function() { var txt = ""; txt = a.value; for (var i = 0; i < txt.length; i++) { if (txt.indexOf("\n")) txt = txt.replace("\n", " "); } a.value = txt; } ); } (function() { 'use strict'; //injectText(); //var button_clear = document.getElementById('clear'); //button_clear.onclick = a2; //var button_b = document.getElementById('my-trans'); // button_b.addEventListener('click',al); //button_b.onclick = a1; new_version(); // Your code here... })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址