Greasy Fork

9gag Auto Comment Section

anarka84

当前为 2023-01-16 提交的版本,查看 最新版本

// ==UserScript==
// @name         9gag Auto Comment Section
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  anarka84
// @license MIT
// @author       Marc
// @match        https://9gag.com/gag/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
 
    var commentElement = document.getElementsByClassName("post-tab-bar__tab");
    var searchText = 'Comments';
    var found;
 
    for (var i = 0; i < commentElement.length; i++) {
        if (commentElement[i].textContent.includes(searchText)) {
            found = commentElement[i];
            break;
        }
    }
    found.click()
})();