#[non_exhaustive]pub struct ClearCookiesOptions {
pub name: Option<String>,
pub name_regex_source: Option<String>,
pub name_regex_flags: Option<String>,
pub domain: Option<String>,
pub domain_regex_source: Option<String>,
pub domain_regex_flags: Option<String>,
pub path: Option<String>,
pub path_regex_source: Option<String>,
pub path_regex_flags: Option<String>,
}Expand description
Options for filtering which cookies to clear with BrowserContext::clear_cookies().
All fields are optional; when provided they act as AND-combined filters.
Each of name, domain, and path filters by an exact string or by a regular
expression, whichever was set last. A regular expression is matched by the
driver as JavaScript, so its source is JavaScript regex syntax and its
flags are JavaScript flags ("i", "m", "s", "u").
Used by both
BrowserContext::clear_cookies
and
APIRequestContext::clear_cookies.
See: https://playwright.dev/docs/api/class-browsercontext#browser-context-clear-cookies
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: Option<String>Filter by cookie name (exact match).
name_regex_source: Option<String>Filter by cookie name with a regular expression: its source.
name_regex_flags: Option<String>Flags for name_regex_source.
domain: Option<String>Filter by cookie domain.
domain_regex_source: Option<String>Filter by cookie domain with a regular expression: its source.
domain_regex_flags: Option<String>Flags for domain_regex_source.
path: Option<String>Filter by cookie path.
path_regex_source: Option<String>Filter by cookie path with a regular expression: its source.
path_regex_flags: Option<String>Flags for path_regex_source.
Implementations§
Source§impl ClearCookiesOptions
impl ClearCookiesOptions
Sourcepub fn name_regex(
self,
source: impl Into<String>,
flags: impl Into<String>,
) -> Self
pub fn name_regex( self, source: impl Into<String>, flags: impl Into<String>, ) -> Self
Only clear cookies whose name matches the JavaScript regular
expression source with flags ("" for none).