Add document_provider to switch between browserDocument and Document