From 6181ee39358345c05824869a5ca1950b89096cce Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 7 Jun 2019 18:25:04 +0200 Subject: [PATCH] rbb24_expand_comments: Expand if there is no load more button. --- comment-sections/rbb24_expand_comments.user.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/comment-sections/rbb24_expand_comments.user.js b/comment-sections/rbb24_expand_comments.user.js index 99db7e4..67b4087 100644 --- a/comment-sections/rbb24_expand_comments.user.js +++ b/comment-sections/rbb24_expand_comments.user.js @@ -2,7 +2,7 @@ // @name Expand rbb24.de comments // @description Loads all comments under articles on rbb24.de and expands them. // @description:de Lädt alle kommentare unter artikeln auf rbb24.de und klappt sie aus. -// @version 2019.06.07.4 +// @version 2019.06.07.5 // @author tastytea // @copyright 2019, tastytea (https://tastytea.de/) // @license GPL-3.0-only @@ -19,15 +19,21 @@ function expand_comments() { const loadmore = document.getElementsByClassName("load_more_comments")[0]; - if (loadmore === undefined) // Cancel if we are not on an article page. + const showall = document.getElementsByClassName("show_all")[0]; + + if (loadmore === undefined) + { + loadmore.click(); + } + + if (showall === undefined) // Cancel if we are not on an article page. { return; } - loadmore.click(); setTimeout(function() // Wait for comments to load. { - document.getElementsByClassName("show_all")[0].click(); + showall.click(); }, 1000); }