Open rjmunro opened 8 years ago
Perhaps we could call MutationObserver.takeRecords()
, check the length and then if it is > 0
, call MutationObserver.disconnect()
before trying to observe again.
I've had a look, and this only seems to be an issue if you apply one font, then try to apply another. I think that's pretty edge case, so not really an issue.
Right now, if you try to apply the same font multiple times it's fine.
I think the second change of font triggers the mutationObserver to apply the first change of font again, which then gets stuck in a loop. Possibly 2 mutationObservers are being created, and they fight each other. I'm not quite sure.