watcher

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

2018-07-13 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

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.greasyforks.org/scripts/370259/612451/watcher.js

लेखक
spiralx
आवृत्ती
0.0.1
बनवली
2018-07-13
अपडेट केली
2018-07-13
आकार
48.6 KB
License
नाही

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

长期地址
遇到问题?请前往 GitHub 提 Issues。