selenium-webdriver 4.44.0 → 4.46.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/CHANGES.md +20 -0
- package/bidi/browsingContextInspector.js +1 -1
- package/bidi/generated/bluetooth.d.ts +223 -0
- package/bidi/generated/bluetooth.js +154 -0
- package/bidi/generated/browser.d.ts +104 -0
- package/bidi/generated/browser.js +107 -0
- package/bidi/generated/browsing_context.d.ts +431 -0
- package/bidi/generated/browsing_context.js +280 -0
- package/bidi/generated/common.d.ts +38 -0
- package/bidi/generated/common.js +30 -0
- package/bidi/generated/emulation.d.ts +176 -0
- package/bidi/generated/emulation.js +133 -0
- package/bidi/generated/input.d.ts +151 -0
- package/bidi/generated/input.js +81 -0
- package/bidi/generated/log.d.ts +39 -0
- package/bidi/generated/log.js +67 -0
- package/bidi/generated/network.d.ts +359 -0
- package/bidi/generated/network.js +230 -0
- package/bidi/generated/permissions.d.ts +22 -0
- package/bidi/generated/permissions.js +43 -0
- package/bidi/generated/script.d.ts +410 -0
- package/bidi/generated/script.js +146 -0
- package/bidi/generated/session.d.ts +119 -0
- package/bidi/generated/session.js +82 -0
- package/bidi/generated/speculation.d.ts +17 -0
- package/bidi/generated/speculation.js +40 -0
- package/bidi/generated/storage.d.ts +84 -0
- package/bidi/generated/storage.js +70 -0
- package/bidi/generated/user_agent_client_hints.d.ts +33 -0
- package/bidi/generated/user_agent_client_hints.js +43 -0
- package/bidi/generated/webextension.d.ts +42 -0
- package/bidi/generated/webextension.js +53 -0
- package/bidi/index.js +24 -3
- package/bin/linux/selenium-manager +0 -0
- package/bin/macos/selenium-manager +0 -0
- package/bin/windows/selenium-manager.exe +0 -0
- package/common/driverFinder.js +2 -1
- package/common/seleniumManager.js +1 -1
- package/eslint.config.js +5 -5
- package/io/zip.js +1 -1
- package/lib/atoms/find-elements.js +272 -68
- package/lib/atoms/get-attribute.js +152 -17
- package/lib/atoms/is-displayed.js +385 -39
- package/lib/http.js +2 -1
- package/lib/pinnedScript.js +0 -1
- package/lib/until.js +7 -9
- package/lib/webdriver.js +2 -2
- package/package.json +17 -15
|
@@ -1,40 +1,386 @@
|
|
|
1
1
|
// GENERATED CODE - DO NOT EDIT
|
|
2
|
-
module.exports = function()
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
2
|
+
module.exports = (function isShownElement(elem, optIgnoreOpacity) {
|
|
3
|
+
var tagNameDescriptor = Object.getOwnPropertyDescriptor(Element.prototype, 'tagName');
|
|
4
|
+
var computedStyleCache = new Map();
|
|
5
|
+
var clientRectCache = new Map();
|
|
6
|
+
var displayedCache = new Map();
|
|
7
|
+
function toUpperCaseTag(tagName) {
|
|
8
|
+
return tagName ? tagName.toUpperCase() : undefined;
|
|
9
|
+
}
|
|
10
|
+
function isElement(node, tagName) {
|
|
11
|
+
if (!node || node.nodeType !== 1) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
var asElement = node;
|
|
15
|
+
var rawTagName = tagNameDescriptor && typeof tagNameDescriptor.get === 'function'
|
|
16
|
+
? tagNameDescriptor.get.call(asElement)
|
|
17
|
+
: asElement.tagName;
|
|
18
|
+
var upperTagName = typeof rawTagName === 'string' ? rawTagName.toUpperCase() : '';
|
|
19
|
+
var normalizedTagName = toUpperCaseTag(tagName);
|
|
20
|
+
if (upperTagName === 'FORM') {
|
|
21
|
+
return !normalizedTagName || normalizedTagName === 'FORM';
|
|
22
|
+
}
|
|
23
|
+
return !!upperTagName && (!normalizedTagName || upperTagName === normalizedTagName);
|
|
24
|
+
}
|
|
25
|
+
function getParentElement(node) {
|
|
26
|
+
var current = node.parentNode;
|
|
27
|
+
while (current &&
|
|
28
|
+
current.nodeType !== Node.ELEMENT_NODE &&
|
|
29
|
+
current.nodeType !== Node.DOCUMENT_NODE &&
|
|
30
|
+
current.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {
|
|
31
|
+
current = current.parentNode;
|
|
32
|
+
}
|
|
33
|
+
return current && current.nodeType === 1 ? current : null;
|
|
34
|
+
}
|
|
35
|
+
function getEffectiveStyle(elem, propertyName) {
|
|
36
|
+
var computed = computedStyleCache.get(elem);
|
|
37
|
+
if (computed === undefined) {
|
|
38
|
+
var win = elem.ownerDocument.defaultView;
|
|
39
|
+
computed = win ? (win.getComputedStyle(elem) || null) : null;
|
|
40
|
+
computedStyleCache.set(elem, computed);
|
|
41
|
+
}
|
|
42
|
+
if (!computed) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
var value = computed.getPropertyValue(propertyName);
|
|
46
|
+
return value || null;
|
|
47
|
+
}
|
|
48
|
+
function getOpacity(elem) {
|
|
49
|
+
var opacityStyle = getEffectiveStyle(elem, 'opacity');
|
|
50
|
+
var opacity = opacityStyle ? Number(opacityStyle) : 1;
|
|
51
|
+
var parent = getParentElement(elem);
|
|
52
|
+
return parent ? opacity * getOpacity(parent) : opacity;
|
|
53
|
+
}
|
|
54
|
+
function getParentNodeInComposedDom(node) {
|
|
55
|
+
var parent = node.parentNode;
|
|
56
|
+
var slottable = node;
|
|
57
|
+
var parentWithShadow = parent;
|
|
58
|
+
if (parentWithShadow && parentWithShadow.shadowRoot && slottable.assignedSlot !== undefined) {
|
|
59
|
+
return slottable.assignedSlot ? slottable.assignedSlot.parentNode : null;
|
|
60
|
+
}
|
|
61
|
+
return parent;
|
|
62
|
+
}
|
|
63
|
+
function createRect(left, top, width, height) {
|
|
64
|
+
return {
|
|
65
|
+
left: left,
|
|
66
|
+
top: top,
|
|
67
|
+
right: left + width,
|
|
68
|
+
bottom: top + height,
|
|
69
|
+
width: width,
|
|
70
|
+
height: height,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function getClientRect(elem) {
|
|
74
|
+
var cachedRect = clientRectCache.get(elem);
|
|
75
|
+
if (cachedRect) {
|
|
76
|
+
return cachedRect;
|
|
77
|
+
}
|
|
78
|
+
var rect;
|
|
79
|
+
var imageMap = maybeFindImageMap(elem);
|
|
80
|
+
if (imageMap) {
|
|
81
|
+
rect = imageMap.rect;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
var elemTagName = typeof elem.tagName === 'string' ? elem.tagName : '';
|
|
85
|
+
if (elemTagName.toUpperCase() === 'HTML') {
|
|
86
|
+
var doc = elem.ownerDocument;
|
|
87
|
+
var sizeElem = doc.compatMode === 'CSS1Compat' ? doc.documentElement : (doc.body || doc.documentElement);
|
|
88
|
+
rect = createRect(0, 0, sizeElem.clientWidth, sizeElem.clientHeight);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
try {
|
|
92
|
+
var nativeRect = elem.getBoundingClientRect();
|
|
93
|
+
rect = {
|
|
94
|
+
left: nativeRect.left,
|
|
95
|
+
top: nativeRect.top,
|
|
96
|
+
right: nativeRect.right,
|
|
97
|
+
bottom: nativeRect.bottom,
|
|
98
|
+
width: nativeRect.right - nativeRect.left,
|
|
99
|
+
height: nativeRect.bottom - nativeRect.top,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
catch (_error) {
|
|
103
|
+
rect = createRect(0, 0, 0, 0);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
clientRectCache.set(elem, rect);
|
|
108
|
+
return rect;
|
|
109
|
+
}
|
|
110
|
+
function getAreaRelativeRect(area) {
|
|
111
|
+
var shape = area.shape.toLowerCase();
|
|
112
|
+
var coords = area.coords.split(',').map(function (value) {
|
|
113
|
+
return Number(value.trim());
|
|
114
|
+
});
|
|
115
|
+
if (shape === 'rect' && coords.length === 4) {
|
|
116
|
+
return createRect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
|
|
117
|
+
}
|
|
118
|
+
if (shape === 'circle' && coords.length === 3) {
|
|
119
|
+
return createRect(coords[0] - coords[2], coords[1] - coords[2], coords[2] * 2, coords[2] * 2);
|
|
120
|
+
}
|
|
121
|
+
if (shape === 'poly' && coords.length > 2) {
|
|
122
|
+
var minX = coords[0];
|
|
123
|
+
var minY = coords[1];
|
|
124
|
+
var maxX = minX;
|
|
125
|
+
var maxY = minY;
|
|
126
|
+
for (var index = 2; index + 1 < coords.length; index += 2) {
|
|
127
|
+
minX = Math.min(minX, coords[index]);
|
|
128
|
+
maxX = Math.max(maxX, coords[index]);
|
|
129
|
+
minY = Math.min(minY, coords[index + 1]);
|
|
130
|
+
maxY = Math.max(maxY, coords[index + 1]);
|
|
131
|
+
}
|
|
132
|
+
return createRect(minX, minY, maxX - minX, maxY - minY);
|
|
133
|
+
}
|
|
134
|
+
return createRect(0, 0, 0, 0);
|
|
135
|
+
}
|
|
136
|
+
function findImageUsingMap(mapName, doc) {
|
|
137
|
+
return doc.querySelector('[usemap="#' + mapName.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"]');
|
|
138
|
+
}
|
|
139
|
+
function maybeFindImageMap(elem) {
|
|
140
|
+
var isMap = isElement(elem, 'MAP');
|
|
141
|
+
if (!isMap && !isElement(elem, 'AREA')) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
var map = isMap ? elem : isElement(elem.parentNode, 'MAP') ? elem.parentNode : null;
|
|
145
|
+
var image = null;
|
|
146
|
+
var rect = createRect(0, 0, 0, 0);
|
|
147
|
+
if (isElement(map, 'MAP') && map.name) {
|
|
148
|
+
image = findImageUsingMap(map.name, map.ownerDocument);
|
|
149
|
+
if (image) {
|
|
150
|
+
rect = getClientRect(image);
|
|
151
|
+
if (!isMap && isElement(elem, 'AREA') && elem.shape.toLowerCase() !== 'default') {
|
|
152
|
+
var relativeRect = getAreaRelativeRect(elem);
|
|
153
|
+
var relativeX = Math.min(Math.max(relativeRect.left, 0), rect.width);
|
|
154
|
+
var relativeY = Math.min(Math.max(relativeRect.top, 0), rect.height);
|
|
155
|
+
var width = Math.min(relativeRect.width, rect.width - relativeX);
|
|
156
|
+
var height = Math.min(relativeRect.height, rect.height - relativeY);
|
|
157
|
+
rect = createRect(relativeX + rect.left, relativeY + rect.top, width, height);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return { image: image, rect: rect };
|
|
162
|
+
}
|
|
163
|
+
function getClientRegion(elem) {
|
|
164
|
+
return getClientRect(elem);
|
|
165
|
+
}
|
|
166
|
+
function getOverflowState(elem) {
|
|
167
|
+
var region = getClientRegion(elem);
|
|
168
|
+
var ownerDoc = elem.ownerDocument;
|
|
169
|
+
var htmlElem = ownerDoc.documentElement;
|
|
170
|
+
var bodyElem = ownerDoc.body;
|
|
171
|
+
var htmlOverflowStyle = getEffectiveStyle(htmlElem, 'overflow') || 'visible';
|
|
172
|
+
var treatAsFixedPosition = false;
|
|
173
|
+
function canBeOverflowed(container, position) {
|
|
174
|
+
if (container === htmlElem) {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
var display = getEffectiveStyle(container, 'display') || '';
|
|
178
|
+
if (display.indexOf('inline') === 0 || display === 'contents') {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
if (position === 'absolute' && getEffectiveStyle(container, 'position') === 'static') {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
function getOverflowParent(current) {
|
|
187
|
+
var position = getEffectiveStyle(current, 'position');
|
|
188
|
+
if (position === 'fixed') {
|
|
189
|
+
treatAsFixedPosition = true;
|
|
190
|
+
return current === htmlElem ? null : htmlElem;
|
|
191
|
+
}
|
|
192
|
+
var parent = getParentElement(current);
|
|
193
|
+
while (parent && !canBeOverflowed(parent, position)) {
|
|
194
|
+
parent = getParentElement(parent);
|
|
195
|
+
}
|
|
196
|
+
return parent;
|
|
197
|
+
}
|
|
198
|
+
function getOverflowStyles(current) {
|
|
199
|
+
var overflowElem = current;
|
|
200
|
+
if (htmlOverflowStyle === 'visible') {
|
|
201
|
+
if (current === htmlElem && bodyElem) {
|
|
202
|
+
overflowElem = bodyElem;
|
|
203
|
+
}
|
|
204
|
+
else if (current === bodyElem) {
|
|
205
|
+
return { x: 'visible', y: 'visible' };
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
var overflow = {
|
|
209
|
+
x: getEffectiveStyle(overflowElem, 'overflow-x') || 'visible',
|
|
210
|
+
y: getEffectiveStyle(overflowElem, 'overflow-y') || 'visible',
|
|
211
|
+
};
|
|
212
|
+
if (current === htmlElem) {
|
|
213
|
+
overflow.x = overflow.x === 'visible' ? 'auto' : overflow.x;
|
|
214
|
+
overflow.y = overflow.y === 'visible' ? 'auto' : overflow.y;
|
|
215
|
+
}
|
|
216
|
+
return overflow;
|
|
217
|
+
}
|
|
218
|
+
function getScroll(current) {
|
|
219
|
+
if (current === htmlElem) {
|
|
220
|
+
return {
|
|
221
|
+
x: ownerDoc.defaultView ? ownerDoc.defaultView.pageXOffset : 0,
|
|
222
|
+
y: ownerDoc.defaultView ? ownerDoc.defaultView.pageYOffset : 0,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
return { x: current.scrollLeft, y: current.scrollTop };
|
|
226
|
+
}
|
|
227
|
+
for (var container = getOverflowParent(elem); container; container = getOverflowParent(container)) {
|
|
228
|
+
var containerOverflow = getOverflowStyles(container);
|
|
229
|
+
if (containerOverflow.x === 'visible' && containerOverflow.y === 'visible') {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
var containerRect = getClientRect(container);
|
|
233
|
+
if (containerRect.width === 0 || containerRect.height === 0) {
|
|
234
|
+
return 'hidden';
|
|
235
|
+
}
|
|
236
|
+
var underflowsX = region.right < containerRect.left;
|
|
237
|
+
var underflowsY = region.bottom < containerRect.top;
|
|
238
|
+
if ((underflowsX && containerOverflow.x === 'hidden') || (underflowsY && containerOverflow.y === 'hidden')) {
|
|
239
|
+
return 'hidden';
|
|
240
|
+
}
|
|
241
|
+
if ((underflowsX && containerOverflow.x !== 'visible') || (underflowsY && containerOverflow.y !== 'visible')) {
|
|
242
|
+
var containerScroll = getScroll(container);
|
|
243
|
+
var unscrollableX = region.right < containerRect.left - containerScroll.x;
|
|
244
|
+
var unscrollableY = region.bottom < containerRect.top - containerScroll.y;
|
|
245
|
+
if ((unscrollableX && containerOverflow.x !== 'visible') || (unscrollableY && containerOverflow.y !== 'visible')) {
|
|
246
|
+
return 'hidden';
|
|
247
|
+
}
|
|
248
|
+
var containerUnderflowState = getOverflowState(container);
|
|
249
|
+
return containerUnderflowState === 'hidden' ? 'hidden' : 'scroll';
|
|
250
|
+
}
|
|
251
|
+
var overflowsX = region.left >= containerRect.left + containerRect.width;
|
|
252
|
+
var overflowsY = region.top >= containerRect.top + containerRect.height;
|
|
253
|
+
if ((overflowsX && containerOverflow.x === 'hidden') || (overflowsY && containerOverflow.y === 'hidden')) {
|
|
254
|
+
return 'hidden';
|
|
255
|
+
}
|
|
256
|
+
if ((overflowsX && containerOverflow.x !== 'visible') || (overflowsY && containerOverflow.y !== 'visible')) {
|
|
257
|
+
if (treatAsFixedPosition) {
|
|
258
|
+
var docScroll = getScroll(container);
|
|
259
|
+
if (region.left >= htmlElem.scrollWidth - docScroll.x || region.right >= htmlElem.scrollHeight - docScroll.y) {
|
|
260
|
+
return 'hidden';
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
var containerOverflowState = getOverflowState(container);
|
|
264
|
+
return containerOverflowState === 'hidden' ? 'hidden' : 'scroll';
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return 'none';
|
|
268
|
+
}
|
|
269
|
+
function isShownInternal(elem, ignoreOpacity, displayedFn) {
|
|
270
|
+
if (!isElement(elem)) {
|
|
271
|
+
throw new Error('Argument to isShown must be of type Element');
|
|
272
|
+
}
|
|
273
|
+
if (isElement(elem, 'BODY')) {
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
if (isElement(elem, 'OPTION') || isElement(elem, 'OPTGROUP')) {
|
|
277
|
+
var select = elem.closest('select');
|
|
278
|
+
return !!select && isShownInternal(select, true, displayedFn);
|
|
279
|
+
}
|
|
280
|
+
var imageMap = maybeFindImageMap(elem);
|
|
281
|
+
if (imageMap) {
|
|
282
|
+
return !!imageMap.image && imageMap.rect.width > 0 && imageMap.rect.height > 0 &&
|
|
283
|
+
isShownInternal(imageMap.image, ignoreOpacity, displayedFn);
|
|
284
|
+
}
|
|
285
|
+
if (isElement(elem, 'INPUT') && elem.type.toLowerCase() === 'hidden') {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
if (isElement(elem, 'NOSCRIPT')) {
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
var visibility = getEffectiveStyle(elem, 'visibility');
|
|
292
|
+
if (visibility === 'collapse' || visibility === 'hidden') {
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
if (!displayedFn(elem)) {
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
if (!ignoreOpacity && getOpacity(elem) === 0) {
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
function positiveSize(element) {
|
|
302
|
+
var rect = getClientRect(element);
|
|
303
|
+
if (rect.height > 0 && rect.width > 0) {
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
if (isElement(element, 'PATH') && (rect.height > 0 || rect.width > 0)) {
|
|
307
|
+
var strokeWidth = getEffectiveStyle(element, 'stroke-width');
|
|
308
|
+
return !!strokeWidth && parseInt(strokeWidth, 10) > 0;
|
|
309
|
+
}
|
|
310
|
+
var elementVisibility = getEffectiveStyle(element, 'visibility');
|
|
311
|
+
if (elementVisibility === 'collapse' || elementVisibility === 'hidden') {
|
|
312
|
+
return false;
|
|
313
|
+
}
|
|
314
|
+
if (!displayedFn(element)) {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
if (getEffectiveStyle(element, 'overflow') === 'hidden') {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
for (var index = 0; index < element.childNodes.length; index += 1) {
|
|
321
|
+
var child = element.childNodes[index];
|
|
322
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
323
|
+
var text = child.nodeValue || '';
|
|
324
|
+
if (/^[\s]*$/.test(text) && /[\n\r\t]/.test(text)) {
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
return true;
|
|
328
|
+
}
|
|
329
|
+
if (isElement(child) && positiveSize(child)) {
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
if (!positiveSize(elem)) {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
function hiddenByOverflow(element) {
|
|
339
|
+
if (getOverflowState(element) !== 'hidden') {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
for (var index = 0; index < element.childNodes.length; index += 1) {
|
|
343
|
+
var child = element.childNodes[index];
|
|
344
|
+
if (isElement(child) && !hiddenByOverflow(child) && positiveSize(child)) {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
return !hiddenByOverflow(elem);
|
|
351
|
+
}
|
|
352
|
+
function displayed(node) {
|
|
353
|
+
var cached = displayedCache.get(node);
|
|
354
|
+
if (cached !== undefined) {
|
|
355
|
+
return cached;
|
|
356
|
+
}
|
|
357
|
+
if (isElement(node)) {
|
|
358
|
+
var display = getEffectiveStyle(node, 'display');
|
|
359
|
+
var contentVisibility = getEffectiveStyle(node, 'content-visibility');
|
|
360
|
+
if (display === 'none' || contentVisibility === 'hidden') {
|
|
361
|
+
displayedCache.set(node, false);
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
var parent = getParentNodeInComposedDom(node);
|
|
366
|
+
if (typeof ShadowRoot === 'function' && parent instanceof ShadowRoot) {
|
|
367
|
+
if (parent.host.shadowRoot && parent.host.shadowRoot !== parent) {
|
|
368
|
+
displayedCache.set(node, false);
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
parent = parent.host;
|
|
372
|
+
}
|
|
373
|
+
if (parent && (parent.nodeType === Node.DOCUMENT_NODE || parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE)) {
|
|
374
|
+
displayedCache.set(node, true);
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
if (isElement(parent, 'DETAILS') && !parent.open && !isElement(node, 'SUMMARY')) {
|
|
378
|
+
displayedCache.set(node, false);
|
|
379
|
+
return false;
|
|
380
|
+
}
|
|
381
|
+
var result = !!parent && displayed(parent);
|
|
382
|
+
displayedCache.set(node, result);
|
|
383
|
+
return result;
|
|
384
|
+
}
|
|
385
|
+
return isShownInternal(elem, !!optIgnoreOpacity, displayed);
|
|
386
|
+
});
|
package/lib/http.js
CHANGED
|
@@ -55,10 +55,11 @@ function requireAtom(module, bazelTarget) {
|
|
|
55
55
|
return require(path.resolve(`../../../bazel-bin/${file}`))
|
|
56
56
|
} catch (ex2) {
|
|
57
57
|
log_.severe(ex2)
|
|
58
|
-
throw Error(
|
|
58
|
+
throw new Error(
|
|
59
59
|
`Failed to import atoms module ${module}. If running in dev mode, you` +
|
|
60
60
|
` need to run \`bazel build ${bazelTarget}\` from the project` +
|
|
61
61
|
`root: ${ex}`,
|
|
62
|
+
{ cause: ex2 },
|
|
62
63
|
)
|
|
63
64
|
}
|
|
64
65
|
}
|
package/lib/pinnedScript.js
CHANGED
package/lib/until.js
CHANGED
|
@@ -113,15 +113,13 @@ function alertIsPresent() {
|
|
|
113
113
|
.switchTo()
|
|
114
114
|
.alert()
|
|
115
115
|
.catch(function (e) {
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
-
) {
|
|
116
|
+
if (!(
|
|
117
|
+
e instanceof error.NoSuchAlertError ||
|
|
118
|
+
// XXX: Workaround for GeckoDriver error `TypeError: can't convert null
|
|
119
|
+
// to object`. For more details, see
|
|
120
|
+
// https://github.com/SeleniumHQ/selenium/pull/2137
|
|
121
|
+
(e instanceof error.WebDriverError && e.message === `can't convert null to object`)
|
|
122
|
+
)) {
|
|
125
123
|
throw e
|
|
126
124
|
}
|
|
127
125
|
})
|
package/lib/webdriver.js
CHANGED
|
@@ -1239,7 +1239,7 @@ class WebDriver {
|
|
|
1239
1239
|
* @return {!Promise<resolved>} A new CDP instance.
|
|
1240
1240
|
*/
|
|
1241
1241
|
async createCDPConnection(target) {
|
|
1242
|
-
let debuggerUrl
|
|
1242
|
+
let debuggerUrl
|
|
1243
1243
|
|
|
1244
1244
|
const caps = await this.getCapabilities()
|
|
1245
1245
|
|
|
@@ -1502,7 +1502,7 @@ class WebDriver {
|
|
|
1502
1502
|
null,
|
|
1503
1503
|
)
|
|
1504
1504
|
|
|
1505
|
-
let mutationListener
|
|
1505
|
+
let mutationListener
|
|
1506
1506
|
try {
|
|
1507
1507
|
// Depending on what is running the code it could appear in 2 different places which is why we try
|
|
1508
1508
|
// here and then the other location
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "selenium-webdriver",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.46.0",
|
|
4
4
|
"description": "The official WebDriver JavaScript bindings from the Selenium project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -25,28 +25,30 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@bazel/runfiles": "^6.5.0",
|
|
27
27
|
"jszip": "^3.10.1",
|
|
28
|
-
"tmp": "^0.2.
|
|
29
|
-
"ws": "^8.
|
|
28
|
+
"tmp": "^0.2.7",
|
|
29
|
+
"ws": "^8.21.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@eslint/js": "^
|
|
33
|
-
"
|
|
34
|
-
"
|
|
32
|
+
"@eslint/js": "^10.0.1",
|
|
33
|
+
"cddl": "^0.21.0",
|
|
34
|
+
"cddl2ts": "^0.10.0",
|
|
35
|
+
"clean-jsdoc-theme": "^4.3.3",
|
|
36
|
+
"eslint": "^10.7.0",
|
|
35
37
|
"eslint-config-prettier": "^10.1.8",
|
|
36
|
-
"eslint-plugin-mocha": "^
|
|
37
|
-
"eslint-plugin-n": "^
|
|
38
|
+
"eslint-plugin-mocha": "^11.3.0",
|
|
39
|
+
"eslint-plugin-n": "^18.2.1",
|
|
38
40
|
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
39
|
-
"eslint-plugin-prettier": "^5.5.
|
|
40
|
-
"express": "^
|
|
41
|
-
"globals": "^
|
|
41
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
42
|
+
"express": "^5.2.1",
|
|
43
|
+
"globals": "^17.7.0",
|
|
42
44
|
"has-flag": "^5.0.1",
|
|
43
45
|
"jsdoc": "^4.0.5",
|
|
44
|
-
"mocha": "^11.7.
|
|
46
|
+
"mocha": "^11.7.6",
|
|
45
47
|
"mocha-junit-reporter": "^2.2.1",
|
|
46
|
-
"multer": "2.0
|
|
47
|
-
"prettier": "^3.
|
|
48
|
+
"multer": "^2.2.0",
|
|
49
|
+
"prettier": "^3.9.5",
|
|
48
50
|
"serve-index": "^1.9.2",
|
|
49
|
-
"sinon": "^
|
|
51
|
+
"sinon": "^22.0.0",
|
|
50
52
|
"supports-color": "^10.2.2"
|
|
51
53
|
},
|
|
52
54
|
"scripts": {
|