修改问题

This commit is contained in:
halliday 2025-08-04 16:32:11 +08:00
parent f895ec6aa4
commit ef26e1967f
2 changed files with 8 additions and 4 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/src/.amo-upload-uuid
/src/web-ext-artifacts
/.chrome-debug
/.vscode

View File

@ -369,11 +369,14 @@ ortoni.buildXpath = (element, boolAnchor) => {
// let childNextSibling = element.nextSibling;
let preiousSiblingElement = element.previousElementSibling;
let childElement = element.children;
for (const child of childElement) {
console.log(child); // 只有 <span>,没有 #text
}
// To iterate all attributes xpath
try { xpathAttributes(attributeElement, tagName, element); } catch (e) { }
// Following-sibling push to array
// Following-sibling push to array 根据前一个兄弟节点的对象来定位的
try { xpathFollowingSibling(preiousSiblingElement, tagName); } catch (e) { }
// Text Based xpath
@ -837,7 +840,7 @@ function addPreviousSibling(preSib, tagName) {
case 'robotid':
if (preSib.hasAttribute('robotid')) {
tempvalue = item.value
// 这个获取的是前一个兄弟节点的元素
// 这个获取的是前一个兄弟节点的元素,不能直接推送
// xpathArray.push([2, 'Following sibling based RobotId:', tempvalue])
}
break;