From 8110de514edaae5c685282668826bf14db7db557 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 27 Sep 2019 23:14:21 -0400 Subject: Change skipped node types to use a switch statement --- ext/fg/js/source.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ext/fg') 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); -- cgit v1.2.3