使用《Web API 接口》的《MutationObserver》
网上查到的很多都是使用 Mutation events 的，但在 MDN 上一查这个事件已经废弃了，并且推荐用 MutationObserver 替换掉
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Mutation events provide a mechanism for a web page or an extension to get notified about changes made to the DOM. Use Mutation Observers instead if possible.