U

uniqueObserver

Created 2023-06-16
Updated 2023-06-16
似乎没有做出太大的贡献,只是不想重复的写代码而将其作为工具库使用
#工具类
#DOM操作
#开发者工具
Statistics
Total Installs
169
Last 24h
+0
User Rating
-
封装 MutationObserver 的 DOM 节点变化监听工具函数

如何使用示例代码

const nextPlay = document.querySelector('#next_play_btn');
const config = { attributes: true, childList: true, subtree: false };

const observer = observeNodeChanges(nextPlay, config, function(mutation) {
  console.log('节点发生变化了', mutation.type);
});
// @require https://scriptcat.org/lib/1105/1.0.0/uniqueObserver.js?sha384-yUrKWaR631Ql3a5sPnv0245fv8zjCyVguHr2EV4OVvWwKaxnsRfURM0qUihtJujH
Library Details
This is a library used by userscripts, you can reference it directly in your scripts.
License
Not declared
No license declared — reuse with caution