From 6a7f1cfe0b6fd45f6d2cda4fb13e1232267ef367 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 18 Aug 2013 08:15:18 -0700 Subject: [PATCH] More or less fix #373 Some parts will be discolored. Not really my fault. --- builds/appchan-x.user.js | 13 ++++++++++--- builds/crx/script.js | 13 ++++++++++--- src/Theming/Style.coffee | 10 +++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 3c61cac56..8f042a66e 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -12144,10 +12144,17 @@ return; } node = nodes[i]; - if ((node.nodeName === 'STYLE' && !node.id) || (("" + node.rel).contains('stylesheet') && !/flags.*\.css$/.test(href = node.href) && href.slice(0, 4) !== 'data')) { - Style.headCount--; - $.rm(node); + if (!(node.nodeName === 'STYLE' && !node.id)) { + continue; } + if (("" + node.rel).contains('stylesheet') && (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) { + continue; + } + if (/\b(\.typeset)/.test(node.textContent)) { + continue; + } + Style.headCount--; + $.rm(node); } }, matrix: function(foreground, background) { diff --git a/builds/crx/script.js b/builds/crx/script.js index ca288010d..74082b8ea 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -12136,10 +12136,17 @@ return; } node = nodes[i]; - if ((node.nodeName === 'STYLE' && !node.id) || (("" + node.rel).contains('stylesheet') && !/flags.*\.css$/.test(href = node.href) && href.slice(0, 4) !== 'data')) { - Style.headCount--; - $.rm(node); + if (!(node.nodeName === 'STYLE' && !node.id)) { + continue; } + if (("" + node.rel).contains('stylesheet') && (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) { + continue; + } + if (/\b(\.typeset)/.test(node.textContent)) { + continue; + } + Style.headCount--; + $.rm(node); } }, matrix: function(foreground, background) { diff --git a/src/Theming/Style.coffee b/src/Theming/Style.coffee index be6950585..6b8b94d1c 100644 --- a/src/Theming/Style.coffee +++ b/src/Theming/Style.coffee @@ -113,9 +113,13 @@ Style = while i-- return unless Style.headCount node = nodes[i] - if (node.nodeName is 'STYLE' and !node.id) or ("#{node.rel}".contains('stylesheet') and !/flags.*\.css$/.test(href = node.href) and href[..3] isnt 'data') - Style.headCount-- - $.rm node + + continue unless node.nodeName is 'STYLE' and !node.id + continue if "#{node.rel}".contains('stylesheet') and (/flags.*\.css$/.test(href = node.href) or href[..3] is 'data') + continue if /\b(\.typeset)/.test node.textContent + + Style.headCount-- + $.rm node return matrix: (foreground, background) ->