From 39f0474108d6f2b8aedcf4bf452f9cc96aaa2370 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Mon, 16 Dec 2024 01:52:25 +0800 Subject: [PATCH] fix: use new history page --- src/components/TopBar/TopBar.vue | 2 +- src/contentScripts/index.ts | 1 + src/stores/mainStore.ts | 2 +- src/styles/adaptedStyles/index.ts | 5 ++++- src/styles/adaptedStyles/pages/historyPage.scss | 7 +++++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index 05b0cf45..f7ecf364 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -641,7 +641,7 @@ defineExpose({ > diff --git a/src/contentScripts/index.ts b/src/contentScripts/index.ts index 98a92f4f..e2a50c7a 100644 --- a/src/contentScripts/index.ts +++ b/src/contentScripts/index.ts @@ -50,6 +50,7 @@ function isSupportedPages(): boolean { // moment detail || /https?:\/\/(?:www\.)?bilibili\.com\/opus\/.*/.test(currentUrl) // history page + || /https?:\/\/(?:www\.)?bilibili\.com\/history.*/.test(currentUrl) || /https?:\/\/(?:www\.)?bilibili\.com\/account\/history.*/.test(currentUrl) // watcher later page || /https?:\/\/(?:www\.)?bilibili\.com\/watchlater\/#\/list.*/.test(currentUrl) diff --git a/src/stores/mainStore.ts b/src/stores/mainStore.ts index ce3daef5..b662648b 100644 --- a/src/stores/mainStore.ts +++ b/src/stores/mainStore.ts @@ -70,7 +70,7 @@ export const useMainStore = defineStore('main', () => { page: AppPage.History, openInNewTab: false, useOriginalBiliPage: false, - url: `https://www.bilibili.com/account/history`, + url: `https://www.bilibili.com/history`, hasBewlyPage: true, }, { diff --git a/src/styles/adaptedStyles/index.ts b/src/styles/adaptedStyles/index.ts index 4319927e..463f2d1e 100644 --- a/src/styles/adaptedStyles/index.ts +++ b/src/styles/adaptedStyles/index.ts @@ -30,7 +30,10 @@ async function setupStyles() { } // history page 历史记录页 - else if (/https?:\/\/(?:www\.)?bilibili\.com\/account\/history.*/.test(currentUrl)) { + else if ( + /https?:\/\/(?:www\.)?bilibili\.com\/account\/history.*/.test(currentUrl) + || /https?:\/\/(?:www\.)?bilibili\.com\/history.*/.test(currentUrl) + ) { await import('./pages/historyPage.scss') document.documentElement.classList.add('historyPage') } diff --git a/src/styles/adaptedStyles/pages/historyPage.scss b/src/styles/adaptedStyles/pages/historyPage.scss index 9e033c45..c7a78a15 100644 --- a/src/styles/adaptedStyles/pages/historyPage.scss +++ b/src/styles/adaptedStyles/pages/historyPage.scss @@ -1,4 +1,10 @@ .bewly-design.historyPage { + // #region new history page + .history-record.fixed { + position: unset; + } + + // #region old history page // #region theme color adaption part // Increase the priority of the style inside by writing a non-existent selector in `:not()` :not(foobar) { @@ -125,4 +131,5 @@ background-color: var(--bew-content-solid) !important; } } + // #endregion }