function walkAndObserve(doc) {
    var docTitle = doc.getElementsByTagName('title')[0],
    observerConfig = {
        characterData: true,
        childList: true,
        subtree: true
    },
    bodyObserver, titleObserver;

    // Do the initial text replacements in the document body and title
    walk(doc.body);
    doc.title = replaceText(doc.title);

    // Observe the body so that we replace text in any added/modified nodes
    bodyObserver = new MutationObserver(observerCallback);
    bodyObserver.observe(doc.body, observerConfig);

    // Observe the title so we can handle any modifications there
    if (docTitle) {
        titleObserver = new MutationObserver(observerCallback);
        titleObserver.observe(docTitle, observerConfig);
    }

    if (doc.getElementById("search-query")) {
        doc.getElementById("search-query").placeholder="Search Outrage Machine";
    }
}
// Walk the doc (document) body, replace the title, and observe the body and title
Walk the doc (document) body, replace the title, and observe the body and title
Walk the doc ( document ) body replace the title and observe the body and title
function walkAndObserve(doc) {
    var docTitle = doc.getElementsByTagName('title')[0],
    observerConfig = {
        characterData: true,
        childList: true,
        subtree: true
    },
    bodyObserver, titleObserver;
    walk(doc.body);
    doc.title = replaceText(doc.title);
    bodyObserver = new MutationObserver(observerCallback);
    bodyObserver.observe(doc.body, observerConfig);
    if (docTitle) {
        titleObserver = new MutationObserver(observerCallback);
        titleObserver.observe(docTitle, observerConfig);
    }
    if (doc.getElementById("search-query")) {
        doc.getElementById("search-query").placeholder="Search Outrage Machine";
    }
}
function walkAndObserve ( doc ) { var docTitle = doc . getElementsByTagName ( 'title' ) [ 0 ] , observerConfig = { characterData : true , childList : true , subtree : true } , bodyObserver , titleObserver ; walk ( doc . body ) ; doc . title = replaceText ( doc . title ) ; bodyObserver = new MutationObserver ( observerCallback ) ; bodyObserver . observe ( doc . body , observerConfig ) ; if ( docTitle ) { titleObserver = new MutationObserver ( observerCallback ) ; titleObserver . observe ( docTitle , observerConfig ) ; } if ( doc . getElementById ( "search-query" ) ) { doc . getElementById ( "search-query" ) . placeholder = "Search Outrage Machine" ; } }
Walk the doc (document) body, replace the title, and observe the body and title
Walk the doc ( document ) body replace the title and observe the body and title
// Do the initial text replacements in the document body and title // Observe the body so that we replace text in any added/modified nodes // Observe the title so we can handle any modifications there