您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
-
当前为
// ==UserScript== // @name:ko 구글 무한 스크롤 // @name Google Infinite Scroll // @description:ko - // @description - // @namespace https://ndaesik.tistory.com/ // @version 2024.12.27.22.27 // @author ndaesik // @icon https://t1.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://www.google.com // @match *://www.google.com/search* // ==/UserScript== document.head.appendChild(Object.assign(document.createElement('style'), {textContent: '#botstuff [role="navigation"] { display: none !important; }'})); const fetchNextPage = async pageNumber => { const baseUrl = new URL(window.location.href); const text = await (await fetch(`${baseUrl.origin}${baseUrl.pathname}?q=${baseUrl.searchParams.get('q')}&start=${pageNumber * 10}`)).text(); const newDoc = new DOMParser().parseFromString(text, 'text/html'); newDoc.querySelectorAll('#rso > div').forEach(result => document.querySelector('#rso').appendChild(result.cloneNode(true))); return !!newDoc.querySelector('#pnnext'); }; let [pageNumber, isLoading, hasMore] = [1, false, true]; window.addEventListener('scroll', async () => { (!isLoading && hasMore && window.innerHeight + window.pageYOffset >= document.documentElement.offsetHeight - 1000) && (isLoading = true, hasMore = await fetchNextPage(pageNumber), pageNumber += hasMore ? 1 : 0, isLoading = false); });