I am trying to trigger the Save Draft function on outlook.com from the browser dev tools console (Later will be used in an userscript).
The issue is that the button doesn't exist until you click the three dots on top of the "New message" form. With the dots clicked and the extra options opened I can run:
Array.from(document.querySelectorAll('button')).find(el => el.textContent === 'Save draft').click()
On the dev tools console, and it works fine. But with the menu closed it doesn't work because the button doesn't exist.
I tried inspecting the element click event, but it seems to be using React (which I know nothing about) and points to an empty function.
Is there a way I could trigger the save draft function directly without having to click the button?