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);
注意手快一些,在出消息之前把代码跑了。