You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a loop is used to detect changes within the response of chat gpt. It would be more efficient to register a mutation-observer to track changes. The code is courtesy of Chat-GPT ;-)
// Select target elementvartarget=document.getElementById('my-element');// Set MutationObserver optionsvaroptions={characterData: true,childList: true,subtree: true};// Create MutationObserver instancevarobserver=newMutationObserver(function(mutations){mutations.forEach(function(mutation){// Was the element's content changed?if(mutation.type=='characterData'){console.log('Element content changed!');}});});// Register observerobserver.observe(target,options);
The text was updated successfully, but these errors were encountered:
however, this does not work I don't know why. I have tried impl observer in the first place but switched to the simple loop method... if you are interested, can you explore such an idea and submit a PR?
Currently a loop is used to detect changes within the response of chat gpt. It would be more efficient to register a mutation-observer to track changes. The code is courtesy of Chat-GPT ;-)
The text was updated successfully, but these errors were encountered: