MutationObserver
@Js
class MutationObserver : Obj
MutationObserver invokes a callback when DOM modifications occur.
Constructor
Disconnect this observer from receiving DOM mutation events
Empties this observers's record queue and returns what was in there
Register to receive DOM mutation events for given node
This disconnect()
Disconnect this observer from receiving DOM mutation events.
new make(|MutationRec[]| callback)
Constructor.
This observe(Elem target, Str:Obj opts)
Register to receive DOM mutation events for given node. At least one option is required:
- "childList":
trueto observe node additions and removals on target (including text nodes) - "attrs":
trueto observe target attribute mutations - "charData":
trueto observe target data mutation - "subtree":
trueto observe target and target's descendant mutations - "attrOldVal":
trueto capture attribute value before mutation (requires "attrs":'true') - "charDataOldVal":
trueto capture target's data before mutation (requires "charData":'true') - "attrFilter": Str[] whitelist of attribute names to observe (requires "attrs":'true')
MutationRec[] takeRecs()
Empties this observers's record queue and returns what was in there.