From 425107c67cdcb386c101c58494284ed49525416f Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 7 Dec 2023 17:25:06 +0100 Subject: [PATCH] fix for smaller threads --- dfde-singlepage.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 dfde-singlepage.user.js diff --git a/dfde-singlepage.user.js b/dfde-singlepage.user.js old mode 100644 new mode 100755 index 25ed90b..4c39101 --- a/dfde-singlepage.user.js +++ b/dfde-singlepage.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name dfde-singlepage // @namespace de.debianforum -// @version 0.4 +// @version 0.5 // @description View all pages of a thread on one page // @author You // @match https://debianforum.de/forum/viewtopic.php*t=* @@ -34,7 +34,8 @@ if (unsuitable) { window.location.href= "https://debianforum.de/forum/viewtopic.php?" + thread_id; } let promises = [] - const postPerPage = parseInt(document.querySelector('input[name=page-number]').attributes["data-per-page"].value); + const pageForm = document.querySelector('input[name=page-number]'); + const postPerPage = pageForm ? parseInt(pageForm.attributes["data-per-page"].value) : 25; // async wrapper to fix the order of requests/posts const fn = async() => { -- 2.39.2