openDocument

Blocks until the configured document is loaded and returns it. Internal API.