monitor dom change

detect mod change

Dette scriptet burde ikke installeres direkte. Det er et bibliotek for andre script å inkludere med det nye metadirektivet // @require https://update.greasyfork.org/scripts/402597/801281/monitor%20dom%20change.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         monitor dom change 
// @namespace    http://www.chaochaogege.com
// @version      0.1
// @description  detect mod change
// @author       You
// @grant        none
// ==/UserScript==

!function () {
  window.monitordom = function (domnode, cb,config = {childList: true}) {
    const targetNode = domnode

    // Callback function to execute when mutations are observed
    const callback = function (mutationsList, observer) {
      for (let i = 0; i < mutationsList.length; i++) {
        cb(mutationsList[i])
      }
    };

    // Create an observer instance linked to the callback function
    const observer = new MutationObserver(callback);

    // Start observing the target node for configured mutations
    observer.observe(targetNode, config)
  }
}()