diff --git a/4chan_x.user.js b/4chan_x.user.js index af226822a..7e19a717f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3120,7 +3120,10 @@ }, add: function(q, id) { var clonePost, el, i, inline, pathname, root; - root = $.x('ancestor::*[parent::blockquote]', q); + root = q; + while (root.parentNode.nodeName !== 'BLOCKQUOTE') { + root = root.parentNode; + } if (el = $.id("p" + id)) { if (/\bop\b/.test(el.className)) { $.removeClass(el.parentNode, 'qphl'); diff --git a/script.coffee b/script.coffee index f69b1da82..6f036f860 100644 --- a/script.coffee +++ b/script.coffee @@ -2402,8 +2402,12 @@ QuoteInline = @classList.toggle 'inlined' add: (q, id) -> - root = $.x 'ancestor::*[parent::blockquote]', q - if el = $.id "p#{id}" + # Can't use this because Firefox a shit: + # root = $.x 'ancestor::*[parent::blockquote]', q + root = q + while root.parentNode.nodeName isnt 'BLOCKQUOTE' + root = root.parentNode + if el = $.id "p#{id}" if /\bop\b/.test el.className $.removeClass el.parentNode, 'qphl' else