Pixiv捲至底部自動點下一頁

在Pixiv追蹤新插畫與作者頁面,當捲至底部時自動點擊下一頁

目前为 2023-06-25 提交的版本。查看 最新版本

// ==UserScript==
// @name         Pixiv捲至底部自動點下一頁
// @name:zh-TW   Pixiv捲至底部自動點下一頁
// @name:ja      Pixivのスクロールが最下部に達した時に自動的に次のページへ移動する
// @name:en      Pixiv Scroll to Bottom Auto Click Next Page
// @namespace    http://tampermonkey.net/
// @version      1.01
// @description  在Pixiv追蹤新插畫與作者頁面,當捲至底部時自動點擊下一頁
// @description:zh-TW 在Pixiv追蹤新插畫與作者頁面,當捲至底部時自動點擊下一頁
// @description:ja Pixivの新しいイラストと作者のページで、スクロールが最下部に達した時に自動的に次のページへ移動します
// @description:en Automatically clicks the next page when scrolling to the bottom on Pixiv's bookmarked new illustrations and user pages
// @author       Max
// @match        https://www.pixiv.net/bookmark_new_illust.php*
// @match        https://www.pixiv.net/users/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pixiv.net
// @grant        none
// @license MIT
// ==/UserScript==


function isPageAtBottom() {
  var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
  var documentHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight);
  var scrollPosition = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
  if (documentHeight - windowHeight - scrollPosition <= 0) {
    return true;
  } else {
    return false;
  }
}

function scrollToBottomAndRedirect() {
  var specificElement = document.querySelector('.sc-d98f2c-0.sc-s46o24-1.dAXqaU');
  if (specificElement) {
    specificElement.click();
    console.log("已點擊以展開查看全部:", specificElement);
  } else {
    var nextButton = document.querySelector('.sc-d98f2c-0.sc-xhhh7v-2.cCkJiq.sc-xhhh7v-1-filterProps-Styled-Component.kKBslM');
    if (nextButton) {
      nextButton.click();
      console.log("已點擊下一頁按鈕:", nextButton);
    }
  }
}

function handleScroll() {
  if (isPageAtBottom()) {
    scrollToBottomAndRedirect();
  }
}

window.addEventListener('scroll', handleScroll);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址