feat: add shadowInfo in highlighter data
This commit is contained in:
@@ -730,15 +730,26 @@ export class WorkflowGenerator {
|
|||||||
const displaySelector = await this.generateSelector(page, coordinates, ActionType.Click);
|
const displaySelector = await this.generateSelector(page, coordinates, ActionType.Click);
|
||||||
const elementInfo = await getElementInformation(page, coordinates, this.listSelector, this.getList);
|
const elementInfo = await getElementInformation(page, coordinates, this.listSelector, this.getList);
|
||||||
if (rect) {
|
if (rect) {
|
||||||
|
const highlighterData = {
|
||||||
|
rect,
|
||||||
|
selector: displaySelector,
|
||||||
|
elementInfo,
|
||||||
|
// Include shadow DOM specific information
|
||||||
|
shadowInfo: elementInfo?.isShadowRoot ? {
|
||||||
|
mode: elementInfo.shadowRootMode,
|
||||||
|
content: elementInfo.shadowRootContent
|
||||||
|
} : null
|
||||||
|
};
|
||||||
|
|
||||||
if (this.getList === true) {
|
if (this.getList === true) {
|
||||||
if (this.listSelector !== '') {
|
if (this.listSelector !== '') {
|
||||||
const childSelectors = await getChildSelectors(page, this.listSelector || '');
|
const childSelectors = await getChildSelectors(page, this.listSelector || '');
|
||||||
this.socket.emit('highlighter', { rect, selector: displaySelector, elementInfo, childSelectors })
|
this.socket.emit('highlighter', { ...highlighterData, childSelectors })
|
||||||
} else {
|
} else {
|
||||||
this.socket.emit('highlighter', { rect, selector: displaySelector, elementInfo });
|
this.socket.emit('highlighter', { ...highlighterData });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.socket.emit('highlighter', { rect, selector: displaySelector, elementInfo });
|
this.socket.emit('highlighter', { ...highlighterData });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user