Closed LeaPhant closed 5 years ago
Great suggestion.
We already use MutationObserver for detecting new chat messages being created via the jquery.initialize plugin (just a wrapper for MO). So we'll just need to refactor our waitForElementAvailablity
function to use that instead of looped timeouts.
Appreciate the input, not sure why we haven't made the switch to MOs all this time.
This has been implemented in v2.3.0
So I noticed sometimes the addon doesn't load correctly cause the chat takes too long to load for me. Instead of doing a loop that checks for the element you could use an Observer on the document that catches any new elements loading.
Relevant lines in code: https://github.com/crowbartools/MixrElixr/blob/010f60417a13456f5b96e24cb7c8f01a51180ab8/src/injected-content/mixrelixr.js#L55-L84
Error I'm experiencing:![image](https://user-images.githubusercontent.com/14080165/62847058-6aa81600-bcd4-11e9-81ea-b715d179bb50.png)