您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Infinite scroll on chat mangalib.me
// ==UserScript== // @name Mangalib Infinite Scroll // @version 0.7.3 // @description Infinite scroll on chat mangalib.me // @author reiwsan // @match https://mangalib.me/* // @match https://ranobelib.me/* // @namespace https://greasyfork.org/users/221048 // @license MIT // ==/UserScript== (function() { 'use strict'; const preloadPos = 321; /** * @param {Element} chatMore * @returns {void} */ const historyAutoload = function(chatMore) { let chatItems = document.querySelector('.chat__items'), historyLoad = false; /** * @param {Element} chatMore * @returns {boolean} */ const chatMoreClick = function(chatMore) { chatMore.click(); return true; } chatItems.addEventListener('scroll', _ => { let scrollPos = ((chatItems.scrollHeight - chatItems.clientHeight) - chatItems.scrollTop), scrollPreload = (scrollPos <= preloadPos); historyLoad = (scrollPreload && !historyLoad) ? chatMoreClick(chatMore) : scrollPreload; }); } if (typeof _CHAT_INSTANCE !== 'undefined') { const chatInitInterval = setInterval(() => { let chatMore = document.querySelector('.chat__more'); if (chatMore) { clearInterval(chatInitInterval); historyAutoload(chatMore); } }, 50); } })();