setContent method

Future<void> setContent(
  1. String html, {
  2. Duration? timeout,
  3. Until? wait,
})

Parameters:

  • html: HTML markup to assign to the page.
  • timeout: Maximum time in milliseconds for resources to load, defaults to 30 seconds, pass 0 to disable timeout. The default value can be changed by using the page.defaultNavigationTimeout or page.defaultTimeout.
  • wait When to consider navigation succeeded, defaults to Until.load. Given an array of event strings, navigation is considered to be successful after all events have been fired. Events can be either:
    • Until.load - consider navigation to be finished when the load event is fired.
    • Until.domContentLoaded - consider navigation to be finished when the DOMContentLoaded event is fired.
    • Until.networkIdle - consider navigation to be finished when there are no more than 0 network connections for at least 500 ms.
    • Until.networkAlmostIdle - consider navigation to be finished when there are no more than 2 network connections for at least 500 ms.

Implementation

Future<void> setContent(String html, {Duration? timeout, Until? wait}) {
  return mainFrame.setContent(html, timeout: timeout, wait: wait);
}