Twicas Keyboard Shortcut

ツイキャスにキーボードショートカットを追加します

  1. // ==UserScript==
  2. // @name Twicas Keyboard Shortcut
  3. // @namespace me.nzws.us.twicas_keyboard_shortcut
  4. // @version 1.0.1
  5. // @description ツイキャスにキーボードショートカットを追加します
  6. // @author nzws
  7. // @match https://twitcasting.tv/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. const $ = q => document.querySelector(q);
  12.  
  13. (function() {
  14. // 配信ページ: Ctrl (または command) + Enterでコメントを投稿
  15. const commentTextArea = $('.tw-comment-post .tw-textarea');
  16. if (commentTextArea) {
  17. commentTextArea.onkeyup = e => {
  18. if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) {
  19. $('.tw-comment-post-operations .tw-button-primary').click();
  20. }
  21. };
  22. }
  23. })();