diff --git a/lib/$.coffee b/lib/$.coffee index 4b2e3d293..5de9784a0 100644 --- a/lib/$.coffee +++ b/lib/$.coffee @@ -97,8 +97,11 @@ $.extend $, el.classList.remove className hasClass: (el, className) -> el.classList.contains className - rm: (el) -> - el.parentNode.removeChild el + rm: do -> + if 'remove' of Element.prototype + (el) -> el.remove() + else + (el) -> el.parentNode?.removeChild el tn: (s) -> d.createTextNode s nodes: (nodes) -> diff --git a/src/features.coffee b/src/features.coffee index abd63d5cf..b077b01f2 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -225,7 +225,7 @@ class Notification setTimeout @close, @timeout * $.SECOND if @timeout close = -> - $.rm @el if @el.parentNode + $.rm @el Settings = init: -> @@ -3798,7 +3798,7 @@ Unread = {root} = post.nodes if root isnt $ '.thread > .replyContainer', root.parentNode # not the first reply $.before root, Unread.hr - else if Unread.hr.parentNode + else $.rm Unread.hr update: <% if (type === 'crx') { %>(dontrepeat) <% } %>->