style: adjust styles

This commit is contained in:
Hakadao
2023-09-19 01:24:51 +08:00
parent 7337e9cb2f
commit dcadbe7e56
3 changed files with 108 additions and 26 deletions

View File

@@ -29,8 +29,23 @@ if (isFirefox) {
injectApp()
isFirstScriptExecute = false
})
window.onload = () => {
document.documentElement.removeChild(beforeLoadedStyleEl)
// Handling for video page to prevent the issue of video being played but the page remaining empty
if (
// video page
/https?:\/\/(www.)?bilibili.com\/video\/.*/.test(currentUrl)
// watch later playlist
|| /https?:\/\/(www.)?bilibili.com\/list\/watchlater.*/.test(currentUrl)
// favorite playlist
|| /https?:\/\/(www.)?bilibili.com\/list\/ml.*/.test(currentUrl)
) {
setTimeout(() => {
document.documentElement.removeChild(beforeLoadedStyleEl)
}, 800)
}
else {
window.onload = () => {
document.documentElement.removeChild(beforeLoadedStyleEl)
}
}
}
else {