Skip to content

Commit

Permalink
update: homepage rcmd preload
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Jun 26, 2024
1 parent 7665b45 commit 541854d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rules/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ if (isPageHomepage()) {
// 启用 预加载下一屏
new CheckboxItem({
itemID: 'homepage-rcmd-video-preload',
description: '启用 预加载下一屏 (实验功能)',
description: '启用 预加载下一屏 (实验功能)\n需开启 隐藏分区视频推荐',
itemCSS: `
.load-more-anchor.preload {
position: fixed;
Expand All @@ -530,7 +530,10 @@ if (isPageHomepage()) {
return
}
const fireRcmdLoad = () => {
if (anchor.getBoundingClientRect().top > innerHeight * 2) {
const firstSkeleton = document.querySelector(
'.bili-video-card:has(.bili-video-card__skeleton:not(.hide)):has(~ .load-more-anchor)',
) as HTMLElement
if (!firstSkeleton || firstSkeleton.getBoundingClientRect().top > innerHeight * 2) {
return
}

Expand Down

0 comments on commit 541854d

Please sign in to comment.