您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
财新首页信息流中,滑动到底部自动点击“加载更多文章”
// ==UserScript== // @name caixin auto load more // @namespace http://tampermonkey.net/ // @version 2024-12-09 // @description 财新首页信息流中,滑动到底部自动点击“加载更多文章” // @author You // @match https://www.caixin.com/ // @icon https://file.caixin.com/file/weixin/cx_logo.jpg // @license MIT // ==/UserScript== (function() { 'use strict'; // Your code here... function debounce(func, wait) { let timeout; return function(...args) { const context = this; clearTimeout(timeout); timeout = setTimeout(() => func.apply(context, args), wait); }; } // Function to check if the user has scrolled to the bottom of the page function isScrolledToBottom() { return (window.innerHeight + window.scrollY) >= document.body.offsetHeight; } // Function to click the button function clickButton() { const button = document.querySelector('#moreArticle a').click() if (button) { button.click(); } } // Debounced scroll event handler const handleScroll = debounce(function() { if (isScrolledToBottom()) { clickButton(); } }, 500); // Adjust the debounce wait time as needed // Add an event listener for the scroll event window.addEventListener('scroll', handleScroll); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址