Skip to content

Commit

Permalink
feat: space page comment filter
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Jul 15, 2024
1 parent 38a6fca commit 17a3b9f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 新增:空间页 动态列表净化
- 新增:空间页 动态列表评论区净化
- 新增:空间页 评论过滤
- 优化:统一处理fetch相关功能

## 3.9.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Group } from '../../../components/group'
import { CheckboxItem, ButtonItem } from '../../../components/item'
import { debugCommentFilter as debug, error } from '../../../utils/logger'
import { isPageDynamic } from '../../../utils/pageType'
import { isPageDynamic, isPageSpace } from '../../../utils/pageType'
import { showEle, waitForEle } from '../../../utils/tool'
import { ContentAction, UsernameAction } from './actions/action'
import coreCommentFilterInstance, { CommentSelectorFunc } from '../filters/core'
Expand All @@ -22,7 +22,7 @@ let isPinnedCommentWhitelistEnable = false
let isNoteCommentWhitelistEnable = false
let isLinkCommentWhitelistEnable = false

if (isPageDynamic()) {
if (isPageDynamic() || isPageSpace()) {
let commentListContainer: HTMLElement
// 一级评论
const rootCommentSelectorFunc: CommentSelectorFunc = {
Expand Down
Empty file.
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { searchPageVideoFilterGroupList } from './filters/videoFilter/pages/sear
import { channelPageVideoFilterGroupList } from './filters/videoFilter/pages/channel'
import { videoPageCommentFilterGroupList } from './filters/commentFilter/pages/video'
import { spacePageVideoFilterGroupList } from './filters/videoFilter/pages/space'
import { dynamicPageCommentFilterGroupList } from './filters/commentFilter/pages/dynamic'
import { dynamicPageCommentFilterGroupList } from './filters/commentFilter/pages/dynamicAndSpace'
import { watchlaterGroupList } from './rules/watchlater'
import { spaceGroupList } from './rules/space'
import { dynamicPageDynFilterGroupList } from './filters/dynFilter/pages/dynamic'
Expand Down Expand Up @@ -148,7 +148,7 @@ const main = async () => {
)
}

if (isPageVideo() || isPageBangumi() || isPagePlaylist() || isPageDynamic()) {
if (isPageVideo() || isPageBangumi() || isPagePlaylist() || isPageDynamic() || isPageSpace()) {
regIDs.push(
GM_registerMenuCommand('✅评论过滤设置', () =>
createPanelWithMode('commentFilter', COMMENT_FILTER_GROUPS),
Expand Down Expand Up @@ -188,7 +188,7 @@ const main = async () => {
)
}
}
if (isPageVideo() || isPageBangumi() || isPagePlaylist() || isPageDynamic()) {
if (isPageVideo() || isPageBangumi() || isPagePlaylist() || isPageDynamic() || isPageSpace()) {
const commentFilterSideBtnID = 'comment-filter-side-btn'
const sideBtn = new SideBtn(commentFilterSideBtnID, '评论过滤', () => {
panel.isShowing ? panel.hide() : createPanelWithMode('commentFilter', COMMENT_FILTER_GROUPS)
Expand Down

0 comments on commit 17a3b9f

Please sign in to comment.