浏览代码

fix: "element visible" condition logic

Ahmad Kholid 3 年之前
父节点
当前提交
9a82ca9c03
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/content/index.js

+ 6 - 2
src/content/index.js

@@ -24,9 +24,13 @@ function handleConditionBuilder({ data, type }) {
     visible: () => {
       const { visibility, display } = getComputedStyle(element);
 
-      return visibility !== 'hidden' || display !== 'none';
+      return visibility !== 'hidden' && display !== 'none';
+    },
+    invisible: () => {
+      const { visibility, display } = getComputedStyle(element);
+
+      return visibility === 'hidden' || display === 'none';
     },
-    invisible: () => !elementActions.visible(element),
     attribute: ({ attrName }) => {
       if (!element.hasAttribute(attrName)) return null;