mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
26 lines
900 B
TypeScript
26 lines
900 B
TypeScript
(async () => {
|
|
const url = document.URL.replace(window.location.search, '')
|
|
if (url !== 'https://live.bilibili.com/' && url !== 'https://live.bilibili.com/index.html') {
|
|
return
|
|
}
|
|
SpinQuery.condition(
|
|
() => document.querySelector('.component-ctnr video'),
|
|
(video: HTMLVideoElement) => !video.paused,
|
|
() => {
|
|
const button = document.querySelector('.bilibili-live-player-video-controller-start-btn>button') as HTMLButtonElement
|
|
button.click()
|
|
}
|
|
)
|
|
const styleID = 'hide-home-live-style'
|
|
addSettingsListener('hideHomeLive', value => {
|
|
if (value === true) {
|
|
const style = document.createElement('style')
|
|
style.innerText = `#player-header { display: none !important }`
|
|
style.id = styleID
|
|
document.body.append(style)
|
|
} else {
|
|
const style = document.getElementById(styleID)
|
|
style && style.remove()
|
|
}
|
|
}, true)
|
|
})() |