diff --git a/LICENSE b/LICENSE index af75349d6..96736fa7e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* appchan x - Version 2.7.4 - 2013-12-27 +* appchan x - Version 2.7.4 - 2014-01-02 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -8,11 +8,11 @@ * http://zixaphir.github.io/appchan-x/ * 4chan x Copyright © 2009-2011 James Campos * https://github.com/aeosynth/4chan-x -* 4chan x Copyright © 2012-2013 Nicolas Stepien +* 4chan x Copyright © 2012-2014 Nicolas Stepien * https://4chan-x.just-believe.in/ -* 4chan x Copyright © 2013-2013 Jordan Bates +* 4chan x Copyright © 2013-2014 Jordan Bates * http://seaweedchan.github.io/4chan-x/ -* 4chan x Copyright © 2012-2013 ihavenoface +* 4chan x Copyright © 2012-2014 ihavenoface * http://ihavenoface.github.io/4chan-x/ * 4chan SS Copyright © 2011-2013 Ahodesuka * https://github.com/ahodesuka/4chan-Style-Script/ diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 0b250adb4..796ccd388 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -22,7 +22,7 @@ // ==/UserScript== /* -* appchan x - Version 2.7.4 - 2013-12-27 +* appchan x - Version 2.7.4 - 2014-01-02 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -31,11 +31,11 @@ * http://zixaphir.github.io/appchan-x/ * 4chan x Copyright © 2009-2011 James Campos * https://github.com/aeosynth/4chan-x -* 4chan x Copyright © 2012-2013 Nicolas Stepien +* 4chan x Copyright © 2012-2014 Nicolas Stepien * https://4chan-x.just-believe.in/ -* 4chan x Copyright © 2013-2013 Jordan Bates +* 4chan x Copyright © 2013-2014 Jordan Bates * http://seaweedchan.github.io/4chan-x/ -* 4chan x Copyright © 2012-2013 ihavenoface +* 4chan x Copyright © 2012-2014 ihavenoface * http://ihavenoface.github.io/4chan-x/ * 4chan SS Copyright © 2011-2013 Ahodesuka * https://github.com/ahodesuka/4chan-Style-Script/ @@ -13198,14 +13198,23 @@ } }, remStyle: function(_arg) { - var addedNodes, href, i, node, _ref; + var addedNodes, href, i, id, node, nodeName, rel, textContent, _ref; addedNodes = _arg.addedNodes; i = addedNodes.length; while (i--) { - node = addedNodes[i]; - if (!(node.nodeName === 'STYLE' && node.id || ((_ref = node.nodeName) !== 'LINK' && _ref !== 'STYLE') || node.rel && (!/stylesheet/.test(node.rel) || /flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data') || /\.typeset/.test(node.textContent))) { - $.rm(node); + _ref = node = addedNodes[i], nodeName = _ref.nodeName, rel = _ref.rel, id = _ref.id, href = _ref.href, textContent = _ref.textContent; + if (nodeName === 'STYLE') { + if (id || /\.typeset/.test(textContent)) { + continue; + } + } else if (nodeName === 'LINK') { + if (rel && (!/stylesheet/.test(rel) || /flags.*\.css$/.test(href) || href.slice(0, 4) === 'data')) { + continue; + } + } else { + continue; } + $.rm(node); } }, generateFilter: function(id, values) { diff --git a/builds/crx/script.js b/builds/crx/script.js index 69cf81263..2e3401223 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* appchan x - Version 2.7.4 - 2013-12-27 +* appchan x - Version 2.7.4 - 2014-01-02 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -9,11 +9,11 @@ * http://zixaphir.github.io/appchan-x/ * 4chan x Copyright © 2009-2011 James Campos * https://github.com/aeosynth/4chan-x -* 4chan x Copyright © 2012-2013 Nicolas Stepien +* 4chan x Copyright © 2012-2014 Nicolas Stepien * https://4chan-x.just-believe.in/ -* 4chan x Copyright © 2013-2013 Jordan Bates +* 4chan x Copyright © 2013-2014 Jordan Bates * http://seaweedchan.github.io/4chan-x/ -* 4chan x Copyright © 2012-2013 ihavenoface +* 4chan x Copyright © 2012-2014 ihavenoface * http://ihavenoface.github.io/4chan-x/ * 4chan SS Copyright © 2011-2013 Ahodesuka * https://github.com/ahodesuka/4chan-Style-Script/ @@ -13208,14 +13208,23 @@ } }, remStyle: function(_arg) { - var addedNodes, href, i, node, _ref; + var addedNodes, href, i, id, node, nodeName, rel, textContent, _ref; addedNodes = _arg.addedNodes; i = addedNodes.length; while (i--) { - node = addedNodes[i]; - if (!(node.nodeName === 'STYLE' && node.id || ((_ref = node.nodeName) !== 'LINK' && _ref !== 'STYLE') || node.rel && (!/stylesheet/.test(node.rel) || /flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data') || /\.typeset/.test(node.textContent))) { - $.rm(node); + _ref = node = addedNodes[i], nodeName = _ref.nodeName, rel = _ref.rel, id = _ref.id, href = _ref.href, textContent = _ref.textContent; + if (nodeName === 'STYLE') { + if (id || /\.typeset/.test(textContent)) { + continue; + } + } else if (nodeName === 'LINK') { + if (rel && (!/stylesheet/.test(rel) || /flags.*\.css$/.test(href) || href.slice(0, 4) === 'data')) { + continue; + } + } else { + continue; } + $.rm(node); } }, generateFilter: function(id, values) { diff --git a/src/Theming/Style.coffee b/src/Theming/Style.coffee index c314bb853..527c7b82a 100644 --- a/src/Theming/Style.coffee +++ b/src/Theming/Style.coffee @@ -90,12 +90,16 @@ Style = remStyle: ({addedNodes}) -> i = addedNodes.length while i-- - node = addedNodes[i] + {nodeName, rel, id, href, textContent} = node = addedNodes[i] - $.rm node unless node.nodeName is 'STYLE' and node.id or - node.nodeName not in ['LINK', 'STYLE'] 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 + if nodeName is 'STYLE' + continue if id or /\.typeset/.test textContent + else if nodeName is 'LINK' + continue if rel and (!/stylesheet/.test(rel) or /flags.*\.css$/.test(href) or href[..3] is 'data') + else + continue + + $.rm node return