It should be possible to instead just listen for the form submission event. So similar to how they're listening for the form ready event in that thread like so:
window.addEventListener('message', event => {
if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormReady') {
// the form is ready to manipulate!
}
});
...you should also be able to listen for the form submit event like so: