Watch for added and removed elements and changes to attributes or text content
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/370259/994538/watcher.js
Watch a page's DOM for added and removed elements and changes to attributes or text content.
const watcher = new Watcher()
const watch = watcher.add('a[href]', result => {
console.group(`Added ${result.added.length} links, removed ${result.removed.length} links`)
for (const a of result.added) {
console.log(`Added: %o`, a)
}
for (const a of result.removed) {
console.log(`Removed: %o`, a)
}
console.groupEnd()
})
watcher.start()