Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 504 Bytes

组委会模拟器.md

File metadata and controls

19 lines (14 loc) · 504 Bytes

组委会模拟器

F12 写个 event listener 就好了:

let messageCount = 0;

document.getElementsByClassName('fakeqq-container')[0].addEventListener('DOMNodeInserted', function ( event ) {
  messageCount += 1;
  const text = event.target.textContent;
  
  if (text.search(/hack\[[a-z]+\]/g) >= 0) {
    event.target.querySelector('.fakeqq-message__bubble').click();
    console.log(messageCount, text);
  }
}, false);

注意手快一些,在出消息之前把代码跑了。