$w("#html).onMessage stack messages/runs multiple times in loop

Feel free to share the post here so we can find the answer here as well.