Boost CJK 输入法回车上屏英文内容却直接发送的解决方案

2026-04-11 10:400阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

从私聊聊天优化建议继续讨论:

直接消息回车问题 - #7,来自 Haleclipse

// ==UserScript== // @name Discourse Chat IME Guard // @namespace https://linux.do/ // @version 0.5 // @description Block IME Enter & fix IME char-count for chat / DM / Boost // @match https://linux.do/* // @match https://*.discourse.org/* // @run-at document-idle // @inject-into content // @grant none // ==/UserScript== (() => { "use strict"; const TEXTAREA_SELECTORS = [ "textarea.chat-composer__input", "textarea.chat-composer-input", "textarea.d-chat-message-editor", ].join(","); const DIV_SELECTORS = [ "div.discourse-boosts__input", ].join(","); const protectTextarea = (ta) => { if (ta.dataset.imeGuard) return; ta.dataset.imeGuard = "true"; let composing = false; ta.addEventListener("compositionstart", () => (composing = true), true); ta.addEventListener("compositionend",

阅读全文
标签:软件开发
问题描述:

从私聊聊天优化建议继续讨论:

直接消息回车问题 - #7,来自 Haleclipse

// ==UserScript== // @name Discourse Chat IME Guard // @namespace https://linux.do/ // @version 0.5 // @description Block IME Enter & fix IME char-count for chat / DM / Boost // @match https://linux.do/* // @match https://*.discourse.org/* // @run-at document-idle // @inject-into content // @grant none // ==/UserScript== (() => { "use strict"; const TEXTAREA_SELECTORS = [ "textarea.chat-composer__input", "textarea.chat-composer-input", "textarea.d-chat-message-editor", ].join(","); const DIV_SELECTORS = [ "div.discourse-boosts__input", ].join(","); const protectTextarea = (ta) => { if (ta.dataset.imeGuard) return; ta.dataset.imeGuard = "true"; let composing = false; ta.addEventListener("compositionstart", () => (composing = true), true); ta.addEventListener("compositionend",

阅读全文
标签:软件开发