Greasy Fork is available in English.

watcher

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

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/370259/994538/watcher.js

نووسەر
spiralx
وەشان
0.0.2
Created
2018-07-13
Updated
2021-12-04
مۆڵەت
نییە

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