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

نووسەر
wish king
وەشان
0.1.2
Created
2023-04-21
Updated
2023-05-01
مۆڵەت
نییە

Dom变化监听

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

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

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