async def _remote_load(self, location: URL, remember: bool = True) -> None:
        """Load a Markdown document from a URL.

        Args:
            location: The location to load from.
            remember: Should we remember the location in the history?
        """

        try:
            async with AsyncClient() as client:
                response = await client.get(
                    location,
                    follow_redirects=True,
                    headers={"user-agent": USER_AGENT},
                )
        except RequestError as error:
            self.app.push_screen(ErrorDialog("Error getting document", str(error)))
            return

        try:
            response.raise_for_status()
        except HTTPStatusError as error:
            self.app.push_screen(ErrorDialog("Error getting document", str(error)))
            return

        # There didn't seem to be an error transporting the data, and
        # neither did there seem to be an error with the resource itself. So
        # at this point we should hopefully have the document's content.
        # However... it's possible we've been fooled into loading up
        # something that looked like it was a markdown file, but really it's
        # a web-rendering of such a file; so as a final check we make sure
        # we're looking at something that's plain text, or actually
        # Markdown.
        content_type = response.headers.get("content-type", "")
        if any(
            content_type.startswith(f"text/{sub_type}")
            for sub_type in ("plain", "markdown", "x-markdown")
        ):
            self.document.update(response.text)
            self._post_load(location, remember)
        else:
            # Didn't look like something we could handle with the Markdown
            # viewer. We could throw up an error, or we could just be nice
            # to the user. Let's be nice...
            open_url(str(location))
Load a Markdown document from a URL.

        Args:
            location: The location to load from.
            remember: Should we remember the location in the history?
        
frogmouth/widgets/viewer.py