Skip to content

Instantly share code, notes, and snippets.

@iamso1
Created March 17, 2020 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamso1/e1239501856f9fe6cf543125e71b0cd8 to your computer and use it in GitHub Desktop.
Save iamso1/e1239501856f9fe6cf543125e71b0cd8 to your computer and use it in GitHub Desktop.
test
var container = document.querySelector('#root > div > div.tw-flex.tw-full-height.tw-full-width > div > div > section > div > div.chat-list.tw-flex.tw-flex-column.tw-flex-grow-1.tw-flex-nowrap.tw-overflow-hidden > div.chat-list__lines.tw-flex-grow-1.scrollable-area > div.simplebar-scroll-content > div');
var observer = new MutationObserver(function() {
const content=document.querySelector('.simplebar-content > div> div:nth-last-child(2)').textContent;
if(content.indexOf('來抽便便')>1)
document.querySelector('#root > div > div.tw-flex.tw-full-height.tw-full-width > div > div > section > div > div.chat-input.tw-block.tw-pd-b-1.tw-pd-x-1 > div:nth-child(2) > div.tw-block.tw-relative.tw-z-default > div > div:nth-child(2) > div > div > textarea').value='!join'
document.querySelectorAll('.tw-mg-l-05')[1].querySelector('button').click();
});
observer.observe(container, {subtree: true, childList: true});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment