fix: bewlybewly does not work on the "www.bilibili.com/index.html" page

This commit is contained in:
Hakadao
2024-03-17 17:46:45 +08:00
parent e6fdbb500d
commit c06f228a75
2 changed files with 7 additions and 8 deletions

View File

@@ -115,11 +115,9 @@ export function delay(ms: number) {
*/
export function isHomePage(): boolean {
if (
/https?:\/\/bilibili.com\/?$/.test(location.href)
|| /https?:\/\/www.bilibili.com\/?$/.test(location.href)
|| /https?:\/\/www.bilibili.com\/index.html$/.test(location.href)
|| /https?:\/\/bilibili.com\/\?spm_id_from=.*/.test(location.href)
|| /https?:\/\/www.bilibili.com\/\?spm_id_from=(.)*/.test(location.href)
/https?:\/\/(www\.)bilibili.com\/?$/.test(location.href)
|| /https?:\/\/(www\.)bilibili.com\/index\.html$/.test(location.href)
|| /https?:\/\/(www\.)?bilibili.com\/\?spm_id_from=(.)*/.test(location.href)
)
return true
return false