]> git.aero2k.de Git - dfde/dfde-singlepage.git/commitdiff
fix for smaller threads
authorThorsten <mail@aero2k.de>
Thu, 7 Dec 2023 16:25:06 +0000 (17:25 +0100)
committerThorsten <mail@aero2k.de>
Thu, 7 Dec 2023 16:25:06 +0000 (17:25 +0100)
dfde-singlepage.user.js [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 25ed90b..4c39101
@@ -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() => {