Greasy Fork is available in English.

monitor dom change

detect mod change

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.greasyfork.org/scripts/402597/801281/monitor%20dom%20change.js

// ==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)
  }
}()