NL+ | NodeLoc 增强脚本

NodeLoc 增强脚本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         NL+ | NodeLoc 增强脚本
// @namespace    https://www.nodeloc.com/
// @version      0.1.6
// @description  NodeLoc 增强脚本
// @run-at       document-end
// @match        https://www.nodeloc.com/*
// @icon         https://www.nodeloc.com/assets/favicon-ptypmduq.png
// @license      GPL-3.0 License
// @supportURL   https://github.com/Eoyz369/NL_Plus
// @homepageURL  https://github.com/Eoyz369/NL_Plus
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
 
    window.onload = function() {
        
        var observer = new MutationObserver(function(mutations) {
            mutations.forEach(function(mutation) {
                var wghtmlElement = document.getElementById("wghtml");
                if (wghtmlElement) {
                    wghtmlElement.remove();
                    observer.disconnect(); 
                }
            });
        });
 
        observer.observe(document.body, { childList: true, subtree: true });
 
       
        var initialElement = document.getElementById("wghtml");
        if (initialElement) {
            initialElement.remove();
        }
 
        
        function clickNextPage() {
            const nextButton = document.querySelector('.Button[aria-label="Next"]');
            if (nextButton) {
                nextButton.click();
            }
        }
 
        
        let scrollObserver = new IntersectionObserver((entries) => {
            if (entries[0].isIntersecting) {
                clickNextPage();
            }
        }, {
            rootMargin: '0px 0px 40px 0px' 
        });
 
       
        let trigger = document.createElement('div');
        document.body.appendChild(trigger);
        scrollObserver.observe(trigger);
    };
})();