您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
为谷歌翻译输入框中的内容自动删除换行!
// ==UserScript== // @name 谷歌翻译辅助 // @version 0.2 // @description 为谷歌翻译输入框中的内容自动删除换行! // @author hustcc // @match *://translate.google.com/* // @match *://translate.google.cn/* // @connect translate.google.com // @grant unsafeWindow // @namespace https://atool.vip/ // ==/UserScript== (function() { 'use strict'; if (window.location.host !== 'translate.google.com' && window.location.host !== 'translate.google.cn') return; // 满宽屏! const root = document.querySelector('body > div.frame > div.page.tlid-homepage.homepage.translate-text'); if (root) root.style.maxWidth = '96%'; let timer = 0; function loop() { const ele = document.getElementById('source'); if (ele) { const t = ele.value; if (t) { const r = t.replace(/\n/g, ' '); if (r !== t) { ele.value = r; } } } // timer clearTimeout(timer); timer = setTimeout(() => { loop(); }, 1000); } timer = setTimeout(() => { loop(); }, 1000); })();