mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
25 lines
859 B
JavaScript
25 lines
859 B
JavaScript
const target = document.URL.includes('bangumi') ? '#bofqi' : '.video-info .video-title .tit'
|
|
// SpinQuery.count('.nav-con,#bofqi', 3).then(() => {
|
|
// const element = document.querySelector(target)
|
|
// if (element === null) {
|
|
// return
|
|
// }
|
|
// element.scrollIntoView()
|
|
// if (settings.playerFocusOffset !== 0) {
|
|
// window.scrollBy(0, settings.playerFocusOffset)
|
|
// }
|
|
// })
|
|
SpinQuery.select(target).then(async element => {
|
|
await SpinQuery.condition(() => dq('.video-toolbar .ops .collect,.tool-bar .coin-info'), it => {
|
|
return it !== null && it.innerText !== '--'
|
|
})
|
|
console.log(element)
|
|
if (element === null) {
|
|
return
|
|
}
|
|
element.scrollIntoView()
|
|
if (settings.playerFocusOffset !== 0) {
|
|
window.scrollBy(0, settings.playerFocusOffset)
|
|
}
|
|
console.log(element.offsetTop, settings.playerFocusOffset, window.scrollY)
|
|
}) |