()
| 23 | var chatConf = {}; |
| 24 | |
| 25 | async function init() { |
| 26 | new MutationObserver(function (mutationsList) { |
| 27 | for (const mutation of mutationsList) { |
| 28 | // console.log(mutation); |
| 29 | // if (mutation.target.closest(".text-sm")) { |
| 30 | // console.log("create btns"); |
| 31 | // chatBtns(); |
| 32 | // } |
| 33 | if (mutation.target.closest("form")) { |
| 34 | chatBtns(); |
| 35 | } |
| 36 | if (mutation.target.matches("#__next")) { |
| 37 | console.log("---CheckNewMessages"); |
| 38 | Helper_Messages_Count = document.querySelectorAll('.text-base').length; |
| 39 | AddRecognitionBtn(); |
| 40 | Helper_CheckNewMessages(); |
| 41 | // setTimeout(AddRecognitionBtn, 1000); |
| 42 | } |
| 43 | } |
| 44 | }).observe(document.body, { |
| 45 | childList: true, |
| 46 | subtree: true, |
| 47 | }); |
| 48 | document.addEventListener('visibilitychange', () => |
| 49 | document.getElementsByTagName('textarea')[0]?.focus() |
| 50 | ); |
| 51 | window.__helper = Helper_Words |
| 52 | setTimeout(AddRecognitionBtn, 1000); |
| 53 | setTimeout(Helper_CheckNewMessages, 1000); |
| 54 | setTimeout(Get_app_conf,1000); |
| 55 | } |
| 56 | async function Get_app_conf(){ |
| 57 | chatConf = await invoke('get_app_conf') || {}; |
| 58 | if(chatConf == {}){ |
no test coverage detected