From fbed325076ac146cc6d9150d90696103f349ff61 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 18 Aug 2013 12:10:20 -0700 Subject: [PATCH] Unbreak my style detection --- builds/appchan-x.user.js | 2 +- builds/crx/script.js | 2 +- src/Theming/Style.coffee | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 93bf2d6cc..bbdbab210 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -12247,7 +12247,7 @@ i = nodes.length; while (i--) { node = nodes[i]; - if (node.nodeName === 'STYLE' && node.id || (/stylesheet/.test(node.rel) && (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) || (/\.typeset/.test(node.textContent))) { + if (node.id || !['STYLE', 'LINK'].contains(node.nodeName) || node.rel && !(/stylesheet/.test(node.rel) || (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) || (/\.typeset/.test(node.textContent))) { continue; } $.rm(node); diff --git a/builds/crx/script.js b/builds/crx/script.js index 306c0718c..08b829bc5 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -12240,7 +12240,7 @@ i = nodes.length; while (i--) { node = nodes[i]; - if (node.nodeName === 'STYLE' && node.id || (/stylesheet/.test(node.rel) && (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) || (/\.typeset/.test(node.textContent))) { + if (node.id || !['STYLE', 'LINK'].contains(node.nodeName) || node.rel && !(/stylesheet/.test(node.rel) || (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) || (/\.typeset/.test(node.textContent))) { continue; } $.rm(node); diff --git a/src/Theming/Style.coffee b/src/Theming/Style.coffee index 204bb9222..a5fd42e05 100644 --- a/src/Theming/Style.coffee +++ b/src/Theming/Style.coffee @@ -98,8 +98,9 @@ Style = while i-- node = nodes[i] - continue if node.nodeName is 'STYLE' and node.id or - (/stylesheet/.test(node.rel) and (/flags.*\.css$/.test(href = node.href) or href[..3] is 'data')) or + continue if node.id or + !['STYLE', 'LINK'].contains(node.nodeName) or + node.rel and !(/stylesheet/.test(node.rel) or (/flags.*\.css$/.test(href = node.href) or href[..3] is 'data')) or (/\.typeset/.test node.textContent) $.rm node return