On a post's page, this automates loading all the comments instead of requiring the user to click for each batch
当前为
// ==UserScript==
// @name Patreon: Load and show all comments
// @namespace http://tampermonkey.net/
// @version 2024-01-08-v4
// @description On a post's page, this automates loading all the comments instead of requiring the user to click for each batch
// @author You
// @match https://www.patreon.com/posts/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=patreon.com
// @grant none
// ==/UserScript==
(function() {
function loaded(){
let lmc = document.querySelector("button[data-tag='loadMoreCommentsCta'");
lmc.innerHTML = "Load ALL comments";
let obs = new MutationObserver(mut => { if(mut[0].removedNodes.length>0 && lmc){ lmc.click();} }); //auto click button after the loading svg disappears
obs.observe(lmc.parentElement, { childList: true, subtree: true }); //the loading svg is a sibling of the lmc button
}
document.body.onload = loaded;
})();