Greasy Fork is available in English.

DTF & VC Comments Expander

Expands dtf.ru & vc.ru all comments by default

// ==UserScript==
// @name         DTF & VC Comments Expander
// @namespace    https://tampermonkey.net/
// @version      1.7
// @description  Expands dtf.ru & vc.ru all comments by default
// @author       Streampunk
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAAAb1BMVEWF1vAAAQUAAAF4wdkUISiH2vSE1e8PGR8wTlpzudEKERZtr8UOFx1Pf5CC0uxXjJ4pQk0GCg8kO0V/zeZhnLA8YnAzU184W2ksSFNnprtDbXxThpdsrsRAaHYfMjt6xd1clKgXJS1JdoZakaMcLTWbLIFvAAACy0lEQVR4nO3c25KiMBSF4SQQD4iHCAqeQGnf/xmHnrmZC7ZMmaw0Tq3/XuvrVCqtJFEpxhhjjDHGGGOMMcYYY4wxxhh7u9m7KWWt/Rlze1i82bG6re/XdvMD8iQ176d19qi7UxGbnaTaq57umvN1E9Xti/4Dz+oy5nCHQH+73a6MN9qB0D07q5ax1MHQPTvdRhrsgOh+jlTtx6H79qsPRJvn6fPQ/cQuPw/dq/FjHRytzQM+r8Ojtdkn4JUPgNa62nwg2l2wQw1B63QFVWPQ5gidIBi0diVyqEFosys+D63dHTjUKLSpgbP6ffTvL7Zy2Qk31ALa3dZjdVWTvfqbDjCzhM5WdjRVnA65ONrmiftCIKL/5cVWXWtxqIGrnhe6Zxc3Jw31GWX2RSu1uUnoHWz98EarQpohKewTqj/arubDaAdb9PzRSkkTZDtl9FVYr7spo4v94Gptqimj7WEYvQCZw6DXg+9h6tmU0dthNGyhJppoookmmmiiiSaaaKKJJppooi/DaNi2SxD0WXhYM+XnHrNaeCwGModAW+E9zG3Cz/KEKa31esLothne4sLtFAVAd8JA57ATkd5oWwqP1E0D29P3RdtS2qfGLR6eaFushV0iDdxy8dhmVtYWZS1tfWo9xx3yldD35Virsts7+SAC7v+hfHQiy8fKnH51dsJ9RT864R3yEAIMrTucGXbw6oE8uokaadhuLQ5tGug5ewwaesANhQYf60WgTQM+QI1Az4FH8lBoh/ukBEO7DvehA4V2Z/DZegDadXhzYLTJL/C5ERptHhGuEwVGu0WkG4nh0Ca9xLqyGgpt8kO0i59h0EbPq+ss3s1gf/T3HexuFWPR+Av98mT/CLd/bd7cylbFve6eNPn8zdLn/ni+L4v4vyuwSUYfcAglSbv5qd9wGL+wID5iYowxxhhjjDHGGGOMMcYYY4wxxtj/3y9lTEB1QYFbqAAAAABJRU5ErkJggg==
// @match        https://dtf.ru/*
// @match        https://vc.ru/*
// @run-at       document-end
// @grant        none
// @license      MIT
// ==/UserScript==

setInterval(function() {
  const load_all_comments_button = document.querySelector(".comments-limit__expand");
     if(load_all_comments_button) {
        load_all_comments_button.click();
        clearInterval();
//      console.log("Trying expand all comments");
        }
     else
        clearInterval();
//      console.log("All comments expanded");
}, 5000);

setInterval(function() {
  const load_more_comments_button = document.querySelector('button[data-gtm-click*="Comment — Open Thread"]'); // All comments expanded by default, but there is no way to collapse any of the replies
//  const load_more_comments_button = document.querySelector('button[data-gtm-click*="Comment — Open Thread"]:not([data-branch-expandable="true"]):not([data-branch-id])'); // Most comments expanded and you can collapse all replies, but too deeply nested comments are not expanded by default
     if(load_more_comments_button) {
        load_more_comments_button.click();
        clearInterval();
//      console.log("Trying expand replies");
        }
     else
        clearInterval();
//      console.log("All replies expanded");
}, 1000);