watcher

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

Pada tanggal 12 November 2020. Lihat %(latest_version_link).

Skrip ini tidak untuk dipasang secara langsung. Ini adalah pustaka skrip lain untuk disertakan dengan direktif meta // @require https://update.greasyfork.org/scripts/370259/868275/watcher.js

Penulis
spiralx
Versi
0.0.1
Dibuat
13 Juli 2018
Diperbarui
12 November 2020
Size
510 KB
Lisensi
N/A

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