function {{JS_PREFIX}}_apply_blocks(blocked_users) {
    const currentUser = document.getElementById('me');
    const currentUserName = (currentUser !== null) ? currentUser.innerText : null;
    let commentTable = document.querySelector('table.comment-tree');
    if (commentTable === null) {
        console.warn('commentTable not found, looking for hnmain table');
        commentTable = document.querySelectorAll('#hnmain tbody');
        if (commentTable === null) {
            console.warn('commentTable not found and hnmain table not found, not filtering');
            return;
        } else {
            commentTable = commentTable[0];
        }
    }
    const comments = commentTable.querySelectorAll('tr');
    if (comments === null || comments.length === 0) {
        console.warn('No comments found, not filtering');
        return;
    }
    let blocking = false;
    let blocking_indent = null;
    for (let i=0; i<comments.length; i++) {
        const comment = comments[i];
        const userElement = comment.querySelector('.hnuser');
        if (userElement !== null) {
            const author = userElement.href.split('=')[1];
            const indent = parseInt(comment.querySelector('.ind').querySelector('img').width);
            if (blocking) {
                if (indent > blocking_indent) {
                    comment.parentNode.removeChild(comment);
                    i++;
                } else {
                    blocking = false;
                    blocking_indent = null;
                }
            } else {
                if (blocked_users !== null && blocked_users.includes(author)) {
                    blocking = true;
                    blocking_indent = indent;
                    comment.parentNode.removeChild(comment);
                    i++;
                } else {
                    const existingBlock = comment.querySelector('.bubble_block');
                    if (existingBlock === null && (currentUserName === null || currentUserName !== author)) {
                        const ageElement = comment.querySelector('.age');
                        const blockNode = document.createElement('span');
                        blockNode.className = "bubble_block";
                        blockNode.innerHTML = ' [<b><a href="#" onclick="{{JS_PREFIX}}_block_user(\''+author+'\'); return false;">X</a></b>]';
                        ageElement.parentNode.insertBefore(blockNode, ageElement.nextSibling);
                    }
                }
            }
        }
    }
}

