ニコニコ動画のニコレポにAutoPager機能を追加する
目前為
// ==UserScript==
// @name Nicorepo AutoPagerize
// @namespace https://foooomio.net/
// @description ニコニコ動画のニコレポにAutoPager機能を追加する
// @version 0.5
// @author foooomio
// @license MIT License
// @match *://www.nicovideo.jp/my
// @match *://www.nicovideo.jp/my/
// @match *://www.nicovideo.jp/my?*
// @match *://www.nicovideo.jp/my/top*
// @match *://www.nicovideo.jp/user/*
// @exclude *://www.nicovideo.jp/user/*/*
// @run-at document-idle
// @grant none
// ==/UserScript==
(() => {
'use strict';
const $ = document.querySelector.bind(document);
const autopager = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting && !entry.target.parentElement.classList.contains('loading')) {
entry.target.click();
}
});
new MutationObserver(() => {
const target = $('.NicorepoPastFetcher .next-page-link');
if (target) {
autopager.disconnect();
autopager.observe(target, { childList: true });
}
}).observe($('.nicorepo-page'), { childList: true });
})();