copyWith method

HeadlessBrowserConfig copyWith({
  1. String? userAgent,
  2. bool? javaScriptEnabled,
  3. bool? domStorageEnabled,
  4. bool? mixedContentMode,
  5. bool? cacheEnabled,
  6. int? timeoutMillis,
  7. bool? blockImages,
  8. bool? blockPopups,
  9. Map<String, String>? customHeaders,
  10. bool? clearCookies,
  11. bool? clearCache,
  12. bool? ignoreSSLErrors,
  13. bool? loggingEnabled,
  14. String? url,
  15. Map<String, String>? headers,
  16. int? timeout,
  17. bool? waitForNetworkIdle,
  18. bool? waitForDomContentLoaded,
})

Creates a copy of this configuration with the given fields replaced

Implementation

HeadlessBrowserConfig copyWith({
  String? userAgent,
  bool? javaScriptEnabled,
  bool? domStorageEnabled,
  bool? mixedContentMode,
  bool? cacheEnabled,
  int? timeoutMillis,
  bool? blockImages,
  bool? blockPopups,
  Map<String, String>? customHeaders,
  bool? clearCookies,
  bool? clearCache,
  bool? ignoreSSLErrors,
  bool? loggingEnabled,
  String? url,
  Map<String, String>? headers,
  int? timeout,
  bool? waitForNetworkIdle,
  bool? waitForDomContentLoaded,
}) {
  return HeadlessBrowserConfig(
    userAgent: userAgent ?? this.userAgent,
    javaScriptEnabled: javaScriptEnabled ?? this.javaScriptEnabled,
    domStorageEnabled: domStorageEnabled ?? this.domStorageEnabled,
    mixedContentMode: mixedContentMode ?? this.mixedContentMode,
    cacheEnabled: cacheEnabled ?? this.cacheEnabled,
    timeoutMillis: timeoutMillis ?? this.timeoutMillis,
    blockImages: blockImages ?? this.blockImages,
    blockPopups: blockPopups ?? this.blockPopups,
    customHeaders: customHeaders ?? this.customHeaders,
    clearCookies: clearCookies ?? this.clearCookies,
    clearCache: clearCache ?? this.clearCache,
    ignoreSSLErrors: ignoreSSLErrors ?? this.ignoreSSLErrors,
    loggingEnabled: loggingEnabled ?? this.loggingEnabled,
    url: url ?? this.url,
    headers: headers ?? this.headers,
    timeout: timeout ?? this.timeout,
    waitForNetworkIdle: waitForNetworkIdle ?? this.waitForNetworkIdle,
    waitForDomContentLoaded:
        waitForDomContentLoaded ?? this.waitForDomContentLoaded,
  );
}