aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-27 23:14:21 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-28 11:28:15 -0400
commit8110de514edaae5c685282668826bf14db7db557 (patch)
tree59497c14ca119bb8526f689a1ef82f75a54d4762
parent8195e5109b97c284fc1d6c8559de6e5f5941c911 (diff)
Change skipped node types to use a switch statement
-rw-r--r--ext/fg/js/source.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/fg/js/source.js b/ext/fg/js/source.js
index 4642de50..2e73be06 100644
--- a/ext/fg/js/source.js
+++ b/ext/fg/js/source.js
@@ -87,9 +87,11 @@ class TextSourceRange {
return false;
}
- const skip = ['RT', 'SCRIPT', 'STYLE'];
- if (skip.includes(node.nodeName.toUpperCase())) {
- return false;
+ switch (node.nodeName.toUpperCase()) {
+ case 'RT':
+ case 'SCRIPT':
+ case 'STYLE':
+ return false;
}
const style = window.getComputedStyle(node);