watcher

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

Script này sẽ không được không được cài đặt trực tiếp. Nó là một thư viện cho các script khác để bao gồm các chỉ thị meta // @require https://update.greasyforks.org/scripts/370259/994538/watcher.js

Tác giả
spiralx
Phiên bản
0.0.2
Đã tạo
13-07-2018
Đã cập nhật
04-12-2021
Size
500 KB
Giấy phép
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()

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