Closed FilmCoder closed 5 years ago
OK, so it shouldn't be TOO complicated assuming every change that is added to the DOM is called by the mutation observer. Then it's just processing each node and slormuxifying it. Like here: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
But say for example a parent DOM node gets added to the DOM, and it has a bunch of children that have children and so forth. If that parent node is the only one called by the mutation observer, then we would need to traverse that tree recursively and slormuxify all text nodes as we traverse.
This could potentially cause an issue where as the user is typing text what they type is being slormuxified on the fly. We don't want that, it would be annoying. But I think we should just kill this issue and see what happens.
Note: If this turns out to be more difficult than anticipated it, it's not core functionality. I'm ready to get this app on the chrome store and onto discord. Don't spend more than an hour on this.
We need all content to be translated as it appears. For example, when scrolling down facebook, we need new posts that are loaded async to be translated as well. This will make translator MUCH more useful, all sorts of websites besides facebook dynamically load content.
These are new DOM nodes dynamically created. Let's try using MutationObserver, useful links here: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord