mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
feat: add video card open mode config && open video in drawer (#984)
* feat: video card open mode * update * update * fix: non-homepage show the bewly homepage * fix(video-card): click the more icon will trigger opening drawer effect * feat(video-drawer): improve ui and functionally * feat(i18n): add i18n support for video card link opening behavior setting * chore: reorder settings
This commit is contained in:
@@ -146,15 +146,14 @@ export function delay(ms: number) {
|
||||
|
||||
/**
|
||||
* Check if the current page is the home page
|
||||
* @param url the url to check
|
||||
* @returns true if the current page is the home page
|
||||
*/
|
||||
export function isHomePage(): boolean {
|
||||
export function isHomePage(url: string = location.href): boolean {
|
||||
if (
|
||||
/https?:\/\/(?:www\.)?bilibili.com\/?(?:#\/?)?$/.test(location.href)
|
||||
// https://github.com/hakadao/BewlyBewly/issues/525 #525
|
||||
|| /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)
|
||||
/https?:\/\/(?:www\.)?bilibili.com\/?(?:#\/?)?$/.test(url)
|
||||
|| /https?:\/\/(?:www\.)?bilibili.com\/index\.html$/.test(url)
|
||||
|| /https?:\/\/(?:www\.)?bilibili.com\/\?spm_id_from=.*/.test(url)
|
||||
) {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user