MCPcopy Create free account
hub / github.com/XIU2/UserScript / fileMoreS

Function fileMoreS

Lanzou-Enhanced.user.js:307–322  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305
306 // 自动显示更多文件(分享链接列表页)
307 function fileMoreS() {
308 windowScroll(function (direction, e) {
309 if (direction === 'down') { // 下滑才准备加载更多
310 let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
311 let scrollDelta = 500;
312 if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) {
313 let filemore = document.getElementById('filemore'); // 寻找 [显示更多文件] 按钮
314 if (filemore && filemore.style.display != 'none') { // 如果正在加载,就不再点击
315 if (filemore.textContent.indexOf('更多') > -1){ // 避免已经在加载了,重复点击
316 filemore.click(); // 点击 [显示更多文件] 按钮
317 }
318 }
319 }
320 }
321 });
322 }
323
324
325 // 点击直接下载文件(分享链接列表页)

Callers 1

Calls 1

windowScrollFunction · 0.70

Tested by

no test coverage detected