watcher

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

이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greasyforks.org/scripts/370259/994538/watcher.js을(를) 사용하여 포함하는 라이브러리입니다.

작성자
spiralx
버전
0.0.2
생성일
2018-07-13
갱신일
2021-12-04
크기
510KB
라이선스
해당 없음

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。