Skip to content

Commit 9219c73

Browse files
committed
Only get display style if not a text node
Fixes #20
1 parent f4bc7c2 commit 9219c73

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/content/content.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ module Content {
118118
}
119119

120120
// Skip all invisible text nodes
121-
var disp = $(element).css('display');
122-
if (element.nodeType != Node.TEXT_NODE &&
123-
(disp == 'none' || disp == 'hidden')) {
124-
return;
121+
if (element.nodeType != Node.TEXT_NODE) {
122+
var disp = $(element).css('display');
123+
if (disp == 'none' || disp == 'hidden') {
124+
return;
125+
}
125126
}
126127

127128
// If the current node has children, recurse to the bottom

0 commit comments

Comments
 (0)