🏠 Home 

mutation-observer

Simple wrapper for using DOM mutation events

สคริปต์นี้ไม่ควรถูกติดตั้งโดยตรง มันเป็นคลังสำหรับสคริปต์อื่น ๆ เพื่อบรรจุด้วยคำสั่งเมทา // @require https://update.greasyfork.org/scripts/7602/32979/mutation-observer.js

ผู้เขียน
spiralx
เวอร์ชัน
0.1.0
สร้างเมื่อ
22-01-2015
อัปเดตเมื่อ
22-01-2015
Size
55.2 กิโลไบต์
สัญญาอนุญาต
ไม่มี

mutation-summary

Library based on DOM Mutation Observers which allows triggering of events on the following conditions:

  • a node is added to the document
  • a node is removed from the document
  • the content of a node is changed
  • an attribute of the node is changed

This library simplifies the process of setting up and using mutation observers e.g.

function updateWidgets(summaries) {
var widgetSummary = summaries[0];
widgetSummary.added.forEach(buildNewWidget);
widgetSummary.removed.forEach(cleanupExistingWidget);
}
var observer = new MutationSummary({
callback: updateWidgets,
queries: [{
element: '[data-widget]'
}]
});