Twitcasting Ctrl+Enter

It enable to send comment with ctrl + enter

< Feedback on Twitcasting Ctrl+Enter

مراجعة: Bad - script does not work

§
Posted: 22-04-2023
Edited: 22-04-2023

(function() {
'use strict';
const area = document.getElementsByClassName('tw-textarea')[0];
const button = document.querySelectorAll('.tw-comment-post-operations .tw-button-primary')[0];
if(!area || !button) return;
const send = () => {
button.click();
}
const handleEvent = (e) => {
if(e.code=='Enter' && e.ctrlKey && area.value!==''){
send();
}
}
document.addEventListener("keydown",handleEvent);
})();

別のボタンをクリックしてしまっていたので、こちらが正しいようです。

Post reply

تسجيل الدخول إلى مرحلة ما بعد الرد.