소스 검색

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;