Greasy Fork is available in English.

onDomChange

Dom变化监听

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/464529/1183888/onDomChange.js

Aŭtoro
wish king
Versio
0.1.2
Kreita
2023/04/21
Ĝisdatigita
2023/05/01
Licenco
N/A

Dom变化监听

//使用示例:
//说明:childList是子元素,subtree是后代元素

onDomChange(el, (observer, mutation) => {
    //your code

    //if (mutation.type === 'childList'){
        //do something
    //}
    //if(observer) observer.disconnect();
    //observer.observeAgain();
}, {childList: true});