Record Microsoft Teams CC Subtitles

Save CC subtitles to window.textList for later reference after the meeting ends.

  1. // ==UserScript==
  2. // @name Record Microsoft Teams CC Subtitles
  3. // @name:zh 記錄 Microsoft Teams CC 字幕
  4. // @name:zh-TW 記錄 Microsoft Teams CC 字幕
  5. // @name:zh-CN 记录 Microsoft Teams CC 字幕
  6. // @namespace https://github.com/kevin823lin
  7. // @version 1.0
  8. // @description Save CC subtitles to window.textList for later reference after the meeting ends.
  9. // @description:zh 把 CC 字幕保存到 window.textList 以便在會議結束後查閱
  10. // @description:zh-TW 把 CC 字幕保存到 window.textList 以便在會議結束後查閱
  11. // @description:zh-CN 把 CC 字幕保存到 window.textList 以便在会议结束后查阅
  12. // @author kevin823lin
  13. // @match https://teams.microsoft.com/multi-window/*
  14. // @icon https://www.google.com/s2/favicons?sz=64&domain=microsoft.com
  15. // @grant none
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20.  
  21. // Your code here...
  22. window.textList = []
  23. function saveToList() {
  24. [...document.querySelectorAll('.ui-chat__messagecontent:not(.saved)')]
  25. .slice(0, -1)
  26. .forEach(chat => {
  27. window.textList.push(chat.innerText);
  28. chat.classList.add('saved');
  29. })
  30. // window.textList.length && console.log(window.textList.join('\n'));
  31. }
  32. setInterval(saveToList, 5000);
  33. })();