feat: 添加遮罩筛选

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-25 13:02:05 +08:00
co-authored by Copilot
parent d1c5b818d9
commit d82872ad18
7 changed files with 109 additions and 6 deletions
+20
View File
@@ -0,0 +1,20 @@
export const IGNORED_WINDOW_KEYWORDS = [
'NVIDIA Overlay',
'Twinkle Tray Panel'
] as const
const normalizedIgnoredWindowKeywords = IGNORED_WINDOW_KEYWORDS.map(keyword => keyword.toLowerCase())
interface WindowLike {
title?: string | null
path?: string | null
}
export const isIgnoredWindow = ({ title, path }: WindowLike) => {
const normalizedValue = `${title ?? ''}\n${path ?? ''}`.toLowerCase()
return normalizedIgnoredWindowKeywords.some(keyword => normalizedValue.includes(keyword))
}
export const filterIgnoredWindows = <T extends WindowLike>(windows: T[]) => {
return windows.filter(window => !isIgnoredWindow(window))
}