MCPcopy Create free account
hub / github.com/WhiteSevs/TamperMonkeyScript / mutationObserver

Method mutationObserver

lib/Utils/src/Utils.ts:2221–2327  ·  view source on GitHub ↗

* 监听页面元素改变并处理 * @param target 需要监听的元素,如果不存在,可以等待它出现 * @param observer_config MutationObserver的配置 * @example Utils.mutationObserver(document.querySelector("div.xxxx"),{ "callback":(mutations, observer)=>{}, "config":{childList:true,attributes:true} }); * @example

(
    target: HTMLElement | Node | NodeList | Document,
    observer_config: {
      /**
       * observer的配置
       */
      config?: MutationObserverInit;
      /**
       * (可选)是否主动触发一次
       */
      immediate?: boolean;
      /**
       * (可选)是否仅触发一次
       * @default false
       */
      once?: boolean;
      /**
       * 触发的回调函数
       */
      callback: MutationCallback;
    }
  )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 15

initLinkProcessingFunction · 0.45
codeQuoteOptimizationFunction · 0.45
optimizationImagePreviewFunction · 0.45
setAttachmentsClickTipFunction · 0.45
initFunction · 0.45
watchFeedVideoListChangeFunction · 0.45
shieldReleatedSearchesFunction · 0.45
filterMessageFunction · 0.45
waitToRemovePauseDialogFunction · 0.45
addDownloadButtonFunction · 0.45

Calls 4

forEachMethod · 0.80
handlerFunction · 0.50
assignMethod · 0.45
isJQueryMethod · 0.45

Tested by

no test coverage detected