@midscene/shared 0.10.6-beta-20250210111859.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/extractor-debug.js +2 -17
- package/dist/browser/extractor.js +2 -17
- package/dist/es/extractor-debug.js +2 -17
- package/dist/es/extractor.js +2 -17
- package/dist/lib/extractor-debug.js +2 -17
- package/dist/lib/extractor.js +2 -17
- package/dist/script/htmlElement.js +2 -17
- package/dist/script/htmlElementDebug.js +2 -17
- package/package.json +1 -1
- package/src/extractor/util.ts +2 -20
|
@@ -864,17 +864,6 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
864
864
|
return false;
|
|
865
865
|
}
|
|
866
866
|
let parent = el;
|
|
867
|
-
const parentUntilNonStatic = (currentNode) => {
|
|
868
|
-
let parent2 = currentNode == null ? void 0 : currentNode.parentElement;
|
|
869
|
-
while (parent2) {
|
|
870
|
-
const style = currentWindow.getComputedStyle(parent2);
|
|
871
|
-
if (style.position !== "static") {
|
|
872
|
-
return parent2;
|
|
873
|
-
}
|
|
874
|
-
parent2 = parent2.parentElement;
|
|
875
|
-
}
|
|
876
|
-
return null;
|
|
877
|
-
};
|
|
878
867
|
while (parent && parent !== currentDocument.body) {
|
|
879
868
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
880
869
|
parent = parent.parentElement;
|
|
@@ -892,14 +881,10 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
892
881
|
return false;
|
|
893
882
|
}
|
|
894
883
|
}
|
|
895
|
-
if (parentStyle.position === "fixed"
|
|
884
|
+
if (parentStyle.position === "fixed") {
|
|
896
885
|
break;
|
|
897
886
|
}
|
|
898
|
-
|
|
899
|
-
parent = parentUntilNonStatic(parent);
|
|
900
|
-
} else {
|
|
901
|
-
parent = parent.parentElement;
|
|
902
|
-
}
|
|
887
|
+
parent = parent.parentElement;
|
|
903
888
|
}
|
|
904
889
|
return {
|
|
905
890
|
left: Math.round(rect.left),
|
|
@@ -1004,17 +1004,6 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
1004
1004
|
return false;
|
|
1005
1005
|
}
|
|
1006
1006
|
let parent = el;
|
|
1007
|
-
const parentUntilNonStatic = (currentNode) => {
|
|
1008
|
-
let parent2 = currentNode == null ? void 0 : currentNode.parentElement;
|
|
1009
|
-
while (parent2) {
|
|
1010
|
-
const style = currentWindow.getComputedStyle(parent2);
|
|
1011
|
-
if (style.position !== "static") {
|
|
1012
|
-
return parent2;
|
|
1013
|
-
}
|
|
1014
|
-
parent2 = parent2.parentElement;
|
|
1015
|
-
}
|
|
1016
|
-
return null;
|
|
1017
|
-
};
|
|
1018
1007
|
while (parent && parent !== currentDocument.body) {
|
|
1019
1008
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
1020
1009
|
parent = parent.parentElement;
|
|
@@ -1032,14 +1021,10 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
1032
1021
|
return false;
|
|
1033
1022
|
}
|
|
1034
1023
|
}
|
|
1035
|
-
if (parentStyle.position === "fixed"
|
|
1024
|
+
if (parentStyle.position === "fixed") {
|
|
1036
1025
|
break;
|
|
1037
1026
|
}
|
|
1038
|
-
|
|
1039
|
-
parent = parentUntilNonStatic(parent);
|
|
1040
|
-
} else {
|
|
1041
|
-
parent = parent.parentElement;
|
|
1042
|
-
}
|
|
1027
|
+
parent = parent.parentElement;
|
|
1043
1028
|
}
|
|
1044
1029
|
return {
|
|
1045
1030
|
left: Math.round(rect.left),
|
|
@@ -862,17 +862,6 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
862
862
|
return false;
|
|
863
863
|
}
|
|
864
864
|
let parent = el;
|
|
865
|
-
const parentUntilNonStatic = (currentNode) => {
|
|
866
|
-
let parent2 = currentNode == null ? void 0 : currentNode.parentElement;
|
|
867
|
-
while (parent2) {
|
|
868
|
-
const style = currentWindow.getComputedStyle(parent2);
|
|
869
|
-
if (style.position !== "static") {
|
|
870
|
-
return parent2;
|
|
871
|
-
}
|
|
872
|
-
parent2 = parent2.parentElement;
|
|
873
|
-
}
|
|
874
|
-
return null;
|
|
875
|
-
};
|
|
876
865
|
while (parent && parent !== currentDocument.body) {
|
|
877
866
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
878
867
|
parent = parent.parentElement;
|
|
@@ -890,14 +879,10 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
890
879
|
return false;
|
|
891
880
|
}
|
|
892
881
|
}
|
|
893
|
-
if (parentStyle.position === "fixed"
|
|
882
|
+
if (parentStyle.position === "fixed") {
|
|
894
883
|
break;
|
|
895
884
|
}
|
|
896
|
-
|
|
897
|
-
parent = parentUntilNonStatic(parent);
|
|
898
|
-
} else {
|
|
899
|
-
parent = parent.parentElement;
|
|
900
|
-
}
|
|
885
|
+
parent = parent.parentElement;
|
|
901
886
|
}
|
|
902
887
|
return {
|
|
903
888
|
left: Math.round(rect.left),
|
package/dist/es/extractor.js
CHANGED
|
@@ -984,17 +984,6 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
984
984
|
return false;
|
|
985
985
|
}
|
|
986
986
|
let parent = el;
|
|
987
|
-
const parentUntilNonStatic = (currentNode) => {
|
|
988
|
-
let parent2 = currentNode == null ? void 0 : currentNode.parentElement;
|
|
989
|
-
while (parent2) {
|
|
990
|
-
const style = currentWindow.getComputedStyle(parent2);
|
|
991
|
-
if (style.position !== "static") {
|
|
992
|
-
return parent2;
|
|
993
|
-
}
|
|
994
|
-
parent2 = parent2.parentElement;
|
|
995
|
-
}
|
|
996
|
-
return null;
|
|
997
|
-
};
|
|
998
987
|
while (parent && parent !== currentDocument.body) {
|
|
999
988
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
1000
989
|
parent = parent.parentElement;
|
|
@@ -1012,14 +1001,10 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
1012
1001
|
return false;
|
|
1013
1002
|
}
|
|
1014
1003
|
}
|
|
1015
|
-
if (parentStyle.position === "fixed"
|
|
1004
|
+
if (parentStyle.position === "fixed") {
|
|
1016
1005
|
break;
|
|
1017
1006
|
}
|
|
1018
|
-
|
|
1019
|
-
parent = parentUntilNonStatic(parent);
|
|
1020
|
-
} else {
|
|
1021
|
-
parent = parent.parentElement;
|
|
1022
|
-
}
|
|
1007
|
+
parent = parent.parentElement;
|
|
1023
1008
|
}
|
|
1024
1009
|
return {
|
|
1025
1010
|
left: Math.round(rect.left),
|
|
@@ -856,17 +856,6 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
856
856
|
return false;
|
|
857
857
|
}
|
|
858
858
|
let parent = el;
|
|
859
|
-
const parentUntilNonStatic = (currentNode) => {
|
|
860
|
-
let parent2 = currentNode == null ? void 0 : currentNode.parentElement;
|
|
861
|
-
while (parent2) {
|
|
862
|
-
const style = currentWindow.getComputedStyle(parent2);
|
|
863
|
-
if (style.position !== "static") {
|
|
864
|
-
return parent2;
|
|
865
|
-
}
|
|
866
|
-
parent2 = parent2.parentElement;
|
|
867
|
-
}
|
|
868
|
-
return null;
|
|
869
|
-
};
|
|
870
859
|
while (parent && parent !== currentDocument.body) {
|
|
871
860
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
872
861
|
parent = parent.parentElement;
|
|
@@ -884,14 +873,10 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
884
873
|
return false;
|
|
885
874
|
}
|
|
886
875
|
}
|
|
887
|
-
if (parentStyle.position === "fixed"
|
|
876
|
+
if (parentStyle.position === "fixed") {
|
|
888
877
|
break;
|
|
889
878
|
}
|
|
890
|
-
|
|
891
|
-
parent = parentUntilNonStatic(parent);
|
|
892
|
-
} else {
|
|
893
|
-
parent = parent.parentElement;
|
|
894
|
-
}
|
|
879
|
+
parent = parent.parentElement;
|
|
895
880
|
}
|
|
896
881
|
return {
|
|
897
882
|
left: Math.round(rect.left),
|
package/dist/lib/extractor.js
CHANGED
|
@@ -996,17 +996,6 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
996
996
|
return false;
|
|
997
997
|
}
|
|
998
998
|
let parent = el;
|
|
999
|
-
const parentUntilNonStatic = (currentNode) => {
|
|
1000
|
-
let parent2 = currentNode == null ? void 0 : currentNode.parentElement;
|
|
1001
|
-
while (parent2) {
|
|
1002
|
-
const style = currentWindow.getComputedStyle(parent2);
|
|
1003
|
-
if (style.position !== "static") {
|
|
1004
|
-
return parent2;
|
|
1005
|
-
}
|
|
1006
|
-
parent2 = parent2.parentElement;
|
|
1007
|
-
}
|
|
1008
|
-
return null;
|
|
1009
|
-
};
|
|
1010
999
|
while (parent && parent !== currentDocument.body) {
|
|
1011
1000
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
1012
1001
|
parent = parent.parentElement;
|
|
@@ -1024,14 +1013,10 @@ function visibleRect(el, currentWindow, currentDocument, baseZoom = 1) {
|
|
|
1024
1013
|
return false;
|
|
1025
1014
|
}
|
|
1026
1015
|
}
|
|
1027
|
-
if (parentStyle.position === "fixed"
|
|
1016
|
+
if (parentStyle.position === "fixed") {
|
|
1028
1017
|
break;
|
|
1029
1018
|
}
|
|
1030
|
-
|
|
1031
|
-
parent = parentUntilNonStatic(parent);
|
|
1032
|
-
} else {
|
|
1033
|
-
parent = parent.parentElement;
|
|
1034
|
-
}
|
|
1019
|
+
parent = parent.parentElement;
|
|
1035
1020
|
}
|
|
1036
1021
|
return {
|
|
1037
1022
|
left: Math.round(rect.left),
|
|
@@ -1004,17 +1004,6 @@ ${indentStr}${after}`;
|
|
|
1004
1004
|
return false;
|
|
1005
1005
|
}
|
|
1006
1006
|
let parent = el;
|
|
1007
|
-
const parentUntilNonStatic = (currentNode) => {
|
|
1008
|
-
let parent2 = currentNode == null ? void 0 : currentNode.parentElement;
|
|
1009
|
-
while (parent2) {
|
|
1010
|
-
const style = currentWindow.getComputedStyle(parent2);
|
|
1011
|
-
if (style.position !== "static") {
|
|
1012
|
-
return parent2;
|
|
1013
|
-
}
|
|
1014
|
-
parent2 = parent2.parentElement;
|
|
1015
|
-
}
|
|
1016
|
-
return null;
|
|
1017
|
-
};
|
|
1018
1007
|
while (parent && parent !== currentDocument.body) {
|
|
1019
1008
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
1020
1009
|
parent = parent.parentElement;
|
|
@@ -1032,14 +1021,10 @@ ${indentStr}${after}`;
|
|
|
1032
1021
|
return false;
|
|
1033
1022
|
}
|
|
1034
1023
|
}
|
|
1035
|
-
if (parentStyle.position === "fixed"
|
|
1024
|
+
if (parentStyle.position === "fixed") {
|
|
1036
1025
|
break;
|
|
1037
1026
|
}
|
|
1038
|
-
|
|
1039
|
-
parent = parentUntilNonStatic(parent);
|
|
1040
|
-
} else {
|
|
1041
|
-
parent = parent.parentElement;
|
|
1042
|
-
}
|
|
1027
|
+
parent = parent.parentElement;
|
|
1043
1028
|
}
|
|
1044
1029
|
return {
|
|
1045
1030
|
left: Math.round(rect.left),
|
|
@@ -865,17 +865,6 @@ var midscene_element_inspector = (() => {
|
|
|
865
865
|
return false;
|
|
866
866
|
}
|
|
867
867
|
let parent = el;
|
|
868
|
-
const parentUntilNonStatic = (currentNode) => {
|
|
869
|
-
let parent2 = currentNode == null ? void 0 : currentNode.parentElement;
|
|
870
|
-
while (parent2) {
|
|
871
|
-
const style = currentWindow.getComputedStyle(parent2);
|
|
872
|
-
if (style.position !== "static") {
|
|
873
|
-
return parent2;
|
|
874
|
-
}
|
|
875
|
-
parent2 = parent2.parentElement;
|
|
876
|
-
}
|
|
877
|
-
return null;
|
|
878
|
-
};
|
|
879
868
|
while (parent && parent !== currentDocument.body) {
|
|
880
869
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
881
870
|
parent = parent.parentElement;
|
|
@@ -893,14 +882,10 @@ var midscene_element_inspector = (() => {
|
|
|
893
882
|
return false;
|
|
894
883
|
}
|
|
895
884
|
}
|
|
896
|
-
if (parentStyle.position === "fixed"
|
|
885
|
+
if (parentStyle.position === "fixed") {
|
|
897
886
|
break;
|
|
898
887
|
}
|
|
899
|
-
|
|
900
|
-
parent = parentUntilNonStatic(parent);
|
|
901
|
-
} else {
|
|
902
|
-
parent = parent.parentElement;
|
|
903
|
-
}
|
|
888
|
+
parent = parent.parentElement;
|
|
904
889
|
}
|
|
905
890
|
return {
|
|
906
891
|
left: Math.round(rect.left),
|
package/package.json
CHANGED
package/src/extractor/util.ts
CHANGED
|
@@ -330,19 +330,6 @@ export function visibleRect(
|
|
|
330
330
|
|
|
331
331
|
// check if the element is hidden by an ancestor
|
|
332
332
|
let parent: HTMLElement | Node | null = el;
|
|
333
|
-
const parentUntilNonStatic = (currentNode: HTMLElement | Node | null) => {
|
|
334
|
-
// find a parent element that is not static
|
|
335
|
-
let parent = currentNode?.parentElement;
|
|
336
|
-
while (parent) {
|
|
337
|
-
const style = currentWindow.getComputedStyle(parent);
|
|
338
|
-
if (style.position !== 'static') {
|
|
339
|
-
return parent;
|
|
340
|
-
}
|
|
341
|
-
parent = parent.parentElement;
|
|
342
|
-
}
|
|
343
|
-
return null;
|
|
344
|
-
};
|
|
345
|
-
|
|
346
333
|
while (parent && parent !== currentDocument.body) {
|
|
347
334
|
if (!(parent instanceof currentWindow.HTMLElement)) {
|
|
348
335
|
parent = parent.parentElement;
|
|
@@ -367,15 +354,10 @@ export function visibleRect(
|
|
|
367
354
|
}
|
|
368
355
|
}
|
|
369
356
|
// if the parent is a fixed element, stop the search
|
|
370
|
-
if (parentStyle.position === 'fixed'
|
|
357
|
+
if (parentStyle.position === 'fixed') {
|
|
371
358
|
break;
|
|
372
359
|
}
|
|
373
|
-
|
|
374
|
-
if (parentStyle.position === 'absolute') {
|
|
375
|
-
parent = parentUntilNonStatic(parent);
|
|
376
|
-
} else {
|
|
377
|
-
parent = parent.parentElement;
|
|
378
|
-
}
|
|
360
|
+
parent = parent.parentElement;
|
|
379
361
|
}
|
|
380
362
|
|
|
381
363
|
return {
|