load(simulatedRequest:responseHTML:)
Loads the web content from the HTML you provide as if the HTML were the response to the request.
Declaration
@discardableResult @MainActor final func load(simulatedRequest request: URLRequest, responseHTML htmlString: String) -> some AsyncSequence<WebPage.NavigationEvent, any Error>
Parameters
- request:
A URL request that specifies the base URL and other loading details the system uses to interpret the HTML you provide.
- htmlString:
The HTML code you provide in a string to use as the contents of the webpage.
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.