mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: fix current Url variable undefined issue
This commit is contained in:
@@ -28,25 +28,28 @@ if (isFirefox) {
|
||||
|
||||
injectApp()
|
||||
isFirstScriptExecute = false
|
||||
})
|
||||
// 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)
|
||||
|
||||
const currentUrl = document.URL
|
||||
|
||||
// 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 {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
Reference in New Issue
Block a user