refactor: adjust extension loading effect

This commit is contained in:
Hakadao
2023-08-31 16:26:34 +08:00
parent f80c4e3cc7
commit a36a178985
2 changed files with 11 additions and 1 deletions

View File

@@ -9,6 +9,8 @@ let app: any
const isFirefox: boolean = /Firefox/i.test(navigator.userAgent)
document.documentElement.style.opacity = '0'
// document.documentElement.style.transition = 'opacity .5s ease-in-out'
if (isFirefox) {
let isFirstScriptExecute = true
document.addEventListener('beforescriptexecute', () => {
@@ -16,6 +18,10 @@ if (isFirefox) {
return
injectApp()
setTimeout(() => {
document.documentElement.style.opacity = '1'
// document.documentElement.style.transition = 'unset'
}, 800)
isFirstScriptExecute = false
})
@@ -23,6 +29,10 @@ if (isFirefox) {
else {
document.addEventListener('DOMContentLoaded', () => {
injectApp()
setTimeout(() => {
document.documentElement.style.opacity = '1'
// document.documentElement.style.transition = 'unset'
}, 800)
})
}

View File

@@ -125,7 +125,7 @@ onMounted(() => {
nextTick(() => {
setTimeout(() => {
mainAppOpacity.value = 1
}, 800)
}, 1200)
})
// Force overwrite Bilibili Evolved body tag & html tag background color