Show all comments on github issue

Automatically clicks the "xxx hidden items" button on Github issue pages to successively load in all the comments in the page on load.

31.12.2021 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Show all comments on github issue
// @namespace    https://www.taylrr.co.uk
// @version      0.1
// @description  Automatically clicks the "xxx hidden items" button on Github issue pages to successively load in all the comments in the page on load.
// @author       taylor8294
// @match        https://github.com/*/issues/*
// @icon         https://icons.duckduckgo.com/ip2/github.com.ico
// @grant        none
// @license      GPLv3
// ==/UserScript==

(function() {
    'use strict';

    function ready(fn) {
        if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
            fn();
        } else {
            document.addEventListener('DOMContentLoaded', fn);
        }
    }

    function clickButton(){
        let button = document.querySelector('.ajax-pagination-form button');
        if(button){
            if(!button.disabled) button.click();
            setTimeout(clickButton,50);
        } else console.log('All comments are now showing.')
    }
    ready(()=>{setTimeout(clickButton,2000)});
})();