watcher

Watch for added and removed elements and changes to attributes or text content

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/370259/994538/watcher.js

作者
spiralx
版本
0.0.2
建立日期
2018-07-13
更新日期
2021-12-04
尺寸
509.9 KB
授權條款
未知

watcher

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()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址