load(html:baseURL:)
Loads the contents of the specified HTML string and navigates to it.
Declaration
@discardableResult @MainActor final func load(html: String, baseURL: URL = Foundation.URL(string: "about:blank")!) -> some AsyncSequence<WebPage.NavigationEvent, any Error>
Parameters
- html:
The string to use as the contents of the webpage.
- baseURL:
The base URL to use when the system resolves relative URLs within the HTML string. By default, this is
about:blank.
Return Value
An async sequence you use to track the loading progress of the navigation. If the Task enclosing the sequence is cancelled, the page will stop loading all resources.
Discussion
Use this method to navigate to a webpage that you loaded or created yourself. For example, you might use this method to load HTML content that your app generates programmatically.
This method sets the source of this load request for app activity data to NSURLRequest.Attribution.developer.