We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6a51a0 commit aa59f60Copy full SHA for aa59f60
1 file changed
webextensions/content_scripts/range.js
@@ -299,6 +299,15 @@ function isNodeVisible(node) {
299
if (nodeVisibilityCache.has(node))
300
return nodeVisibilityCache.get(node);
301
302
+ if (typeof node.checkVisibility == 'function') {
303
+ const visible = node.checkVisibility({
304
+ checkOpacity: true,
305
+ checkVisibilityCSS: true
306
+ });
307
+ nodeVisibilityCache.set(node, visible);
308
+ return visible;
309
+ }
310
+
311
// We should return earlier if the node is certainly invisible,
312
// because getClientRects and elementsFromPointElements are slow.
313
if (node.offsetWidth == 0 || node.offsetHeight == 0) {
0 commit comments