I'm writing a Chrome extension that automatically loads the first chat from the sidebar of the web version of WhatsApp (web.whatsapp.com). Basically the extension waits for a few seconds for the page to load. Then, the script programmatically clicks the first chat item from the sidebar which should load the messages on the main message panel but it never does.
Here's what my snippet looks like:
// Get the sidebar element that holds the chat with the user
let item = document.querySelectorAll("div#pane-side div:first-child")[0];
// Simulate a click
item.click();