modified: .vscode/launch.json
modified: src/content/content.js deepseek_html_20250427_d3f472.html
This commit is contained in:
parent
64ca41ec90
commit
4a671b5c18
|
@ -10,7 +10,7 @@
|
|||
"request": "launch",
|
||||
"reAttach": true,
|
||||
"addonPath": "${workspaceFolder}//src",
|
||||
"url": "file://${workspaceFolder}/deepseek_html_20250425_ef9a56.html",
|
||||
"url": "file://${workspaceFolder}/deepseek_html_20250427_d3f472.html",
|
||||
"firefoxExecutable": "D:\\Program Files\\Mozilla Firefox\\firefox.exe"
|
||||
}
|
||||
// {
|
||||
|
|
|
@ -606,6 +606,8 @@ function getParent(element, tagName) {
|
|||
var parentId = null;
|
||||
var parentClass = null;
|
||||
var parentName = null;
|
||||
var parentRobotIdXPath = null;
|
||||
var parentRobotId = null;
|
||||
var others = null;
|
||||
Array.prototype.slice.call(attributeElement).forEach(function (item) {
|
||||
if (!(filterAttributesFromElement(item))) {
|
||||
|
@ -613,6 +615,10 @@ function getParent(element, tagName) {
|
|||
case "id":
|
||||
parentId = getParentId(parent, tag)
|
||||
break;
|
||||
case "robotid":
|
||||
parentRobotIdXPath = getParentRobotId(item, tag)
|
||||
parentRobotId = item.value
|
||||
break;
|
||||
case "class":
|
||||
parentClass = getParentClassName(parent, tag)
|
||||
break;
|
||||
|
@ -631,6 +637,10 @@ function getParent(element, tagName) {
|
|||
if (parentId != null && parentId != undefined) {
|
||||
getParentXp(parentId, tagName, 'id', element);
|
||||
}
|
||||
if (parentRobotIdXPath != null && parentRobotIdXPath != undefined) {
|
||||
getParentXp(parentRobotIdXPath, tagName, 'robotid', element);
|
||||
xpathArray.push([1, 'Parent based RobotId is unique:', parentRobotId])
|
||||
}
|
||||
if (parentClass != null && parentClass != undefined) {
|
||||
getParentXp(parentClass, tagName, 'class', element);
|
||||
}
|
||||
|
@ -1205,6 +1215,17 @@ function getParentId(element, tagName) {
|
|||
}
|
||||
else return null;
|
||||
|
||||
}
|
||||
function getParentRobotId(element, tagName) {
|
||||
let clicketItemId = element.value;
|
||||
let re = new RegExp('\\d{' + maxId + ',}', '\g');
|
||||
let matches = re.test(clicketItemId);
|
||||
if ((clicketItemId != null) && (clicketItemId.length > 0) && matches == false) {
|
||||
let temp = `//${tagName}[@robotid='${clicketItemId}']`;
|
||||
return temp;
|
||||
}
|
||||
else return null;
|
||||
|
||||
}
|
||||
function getParentName(element, tagName) {
|
||||
let clickedItemName = element.name;
|
||||
|
|
Loading…
Reference in New Issue