From c52e8e9ef8cb8e1f07030d64dca68890b0634288 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 2 Aug 2015 01:16:24 -0700 Subject: [PATCH] Work around MutationObserver differences in Edge. --- src/General/lib/$.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index cfc9b9f73..5325ee106 100755 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -117,6 +117,11 @@ $.asap = (test, cb) -> $.onExists = (root, selector, subtree, cb) -> if el = $ selector, root return cb el + # XXX Edge doesn't notify MutationObservers of nodes added as document loads. + if $.engine is 'edge' and d.readyState is 'loading' + $.asap (-> d.readyState isnt 'loading' or $ selector, root), -> + $.onExists root, selector, subtree, cb + return observer = new MutationObserver -> if el = $ selector, root observer.disconnect()