setMutationHandler

MutationObserver wrapper to wait for the specified CSS selector

2015-09-05 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greatest.deepsurf.us/scripts/12228/72406/setMutationHandler.js을(를) 사용하여 포함하는 라이브러리입니다.

작성자
woxxom
버전
1
생성일
2015-09-05
갱신일
2015-09-05
크기
1.12KB
라이선스
해당 없음

MutationObserver wrapper to wait for the specified CSS selector.

setMutationHandler(document, '.container p.some-child', function(observer, nodes) {
    // single node:
    nodes[0].remove();

    // or multiple nodes:
    [].forEach.call(nodes, function(node) {
        node.style.display = 'none';
    });

    //observer.disconnect(); // disconnect the observer, this is useful for one-time jobs
    return true; // continue enumerating current batch of mutations
});

You may want to make your userscript run at document-start to catch the mutations during page load:

..............
// @run-at        document-start
..............
// ==/UserScript==