Miniflux add more previous and next links

Adds another Next button to Miniflux UI that doesn't jump all over the place

目前為 2025-10-28 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Miniflux add more previous and next links
// @namespace    https://reader.miniflux.app/
// @version      17
// @description  Adds another Next button to Miniflux UI that doesn't jump all over the place
// @author       Tehhund
// @match        *://*.miniflux.app/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=miniflux.app
// @run-at       document-start
// ==/UserScript==

const addLinks = () => {
  const nextLink = document.querySelector('[rel="next"]');
  if (nextLink) {
    const newNextLink = nextLink.cloneNode(true);
    newNextLink.style.position = 'fixed';
    newNextLink.style.right = '0';
    newNextLink.style.border = '1px solid #000000';
    const fixedNewNextLinks = [];
    for (let i = 0; i < 3; i++) {
      fixedNewNextLinks[i] = newNextLink.cloneNode(true);
      fixedNewNextLinks[i].style.top = ((i + 1) * 11) + 'rem';
    }
    for (let elem of fixedNewNextLinks) {
      document.body.appendChild(elem);
    }
    const relativeNewNextLinks = [];
    for (let i = 0; i < 3; i++) {
      relativeNewNextLinks[i] = newNextLink.cloneNode(true);
      relativeNewNextLinks[i].style.position = 'relative';
      relativeNewNextLinks[i].style.top = ((i + 1) * 11) - 23 + 'rem';
      relativeNewNextLinks[i].style.left = `${7 - i * 2.2}rem`;
    }
    for (let elem of relativeNewNextLinks) {
      document.querySelector('.pagination-next').insertBefore(elem, nextLink);
    }
  }

  const prevLink = document.querySelector('[rel="prev"]');
  if (prevLink) {
    const newPrevLink = prevLink.cloneNode(true);
    newPrevLink.style.position = 'fixed';
    newPrevLink.style.left = '0';
    newPrevLink.style.border = '1px solid #000000';
    const newPrevLinks = [];
    for (let i = 0; i < 3; i++) {
      newPrevLinks[i] = newPrevLink.cloneNode(true);
      newPrevLinks[i].style.top = ((i + 1) * 11) + 'rem';
    }
    for (let elem of newPrevLinks) {
      document.body.appendChild(elem);
    }
    const relativeNewPrevLinks = [];
    for (let i = 0; i < 3; i++) {
      relativeNewPrevLinks[i] = newPrevLink.cloneNode(true);
      relativeNewPrevLinks[i].style.position = 'relative';
      relativeNewPrevLinks[i].style.top = ((i + 1) * 11) - 23 + 'rem';
      relativeNewPrevLinks[i].style.left = `${-5 - (i * 4.1)}rem`;
    }
    for (let elem of relativeNewPrevLinks) {
      document.querySelector('.pagination-prev').appendChild(elem);
    }
  }
};

try { addLinks(); } catch (e) { }// If the script runs after DOMContentLoaded this will add the links. If it runs before DOMContentLoaded, this will error and the listener below will run it instead.
window.addEventListener("DOMContentLoaded", addLinks);