feat: rename include_attributes to includeAttributes

This commit is contained in:
Simon
2026-02-02 17:24:08 +08:00
parent f86bb03745
commit 74aea50875
3 changed files with 5 additions and 5 deletions

View File

@@ -194,7 +194,7 @@ export class PageController extends EventTarget {
interactiveBlacklist: blacklist,
})
this.simplifiedHTML = dom.flatTreeToString(this.flatTree, this.config.include_attributes)
this.simplifiedHTML = dom.flatTreeToString(this.flatTree, this.config.includeAttributes)
this.selectorMap.clear()
this.selectorMap = dom.getSelectorMap(this.flatTree)

View File

@@ -10,7 +10,7 @@ import {
export interface DomConfig {
interactiveBlacklist?: (Element | (() => Element))[]
interactiveWhitelist?: (Element | (() => Element))[]
include_attributes?: string[]
includeAttributes?: string[]
highlightOpacity?: number
highlightLabelOpacity?: number
}
@@ -117,7 +117,7 @@ interface TreeNode {
*
* @todo 数据脱敏过滤器
*/
export function flatTreeToString(flatTree: FlatDomTree, include_attributes?: string[]): string {
export function flatTreeToString(flatTree: FlatDomTree, includeAttributes?: string[]): string {
const DEFAULT_INCLUDE_ATTRIBUTES = [
'title',
'type',
@@ -146,7 +146,7 @@ export function flatTreeToString(flatTree: FlatDomTree, include_attributes?: str
'aria-owns',
]
const includeAttrs = [...(include_attributes || []), ...DEFAULT_INCLUDE_ATTRIBUTES]
const includeAttrs = [...(includeAttributes || []), ...DEFAULT_INCLUDE_ATTRIBUTES]
// Helper function to cap text length
const capTextLength = (text: string, maxLength: number): string => {