I don't know if this is an option... The getMessage api relies on these private functions and it is synchronous. As I understand this the onerror and onload are meant for asynchronous usage (Please correct me if I'm wrong)