Skip to content

Commit

Permalink
merge dev to main, v4.0.12 (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 authored Dec 1, 2024
2 parents 576ce24 + 95c4d7a commit ec329bc
Show file tree
Hide file tree
Showing 118 changed files with 404 additions and 406 deletions.
8 changes: 7 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"recommendations": ["Vue.volar", "bradlc.vscode-tailwindcss"]
"recommendations": [
"Vue.volar",
"bradlc.vscode-tailwindcss",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint",
"dbaeumer.vscode-eslint"
]
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## 4.0.12

- 更新:评论区过滤 增强召唤AI机器人屏蔽
- 更新:评论区过滤 收录更多AI机器人
- 更新:正则模式升级为 ius 模式,支持跨行匹配
- 优化:右键菜单样式

## 4.0.11

- 新增:播放页 展开视频合集第二行标题
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
- 启用 UP 主过滤后,右键单击 UP 主即可屏蔽
- 启用 BV 号过滤后,右键单击视频标题即可屏蔽
- 「标题关键词过滤」和「标题关键词白名单」大小写不敏感,均支持正则
- 正则用 `/ ... /` 括起来,如:`/abc|\d+/`,无需flag(一律默认`iu`模式,大小写不敏感)
- 正则用 `/ ... /` 括起来,如:`/abc|\d+/`,无需flag(默认`ius`模式,大小写不敏感,支持跨行
- 视频过滤在带 `index.html` 后缀的首页不生效,请使用无后缀首页 https://www.bilibili.com/

> [!NOTE]
Expand All @@ -91,7 +91,7 @@
### 3. 评论过滤

- 启用用户名过滤后,在评论区右键单击用户名即可屏蔽
- 关键词黑名单大小写不敏感。支持正则,语法`/abc|\d+/`,无需flag(一律默认`iu`模式)
- 关键词黑名单大小写不敏感。正则语法`/abc|\d+/`,无需flag(默认`ius`模式,大小写不敏感,支持跨行
- **白名单权限高于黑名单,命中白名单的评论不会被隐藏**
- **关键词不宜过于简单**,会误伤很多评论
- **编写正则要慎重**,可能造成大量评论屏蔽和频繁载入
Expand Down Expand Up @@ -126,7 +126,9 @@

- **[Violentmonkey](https://violentmonkey.github.io/)(暴力猴):已测试,推荐**

- [Greasemonkey](https://www.greasespot.net/)[ScriptCat](https://docs.scriptcat.org/) 未测试,不推荐
- **[ScriptCat](https://docs.scriptcat.org/)(脚本猫):支持,部分测试**

- [Greasemonkey](https://www.greasespot.net/) 未测试,不推荐

## 净化效果对比

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"devDependencies": {
"@eslint/js": "^9.12.0",
"@thedutchcoder/postcss-rem-to-px": "^0.0.2",
"@types/node": "^22.10.1",
"@vitejs/plugin-vue": "^5.1.4",
"autoprefixer": "^10.4.20",
"eslint": "^9.12.0",
Expand Down
38 changes: 30 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/components/items/EditorComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
</template>

<script setup lang="ts">
import { IEditorItem } from '@/types/item'
import { error } from '@/utils/logger'
import { BiliCleanerStorage } from '@/utils/storage'
import { orderedUniq } from '@/utils/tool'
import { ref } from 'vue'
import { IEditorItem } from '../../types/item'
import { error } from '../../utils/logger'
import { BiliCleanerStorage } from '../../utils/storage'
import { orderedUniq } from '../../utils/tool'
import PanelComp from '../PanelComp.vue'
import DescriptionComp from './DescriptionComp.vue'
Expand Down
7 changes: 3 additions & 4 deletions src/components/items/ListComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@
</template>

<script setup lang="ts">
import { IListItem } from '@/types/item'
import { error } from '@/utils/logger'
import { BiliCleanerStorage } from '@/utils/storage'
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/vue'
import { CheckIcon, ChevronUpDownIcon } from '@heroicons/vue/20/solid'
import { ref, watch } from 'vue'
import { BiliCleanerStorage } from '../../utils/storage'
import { IListItem } from '../../types/item'
import { error } from '../../utils/logger'
import DescriptionComp from './DescriptionComp.vue'
const item = defineProps<IListItem>()
Expand Down
6 changes: 3 additions & 3 deletions src/components/items/NumberComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
</template>

<script setup lang="ts">
import { INumberItem } from '@/types/item'
import { error } from '@/utils/logger'
import { BiliCleanerStorage } from '@/utils/storage'
import { watchThrottled } from '@vueuse/core'
import { ref } from 'vue'
import { INumberItem } from '../../types/item'
import { error } from '../../utils/logger'
import { BiliCleanerStorage } from '../../utils/storage'
import DescriptionComp from './DescriptionComp.vue'
const item = defineProps<INumberItem>()
Expand Down
6 changes: 3 additions & 3 deletions src/components/items/StringComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</template>

<script setup lang="ts">
import { IStringItem } from '@/types/item'
import { error } from '@/utils/logger'
import { BiliCleanerStorage } from '@/utils/storage'
import { watchThrottled } from '@vueuse/core'
import { ref } from 'vue'
import { IStringItem } from '../../types/item'
import { error } from '../../utils/logger'
import { BiliCleanerStorage } from '../../utils/storage'
import DescriptionComp from './DescriptionComp.vue'
const item = defineProps<IStringItem>()
Expand Down
6 changes: 3 additions & 3 deletions src/components/items/SwitchComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
</template>

<script setup lang="ts">
import { ISwitchItem } from '@/types/item'
import { error } from '@/utils/logger'
import { BiliCleanerStorage } from '@/utils/storage'
import { Switch, SwitchGroup, SwitchLabel } from '@headlessui/vue'
import { ref, watch } from 'vue'
import { ISwitchItem } from '../../types/item'
import { error } from '../../utils/logger'
import { BiliCleanerStorage } from '../../utils/storage'
import DescriptionComp from './DescriptionComp.vue'
const item = defineProps<ISwitchItem>()
Expand Down
8 changes: 4 additions & 4 deletions src/modules/filters/core/core.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import settings from '../../../settings'
import { SubFilterPair } from '../../../types/filter'
import { error } from '../../../utils/logger'
import { hideEle, showEle } from '../../../utils/tool'
import settings from '@/settings'
import { SubFilterPair } from '@/types/filter'
import { error } from '@/utils/logger'
import { hideEle, showEle } from '@/utils/tool'

/**
* 检测元素列表中每个元素是否合法, 隐藏不合法的元素
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/core/subFilters/booleanFilter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ISubFilter, SelectorFn } from '../../../../types/filter'
import { ISubFilter, SelectorFn } from '@/types/filter'

export class BooleanFilter implements ISubFilter {
isEnable = false
Expand Down
10 changes: 5 additions & 5 deletions src/modules/filters/core/subFilters/keywordFilter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ISubFilter, SelectorFn } from '../../../../types/filter'
import { error } from '../../../../utils/logger'
import { ISubFilter, SelectorFn } from '@/types/filter'
import { error } from '@/utils/logger'

export class KeywordFilter implements ISubFilter {
isEnable = false
Expand Down Expand Up @@ -30,7 +30,7 @@ export class KeywordFilter implements ISubFilter {
word = word.replace(/[*+?^${}().|[\]\\]/g, '\\$&') // 转义
}
try {
new RegExp(word, 'iu') // check syntax
new RegExp(word, 'ius') // check syntax

if (/\\\d|\\k</.test(word.replaceAll('\\\\', ''))) {
validBackrefParts.push(word) // check backreference
Expand All @@ -41,10 +41,10 @@ export class KeywordFilter implements ISubFilter {
}
try {
if (validNormalParts.length) {
this.mergedRegExp.push(new RegExp(validNormalParts.join('|'), 'iu'))
this.mergedRegExp.push(new RegExp(validNormalParts.join('|'), 'ius'))
}
for (const regex of validBackrefParts) {
this.mergedRegExp.push(new RegExp(regex, 'iu'))
this.mergedRegExp.push(new RegExp(regex, 'ius'))
}
} catch (err) {
error('keyword filter build RegExp error', err)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/core/subFilters/numberMaxFilter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ISubFilter, SelectorFn } from '../../../../types/filter'
import { ISubFilter, SelectorFn } from '@/types/filter'

export class NumberMaxFilter implements ISubFilter {
isEnable = false
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/core/subFilters/numberMinFilter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ISubFilter, SelectorFn } from '../../../../types/filter'
import { ISubFilter, SelectorFn } from '@/types/filter'

export class NumberMinFilter implements ISubFilter {
isEnable = false
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/core/subFilters/stringFilter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ISubFilter, SelectorFn } from '../../../../types/filter'
import { ISubFilter, SelectorFn } from '@/types/filter'

export class StringFilter implements ISubFilter {
isEnable = false
Expand Down
10 changes: 5 additions & 5 deletions src/modules/filters/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Filter } from '../../types/collection'
import { INumberItem, ISwitchItem } from '../../types/item'
import { error } from '../../utils/logger'
import { Filter } from '@/types/collection'
import { INumberItem, ISwitchItem } from '@/types/item'
import { error } from '@/utils/logger'
import {
isPageBangumi,
isPageChannel,
Expand All @@ -11,8 +11,8 @@ import {
isPageSearch,
isPageSpace,
isPageVideo,
} from '../../utils/pageType'
import { BiliCleanerStorage } from '../../utils/storage'
} from '@/utils/pageType'
import { BiliCleanerStorage } from '@/utils/storage'
import {
commentFilterCommonEntry,
commentFilterCommonGroups,
Expand Down
3 changes: 3 additions & 0 deletions src/modules/filters/variety/comment/extra/bots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ export const bots = [
'AI工具集', // 605801219
'Ai的评论', // 3546740500204293
'AI识片酱', // 1835753760
'AI知识总结', // 3546765074630961
]

export const botsSet = new Set(bots)
Loading

0 comments on commit ec329bc

Please sign in to comment.