diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d408b8..13fc742 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Install latest nightly uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: nightly override: true components: rustfmt, clippy diff --git a/.gitignore b/.gitignore index ab1c6ae..a864a07 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ target Cargo.lock driver tarpaulin-report.html +/.idea/ +/playwright-rust-randall.iml +/scripts/scripts.iml +/src/api/generated.rs diff --git a/.rustfmt.toml b/.rustfmt.toml index cff415c..9061e9e 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,4 +1,4 @@ -edition = "2018" +edition = "2021" unstable_features = true fn_single_line = true trailing_comma = "Never" diff --git a/Cargo.toml b/Cargo.toml index cff97a3..e1d9305 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://docs.rs/playwright/" repository = "https://github.com/octaltree/playwright-rust" categories = ["web-programming"] keywords = ["testing", "headless", "web", "browser", "automation"] -edition = "2018" +edition = "2021" build = "src/build.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -20,23 +20,24 @@ reqwest = { version = "0.11.4", features = ["blocking"] } log = "0.4.14" serde = { version = "1.0.126", features = ["derive"] } serde_json = "1.0.66" -zip = "0.5.13" +zip = "0.6.4" thiserror = "1.0.26" strong = { version = "0.3.4", features = ["serde", "shorthand"] } tokio = { version = "1.9.0", features = ["sync", "rt-multi-thread", "macros"] } actix-rt = { version = "2.2.0", optional = true } async-std = { version = "1.9.0", features = ["attributes"], optional = true } -dirs = "3.0.2" +dirs = "5.0.0" paste = "1.0.5" -base64 = "0.13.0" +base64 = "0.21.0" itertools = "0.10.1" chrono = { version = "0.4.19", optional = true, features = ["serde"] } tokio-stream = { version = "0.1.7", features = ["sync"] } futures = "0.3.16" -serde_with = { version = "1.9.4", default-features = false, features = ["macros"] } +serde_with = { version = "2.3.2", default-features = false, features = ["macros"] } +parking_lot = "0.12.1" [dev-dependencies] -env_logger = "0.9.0" +env_logger = "0.10.0" tempdir = "0.3.7" tide = "0.16.0" warp = "0.3.1" diff --git a/scripts/Cargo.toml b/scripts/Cargo.toml index 24260a2..43a4bdd 100644 --- a/scripts/Cargo.toml +++ b/scripts/Cargo.toml @@ -8,14 +8,20 @@ edition = "2018" [dependencies] anyhow = "1.0.41" case = "1.0.0" +itertools = "0.10.3" proc-macro2 = "1.0.27" quote = "1.0.9" serde = { version = "1.0.126", features = ["derive"] } serde_json = "1.0.64" +serde_yaml = "0.9.2" [[bin]] -name = "gen" -path = "src/gen.rs" +name = "generate_api" +path = "src/generate_api.rs" + +[[bin]] +name = "generate_protocol" +path = "src/generate_protocol.rs" [[bin]] name = "diff" diff --git a/scripts/Makefile b/scripts/Makefile index a042b06..777db3b 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -1,9 +1,25 @@ -../src/api/generated.rs: ../src/api/api.json - rustfmt --emit stdout <(cargo run --bin gen < $^)| tail +3 > $@ - sed -i 's/\[actionability\](.\/actionability.md)/[actionability](https:\/\/playwright.dev\/docs\/actionability\/)/g' $@ +.PHONY: clean nop +nop: + +SRC=$(shell find src) + +clean_driver: + rm -r /tmp/build-playwright-rust + rm -r ~/.cache/ms-playwright/playwright-rust ../src/api/api.json: ../src/build.rs cd .. && cargo run print-api-json |jq > src/api/api.json +../src/protocol/protocol.yml: ../src/api/api.json + cp ~/.cache/ms-playwright/playwright-rust/driver/package/protocol.yml $@ + +../src/api/generated.rs: ../src/api/api.json ${SRC} + cargo run --bin generate_api < $< > $@ + rustfmt +nightly --config-path ../.rustfmt.toml $@ + +../src/protocol/generated.rs: ../src/protocol/protocol.yml ${SRC} + cat $<| sed 's#null#"null"#'| cargo run --bin generate_protocol > $@ + rustfmt +nightly --config-path ../.rustfmt.toml $@ + diff: - cargo run --bin diff <(git show master:src/api/api.json) <(git show HEAD:src/api/api.json) + cargo run --bin diff <(git show master:src/api/api.json) ../src/api/api.json diff --git a/scripts/driver_commit.sh b/scripts/driver_commit.sh new file mode 100644 index 0000000..c556469 --- /dev/null +++ b/scripts/driver_commit.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# find commit corresponding to the driver +# use in latest main of playwright + +function check(){ + [ `same_protocol` -ne 0 ] || [ `same_api` -ne 0 ] +} + +function same_protocol(){ + diff ~/.cache/ms-playwright/playwright-rust/driver/package/protocol.yml packages/playwright-core/src/protocol/protocol.yml| wc -l +} + +function same_api(){ + API_JSON_MODE=1 node utils/doclint/generateApiJson.js > ./output/api.json + diff ~/.cache/ms-playwright/playwright-rust/driver/package/api.json output/api.json| wc -l +} + +while check; do + git checkout HEAD~ +done diff --git a/scripts/src/api.rs b/scripts/src/api.rs new file mode 100644 index 0000000..94b57cd --- /dev/null +++ b/scripts/src/api.rs @@ -0,0 +1,214 @@ +pub mod types; + +use serde::{Deserialize, Deserializer, Serialize}; + +#[derive(Debug, Deserialize)] +#[serde(transparent)] +pub struct Api(pub Vec); + +#[derive(Debug, Deserialize)] +pub struct Interface { + pub name: String, + // langs + //#[serde(default)] + // pub comment: String, + pub spec: Vec, + pub members: Vec, + pub extends: Option +} + +/// ex. {"name": "toMatchSnapshot#2", "alias": "toMatchSnapshot", "overloadIndex": 1} +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Member { + pub kind: Kind, + pub name: String, + pub alias: String, + pub experimental: bool, + pub since: String, + pub overload_index: usize, + pub required: bool, + #[serde(rename = "async")] + pub is_async: bool, + pub args: Vec, + #[serde(rename = "type")] + pub ty: Type, + // langs + // paramOrOption null + #[serde(default)] + #[serde(deserialize_with = "string_as_bool")] + pub deprecated: bool, + //#[serde(default)] + // pub comment: String, + pub spec: Vec +} + +fn string_as_bool<'de, D>(deserializer: D) -> Result + where + D: Deserializer<'de>, +{ + let s = ::deserialize(deserializer); + Ok(match s { + Err(_) => false, + _ => true + }) +} + + +#[derive(Debug, Deserialize, PartialEq, Eq, Clone, Copy)] +#[serde(rename_all = "camelCase")] +pub enum Kind { + Event, + Method, + Property +} + +#[derive(Debug, PartialEq, Deserialize, Serialize, Eq, Clone)] +pub struct Type { + pub name: String, + #[serde(default)] + pub expression: Option, + #[serde(default)] + pub properties: Vec, + #[serde(default)] + pub templates: Vec, + #[serde(default)] + pub union: Vec +} + +#[derive(Debug, PartialEq, Deserialize, Serialize, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct Arg { + pub name: String, + pub kind: ArgKind, + pub alias: String, + #[serde(rename = "type")] + pub ty: Type, + pub langs: Langs, + // experimental + // paramOrOption + pub since: String, + pub overload_index: usize, + // pub comment: String, + #[serde(default)] + pub spec: Vec, + pub required: bool, + #[serde(default)] + #[serde(deserialize_with = "string_as_bool")] + pub deprecated: bool, + #[serde(rename = "async")] + pub is_async: bool +} + +#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone, Copy)] +#[serde(rename_all = "camelCase")] +pub enum ArgKind { + Property +} + +#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)] +#[serde(tag = "type")] +#[serde(rename_all = "camelCase")] +pub enum SpecNode { + Text { + text: String + }, + Code { + #[serde(rename = "codeLang")] + lang: String, + lines: Vec + }, + Li { + #[serde(rename = "liType")] + li_type: LiType, + text: String + }, + Note { + #[serde(rename = "noteType")] + note_type: NoteType, + text: String + } +} + +#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone, Copy)] +#[serde(rename_all = "camelCase")] +pub enum LiType { + Bullet, + Ordinal +} + +#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone, Copy)] +#[serde(rename_all = "camelCase")] +pub enum NoteType { + #[serde(rename = "caution Discouraged")] + CautionDiscouraged, + Caution, + Note, + Warning +} + +#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct Langs { + pub only: Option> +} + +#[cfg(test)] +mod tests { + use super::*; + use std::fs; + + #[test] + fn all_api_types() { + let mut types = Vec::new(); + fn add<'a>(dest: &mut Vec<&'a Type>, t: &'a Type) { + let Type { + name, + expression: _, + properties, + templates, + union + }: &Type = t; + dest.push(t); + for arg in properties { + add(dest, &arg.ty); + } + for ty in templates { + add(dest, ty); + } + for ty in union { + add(dest, ty); + } + } + let s = fs::read_to_string("../src/api/api.json").unwrap(); + let api: Api = serde_json::from_str(&s).unwrap(); + for interface in &api.0 { + for member in &interface.members { + for arg in &member.args { + add(&mut types, &arg.ty); + } + add(&mut types, &member.ty); + } + } + println!("{}", serde_json::to_string(&types).unwrap()); + } + + #[test] + fn parse() { + let xs:Vec = serde_json::from_str(r#" + [{ + "type": "text", + "text": "Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page." + }, + { + "type": "note", + "noteType": "note", + "text": "The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`." + }, + { + "type": "text", + "text": "An example of dumping the entire accessibility tree:" + }] + "#).unwrap(); + } +} diff --git a/scripts/src/api/types.rs b/scripts/src/api/types.rs new file mode 100644 index 0000000..33e2f4d --- /dev/null +++ b/scripts/src/api/types.rs @@ -0,0 +1,496 @@ +use super::{Arg, Interface, Kind, Member, Type}; +use crate::utils; +use case::CaseExt; +use itertools::Itertools; +use std::{ + borrow::Cow, + collections::{HashMap, HashSet, VecDeque}, + rc::Rc +}; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum Model { + Struct { + name: String, + orig: Type, + fields: Vec<(String, Rc)>, + /// memoization + has_reference: bool + }, + Enum { + name: String, + orig: Type, + variants: Vec, + has_reference: bool + }, + Option(Rc), + Vec(Rc), + Map(Rc, Rc), + Known { + name: Cow<'static, str>, + reference: bool + } +} + +#[derive(Debug, Clone)] +pub struct Method<'a> { + pub orig: &'a Member, + pub args: Vec<(String, Rc)>, + pub builder: Option>, + pub ty: Rc +} + +#[derive(Debug, Clone)] +pub struct Event<'a> { + pub orig: Vec<&'a Member>, + pub model: Rc, + pub which: Rc +} + +impl Model { + pub fn maybe_option(&self) -> Option<&Model> { + match self { + Model::Option(x) => Some(x), + _ => None + } + } +} + +impl<'a> Event<'a> { + fn new_dummy() -> Self { + Self { + orig: vec![], + model: Rc::new(Model::Known { + name: Cow::Borrowed(""), + reference: false + }), + which: Rc::new(Model::Known { + name: Cow::Borrowed(""), + reference: false + }) + } + } +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Variant { + pub label: String, + pub orig: String, + pub data: Option> +} + +impl Model { + fn orig(&self) -> Option<&Type> { + match self { + Self::Struct { orig, .. } => Some(orig), + Self::Enum { orig, .. } => Some(orig), + _ => None + } + } + + pub fn has_reference(&self) -> bool { + match self { + Model::Struct { has_reference, .. } => *has_reference, + Model::Enum { has_reference, .. } => *has_reference, + Model::Option(x) => x.has_reference(), + Model::Vec(x) => x.has_reference(), + Model::Map(k, v) => k.has_reference() || v.has_reference(), + Model::Known { reference, .. } => *reference + } + } +} + +pub fn is_action_csharp(a: &Arg) -> bool { + let for_csharp = if let Some(only) = &a.langs.only { + only.len() == 1 && only[0] == "csharp" + } else { + false + }; + a.name == "action" && for_csharp +} + +pub fn collect_types<'a>(x: &'a Interface) -> (Vec>, Vec>, Option>) { + let mut top = Vec::new(); + let mut methods = Vec::new(); + let mut event = Event::new_dummy(); + let mut event_types = Vec::new(); + for member in &x.members { + let mut args = Vec::new(); + let mut builder_properties = Vec::new(); + let needs_builder = needs_builder(member); + let mut handle_arg = |arg: &Arg| { + let ty = declare_ty(vec![&member.name, &arg.name], &arg.ty, true); + match (needs_builder, arg.required) { + (true, true) => { + builder_properties.push((utils::loud_to_snake(&arg.name), ty.clone())); + } + (true, false) => { + builder_properties.push(( + utils::loud_to_snake(&arg.name), + Rc::new(Model::Option(ty.clone())) + )); + } + (false, true) => { + args.push((arg.name.clone(), ty.clone())); + } + (false, false) => () + } + top.push(ty); + }; + for arg in &member.args { + if is_action_csharp(arg) { + continue; + } + if arg.name == "options" { + for p in &arg.ty.properties { + handle_arg(p); + } + } else { + handle_arg(arg); + } + } + let builder = if needs_builder { + let has_reference = builder_properties.iter().any(|(_, p)| p.has_reference()); + let b = Rc::new(Model::Struct { + name: format!( + "{}Builder", + utils::loud_to_camel(&member.name.to_camel().replace("#", "")) + ), + orig: Type { + name: "".into(), + expression: None, + properties: vec![], + templates: vec![], + union: vec![] + }, + fields: builder_properties, + has_reference + }); + top.push(b.clone()); + Some(b) + } else { + None + }; + let ty = declare_ty(vec![&member.name], &member.ty, false); + top.push(ty.clone()); + match member.kind { + Kind::Method | Kind::Property => { + methods.push(Method { + orig: member, + args, + builder, + ty + }); + } + Kind::Event => { + event.orig.push(member); + event_types.push(ty); + } + } + } + event_model(&mut event, event_types); + let mut que: VecDeque<_> = top.into(); + let mut all = Vec::new(); + while let Some(x) = que.pop_front() { + all.push(x.clone()); + match &*x { + Model::Struct { fields, .. } => { + for (_, m) in fields { + que.push_back(m.clone()); + } + } + Model::Enum { variants, .. } => { + for Variant { data: m, .. } in variants { + if let Some(m) = m { + que.push_back(m.clone()); + } + } + } + Model::Vec(x) | Model::Option(x) => que.push_back(x.clone()), + Model::Map(k, x) => { + que.push_back(k.clone()); + que.push_back(x.clone()); + } + Model::Known { .. } => {} + } + } + let types = all.into_iter().filter(|t| t.orig().is_some()).collect(); + let event = if event.orig.is_empty() { + None + } else { + Some(event) + }; + (types, methods, event) +} + +fn maybe_builder(member: &Member) -> Option> { + if !needs_builder(member) { + return None; + } + let properties = member + .args + .iter() + .flat_map(|arg| { + if arg.name == "options" { + arg.ty.properties.clone() + } else { + vec![arg.clone()] + } + }) + .filter(|arg| !is_action_csharp(arg)) + .collect(); + Some(declare_ty( + vec![&member.name, "builder"], + &Type { + name: "builder".into(), + expression: None, + properties, + templates: vec![], + union: vec![] + }, + true + )) +} + +/// has two or more optional values +pub fn needs_builder(member: &Member) -> bool { + let args = &member.args; + let mut xs = args.iter().filter(|a| !a.required).chain( + args.iter() + .filter(|a| a.name == "options" && !a.ty.properties.is_empty()) + .flat_map(|a| a.ty.properties.iter()) + ); + xs.next().and(xs.next()).is_some() +} + +fn declare_ty<'a>(scope: Vec<&'a str>, ty: &'a Type, allow_borrow: bool) -> Rc { + if ty.union.is_empty() { + match (ty.properties.is_empty(), ty.templates.is_empty()) { + (true, true) => Rc::new(match &*ty.name { + "binary" => Model::Known { + name: Cow::Borrowed("binary"), + reference: allow_borrow + }, + "json" => Model::Known { + name: Cow::Borrowed("json"), + reference: allow_borrow + }, + "number" => Model::Known { + name: Cow::Borrowed("number"), + reference: false + }, + "float" => Model::Known { + name: Cow::Borrowed("float"), + reference: false + }, + "string" => Model::Known { + name: Cow::Borrowed("string"), + reference: allow_borrow + }, + "boolean" => Model::Known { + name: Cow::Borrowed("boolean"), + reference: false + }, + "void" => Model::Known { + name: Cow::Borrowed("void"), + reference: false + }, + x => Model::Known { + name: Cow::Owned(utils::loud_to_camel(x)), + reference: false + } + }), + (false, true) => { + let name = scope + .iter() + .map(|s| utils::loud_to_camel(&s.to_camel().replace("#", ""))) + .join(""); + let fields = ty + .properties + .iter() + .map(|p| { + let field_name = utils::loud_to_snake(&p.name); + let mut tmp = scope.clone(); + tmp.push(&p.name); + let t = declare_ty(tmp, &p.ty, allow_borrow); + ( + field_name, + if p.required { + t + } else { + Rc::new(Model::Option(t)) + } + ) + }) + .collect::>(); + let has_reference = fields + .iter() + .map(|(_, m)| m.has_reference()) + .fold(false, |a, b| a || b); + Rc::new(Model::Struct { + name, + orig: ty.clone(), + fields, + has_reference + }) + } + (true, false) if ty.name == "Func" => unreachable!("{:?}", &ty), + (true, false) if ty.name == "Array" => { + assert_eq!(ty.templates.len(), 1); + let t = &ty.templates[0]; + Rc::new(Model::Vec(declare_ty(scope, t, allow_borrow))) + } + (true, false) => { + let option = ty.expression.as_deref(); + assert!( + option + == Some("[IReadOnlyDictionary]") + || option == Some("[Map]<[string], [JSHandle]>") + || option == Some("[Map]") + || option == Some("[Object]<[string], [string]>") + || option + == Some("[Object]<[string], [string]|[float]|[boolean]>") + || option == Some("[Object]<[string], [Serializable]>") + || option == Some("[Object]<[string], [any]>"), + "{:?}", + &ty + ); + assert_eq!(ty.templates.len(), 2); + Rc::new(Model::Map( + declare_ty(scope.clone(), &ty.templates[0], allow_borrow), + declare_ty(scope, &ty.templates[1], allow_borrow) + )) + } + (false, false) => { + assert_eq!( + ty.expression.as_deref(), + Some("[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>") + ); + assert_eq!(ty.templates.len(), 2); + Rc::new(Model::Map( + declare_ty(scope.clone(), &ty.templates[0], allow_borrow), + declare_ty(scope, &ty.templates[1], allow_borrow) + )) + } + } + } else { + let variants = ty.union.iter().filter(|t| t.name != "null"); + let num_variants = variants.clone().count(); + match num_variants { + 0 => unreachable!(), + 1 => { + let mut vs = variants; + let t = vs.next().unwrap(); + if t.name.contains("\"") { + return declare_enum(scope, ty, allow_borrow); + } + declare_ty(scope, t, allow_borrow) + } + _ => declare_enum(scope, ty, allow_borrow) + } + } +} + +fn declare_enum<'a>(scope: Vec<&'a str>, ty: &'a Type, allow_borrow: bool) -> Rc { + assert_eq!(ty.properties, &[]); + assert_eq!(ty.templates, &[]); + let name = scope.iter().fold(String::new(), |mut a, b| { + a.push_str(&utils::loud_to_camel(&b.replace("#", "").to_camel())); + a + }); + let variants = ty + .union + .iter() + .filter(|t| t.name != "null") + .map(|t| { + if t.name.contains("\"") { + let name = t.name.replace("\"", ""); + let label = utils::kebab_to_camel(&name); + Variant { + orig: name, + label, + data: None + } + } else { + let name = &t.name; + let label = utils::kebab_to_camel(&name); + let mut tmp = scope.clone(); + tmp.push(name); + Variant { + orig: name.to_string(), + label, + data: Some(declare_ty(tmp, t, allow_borrow)) + } + } + }) + .collect::>(); + let has_reference = variants + .iter() + .map(|v| { + v.data + .as_ref() + .map(|data| data.has_reference()) + .unwrap_or_default() + }) + .fold(false, |a, b| a || b); + Rc::new(Model::Enum { + name, + orig: ty.clone(), + variants, + has_reference + }) +} + +fn event_model(event: &mut Event, models: Vec>) { + event.model = Rc::new(Model::Enum { + name: "Event".into(), + orig: Type { + name: "Event".into(), + expression: None, + properties: vec![], + templates: vec![], + union: event.orig.iter().map(|member| member.ty.clone()).collect() + }, + variants: event + .orig + .iter() + .zip(models.iter()) + .map(|(member, model)| { + let data = match &**model { + Model::Known { + name: Cow::Borrowed("void"), + .. + } => None, + _ => Some(model.clone()) + }; + Variant { + label: utils::loud_to_camel(&member.name.to_camel().replace("#", "")), + orig: member.name.clone(), + data + } + }) + .collect(), + has_reference: false + }); + event.which = Rc::new(Model::Enum { + name: "EventType".into(), + orig: Type { + name: "EventType".into(), + expression: None, + properties: vec![], + templates: vec![], + union: event.orig.iter().map(|member| member.ty.clone()).collect() + }, + variants: event + .orig + .iter() + .zip(models.iter()) + .map(|(member, model)| Variant { + label: utils::loud_to_camel(&member.name.to_camel().replace("#", "")), + orig: member.name.clone(), + data: None + }) + .collect(), + has_reference: false + }); +} diff --git a/scripts/src/gen.rs b/scripts/src/gen.rs deleted file mode 100644 index 79bc2c4..0000000 --- a/scripts/src/gen.rs +++ /dev/null @@ -1,535 +0,0 @@ -#[macro_use] -extern crate serde; - -use case::CaseExt; -use proc_macro2::{Ident, TokenStream}; -use quote::{format_ident, quote, ToTokens, TokenStreamExt}; - -fn main() { - let api: Api = serde_json::from_reader(std::io::stdin()).unwrap(); - let t = api.into_token_stream(); - println!("{}\n// vim: foldnestmax=0 ft=rust", t); -} - -fn escape(s: &str) -> String { - match s { - // keywords https://doc.rust-lang.org/book/appendix-01-keywords.html - "as" | "async" | "await" | "break" | "const" | "continue" | "crate" | "dyn" | "else" - | "enum" | "extern" | "false" | "fn" | "for" | "if" | "impl" | "in" | "let" | "loop" - | "match" | "mod" | "move" | "mut" | "pub" | "ref" | "return" | "Self" | "self" - | "static" | "struct" | "super" | "trait" | "true" | "type" | "union" | "unsafe" - | "use" | "where" | "while" => { - format!("r#{}", s) - } - // reserved - "abstract" | "become" | "box" | "do" | "final" | "macro" | "override" | "priv" | "try" - | "typeof" | "unsized" | "virtual" | "yield" => { - format!("r#{}", s) - } - _ => s.into() - } -} - -#[derive(Debug, Deserialize)] -struct Api(Vec); - -#[derive(Debug, Deserialize)] -struct Interface { - name: String, - // langs - // spec - #[serde(default)] - comment: String, - members: Vec, - extends: Option -} - -#[derive(Debug, Deserialize)] -struct Member { - kind: Kind, - name: String, - // langs - // alias - r#type: Type, - // spec - #[serde(default)] - comment: String, - required: bool, - deprecated: bool, - #[serde(rename = "async")] - is_async: bool, - args: Vec -} - -#[derive(Debug, Deserialize, PartialEq, Eq, Clone, Copy)] -#[serde(rename_all = "camelCase")] -enum Kind { - Event, - Method, - Property -} - -#[derive(Debug, Deserialize)] -struct Type { - // 30 ('event', dict_keys(['name', 'expression'])) - // 2 ('event', dict_keys(['name', 'properties', 'expression'])) - // 4 ('event', dict_keys(['name'])) - // 151 ('method', dict_keys(['name', 'expression'])) - // 3 ('method', dict_keys(['name', 'properties', 'expression'])) - // 23 ('method', dict_keys(['name', 'templates', 'expression'])) - // 44 ('method', dict_keys(['name', 'union', 'expression'])) - // 132 ('method', dict_keys(['name'])) - // 10 ('property', dict_keys(['name', 'expression'])) - // 1 ('property', dict_keys(['name', 'properties', 'expression'])) - // 1 ('property', dict_keys(['name', 'union', 'expression'])) - - // 9 dict_keys(['name', 'args', 'returnType', 'expression']) - // 220 dict_keys(['name', 'expression']) - // 10 dict_keys(['name', 'properties', 'expression']) - // 150 dict_keys(['name', 'properties']) - // 9 dict_keys(['name', 'templates', 'expression']) - // 54 dict_keys(['name', 'union', 'expression']) - name: String, - #[serde(default)] - return_type: Option>, - #[serde(default)] - expression: Option, - #[serde(default)] - properties: Vec, - #[serde(default)] - templates: Vec, - #[serde(default)] - union: Vec -} - -#[derive(Debug, Deserialize)] -struct Arg { - name: String, - kind: ArgKind, - // langs - // alias - r#type: Type, - // spec - comment: String, - required: bool, - deprecated: bool, - #[serde(rename = "async")] - is_async: bool -} - -#[derive(Debug, Deserialize, PartialEq, Eq, Clone, Copy)] -#[serde(rename_all = "camelCase")] -enum ArgKind { - Property -} - -impl ToTokens for Api { - fn to_tokens(&self, tokens: &mut TokenStream) { tokens.append_all(&self.0); } -} - -impl ToTokens for Interface { - fn to_tokens(&self, tokens: &mut TokenStream) { tokens.extend(self.body()); } -} - -impl Interface { - fn body(&self) -> TokenStream { - let name = self.name(); - let extends = self.extends.as_deref().map(|e| { - let e = format!("Extends {}", e); - quote! { #[doc=#e] } - }); - let comment = &self.comment; - let methods = self.methods(); - let properties = self.properties(); - let events = self.events(); - let declares = self.collect_declares(); - quote! { - #[doc = #comment] - #extends - impl #name { - #properties - #methods - } - #declares - #events - } - } - - fn name(&self) -> Ident { - if self.name == "JSHandle" { - return format_ident!("JsHandle"); - } - format_ident!("{}", &self.name) - } - - // fn extends(&self) -> Option { - // self.extends.as_ref().map(|e| { - // let e = format_ident!("{}", e); - // quote! { :#e } - // }) - //} - - fn properties(&self) -> TokenStream { - let ps = self - .members - .iter() - .filter(|m| m.kind == Kind::Property) - .map(|m| Property { - name: &self.name, - body: m - }); - quote! { - #(#ps)* - } - } - - fn methods(&self) -> TokenStream { - let ms = self - .members - .iter() - .filter(|m| m.kind == Kind::Method) - .map(|m| Method { - name: &self.name, - body: m - }); - quote! { - #(#ms)* - } - } - - fn events(&self) -> TokenStream { - let es = self - .members - .iter() - .filter(|x| x.kind == Kind::Event) - .map(|x| Event { - name: &self.name, - body: x - }); - if es.clone().next().is_none() { - return quote! {}; - } - let labels = es.clone().map(|e| { - let label = format_ident!("{}", e.body.name.to_camel()); - let comment = &e.body.comment; - quote! { - #[doc=#comment] - #label - } - }); - let bodies = es.map(|e| { - let label = format_ident!("{}", e.body.name.to_camel()); - let t = &e.body.r#type; - let comment = &e.body.comment; - quote! { - #[doc=#comment] - #label(#t) - } - }); - let et = format_ident!("{}EventType", self.name); - let e = format_ident!("{}Event", self.name); - quote! { - enum #et { - #(#labels),* - } - enum #e { - #(#bodies),* - } - } - } - - fn collect_declares(&self) -> TokenStream { - let mut res: TokenStream = quote! {}; - for member in &self.members { - res.extend(member.r#type.declare(&member.name)); - for arg in member.args.iter().filter(|a| a.name != "options") { - res.extend(arg.r#type.declare(&arg.name)); - } - } - res - } -} - -struct Event<'a, 'b> { - name: &'a str, - body: &'b Member -} -struct Method<'a, 'b> { - name: &'a str, - body: &'b Member -} -struct Property<'a, 'b> { - name: &'a str, - body: &'b Member -} - -impl ToTokens for Method<'_, '_> { - fn to_tokens(&self, tokens: &mut TokenStream) { - let name = self.name(); - let comment = &self.body.comment; - let ty = &self.body.r#type; - let err = if self.body.is_async { - quote! {Arc} - } else { - quote! {Error} - }; - let required = self - .body - .args - .iter() - .filter(|a| a.required) - .map(|a| a.with_colon()); - let opts = self - .body - .args - .iter() - .filter(|a| !a.required && a.name != "options") - .map(|a| a.with_colon_option()); - let options = self - .body - .args - .iter() - .filter(|a| !a.required && a.name == "options") - .map(|a| { - let xs = a.r#type.properties.iter().map(|a| a.with_colon_option()); - quote! { #[doc = "options"] #(#xs),* } - }); - let all = required.chain(opts).chain(options); - tokens.extend(quote! { - #[doc = #comment] - fn #name(&self, #(#all),*) -> Result<#ty, #err> { todo!() } - }); - } -} - -impl Method<'_, '_> { - fn name(&self) -> Ident { format_ident!("{}", escape(&self.body.name.to_snake())) } -} - -impl ToTokens for Property<'_, '_> { - fn to_tokens(&self, tokens: &mut TokenStream) { - let name = self.name(); - let comment = &self.body.comment; - let ty = &self.body.r#type; - tokens.extend(quote! { - #[doc = #comment] - pub fn #name(&self) -> #ty {} - }); - } -} - -impl Property<'_, '_> { - fn name(&self) -> Ident { format_ident!("{}", &self.body.name.to_snake()) } -} - -impl ToTokens for Type { - fn to_tokens(&self, tokens: &mut TokenStream) { - if self.return_type.is_some() { - tokens.extend(self.function()); - return; - } - if !self.templates.is_empty() { - tokens.extend(match self.name.as_str() { - "Array" => self.array(), - "Object" | "Map" => self.map(), - _ => unreachable!() - }); - return; - } - if !self.properties.is_empty() { - if self.name.is_empty() || self.name == "Object" { - tokens.extend(quote! { NotImplementedYet }); - } else { - unreachable!(); - } - return; - } - if !self.union.is_empty() { - let optional = self.union.iter().find(|u| u.name == "null"); - if self.name.is_empty() { - let t = self.r#enum(); - tokens.extend(optional.map(|_| quote! { Option<#t> }).unwrap_or(t)); - } else { - let name = format_ident!("{}", self.name); - let name = quote! { #name }; - tokens.extend(optional.map(|_| quote! { Option<#name> }).unwrap_or(name)); - } - return; - } - match self.name.as_str() { - "" => { - unreachable!() - } - "Object" => { - tokens.extend(quote! { Object }); - return; - } - "void" => { - tokens.extend(quote! { () }); - return; - } - "string" => { - tokens.extend(quote! { String }); - return; - } - "boolean" => { - tokens.extend(quote! { bool }); - return; - } - "JSHandle" => { - tokens.extend(quote! { JsHandle }); - return; - } - "int" => { - tokens.extend(quote! { i64 }); - return; - } - "float" => { - tokens.extend(quote! { f64 }); - return; - } - // any Any Serializable path - n => { - let name = if n == "System.Net.HttpStatusCode" { - format_ident!("u16") - } else if n == r#""gone""# { - format_ident!("Gone") - } else if n.starts_with('"') && n.ends_with('"') { - // TODO - format_ident!("{}", n[1..(n.len() - 1)]) - } else { - format_ident!("{}", n) - }; - tokens.extend(quote! { - #name - }); - return; - } - } - } -} - -impl Type { - fn function(&self) -> TokenStream { - let ret = self.return_type.as_ref().unwrap(); - quote! { - impl Fn(NotImplementedYet) -> #ret - } - } - - fn array(&self) -> TokenStream { - let t = self.templates.iter().next().unwrap(); - quote! { - Vec<#t> - } - } - - fn map(&self) -> TokenStream { - let fst = self.templates.iter().next().unwrap(); - let snd = self.templates.iter().next().unwrap(); - quote! { - Map<#fst, #snd> - } - } - - fn r#enum(&self) -> TokenStream { - let mut entries = self.union.iter().filter(|u| u.name != "null"); - let num = entries.clone().count(); - match num { - 0 => unreachable!(), - 1 => { - let first = entries.next().unwrap(); - quote! { #first } - } - _ => { - quote! { - NotImplementedYet - } - } - } - } - - // TODO: recursive - fn declare(&self, hint: &str) -> Option { - if !self.properties.is_empty() && self.name != "function" { - let name = format_ident!("NotImplementedYet{}", hint); - let required = self - .properties - .iter() - .filter(|a| a.required) - .map(|a| a.with_colon()); - let opts = self - .properties - .iter() - .filter(|a| !a.required) - .map(|a| a.with_colon_option()); - let all = required.chain(opts); - let nested = self - .properties - .iter() - .map(|a| a.r#type.declare(&a.name)) - .fold(quote! {}, |mut a, b| { - a.extend(b); - a - }); - return Some(quote! { - struct #name { - #(#all),* - } - #nested - }); - } else if !self.union.is_empty() { - let name = format_ident!("NotImplementedYet{}", hint); - let not_null = self.union.iter().filter(|u| u.name != "null"); - if not_null.clone().count() <= 1 { - return None; - } - let nested = not_null - .clone() - .map(|t| t.declare("")) - .fold(quote! {}, |mut a, b| { - a.extend(b); - a - }); - let xs = not_null.map(|t| { - quote! { NotImplementedYet(#t) } - }); - return Some(quote! { - enum #name { - #(#xs),* - } - #nested - }); - } - None - } -} - -impl Arg { - fn with_colon(&self) -> TokenStream { - let name = self.name(); - let ty = &self.r#type; - let comment = &self.comment; - quote! { - #[doc = #comment] - #name: #ty - } - } - - fn with_colon_option(&self) -> TokenStream { - let name = self.name(); - let ty = &self.r#type; - let comment = &self.comment; - quote! { - #[doc = #comment] - #name: Option<#ty> - } - } - - fn name(&self) -> Ident { format_ident!("{}", escape(&self.name.to_snake())) } -} - -#[test] -fn case() { - assert_eq!("handleSIGINT".to_snake(), "handle_s_i_g_i_n_t"); -} diff --git a/scripts/src/generate_api.rs b/scripts/src/generate_api.rs new file mode 100644 index 0000000..5ebe541 --- /dev/null +++ b/scripts/src/generate_api.rs @@ -0,0 +1,302 @@ +use case::CaseExt; +use proc_macro2::TokenStream; +use quote::{format_ident, quote, TokenStreamExt}; +use scripts::{ + api::{types::Model, *}, + utils +}; +use std::collections::HashMap; + +fn main() { + let api: Api = serde_json::from_reader(std::io::stdin()).unwrap(); + let t = to_tokens(&api); + println!("{}\n// vim: foldnestmax=0 ft=rust", t); +} + +fn to_tokens(api: &Api) -> TokenStream { + let mut tokens = TokenStream::default(); + tokens.append_all(api.0.iter().map(body)); + tokens +} + +fn body(x: &Interface) -> TokenStream { + let name = format_ident!("{}", utils::loud_to_camel(&x.name)); + let mod_name = format_ident!("{}", utils::loud_to_camel(&x.name).to_snake()); + let extends = x.extends.as_deref().map(|e| { + let e = format!("Extends {}", e); + quote! { #[doc=#e] } + }); + let (sub, methods, event) = types::collect_types(x); + let builders = methods + .iter() + .filter(|method| method.builder.is_some()) + .map(|method| builder_tokens(method)); + let sub = sub.iter().map(|m| format_ty(&*m)); + let _overload_targets: HashMap<&str, Vec<&types::Method>> = methods + .iter() + .filter(|m| m.orig.overload_index > 0) + .fold(HashMap::new(), |mut a, b| { + a.entry(&*b.orig.alias) + .and_modify(|xs| xs.push(b)) + .or_insert(vec![b]); + a + }); + let methods = methods + .iter() + .filter(|m| m.orig.overload_index == 0) + .map(|m| { + // let overloads = overload_targets.remove(&*m.orig.alias); + method_tokens(m/*, overloads*/) + }); + let events = event.map(|event| event_tokens(event)); + quote! { + mod #mod_name { + #extends + impl #name { + #(#methods)* + } + #events + #(#sub)* + #(#builders)* + } + } +} + +fn format_ty(x: &types::Model) -> TokenStream { + match x { + Model::Struct { + name, + orig: _, + fields, + has_reference + } => { + let n = format_ident!("{}", name); + let lifetime = has_reference.then(|| quote!(<'a>)); + let fields = fields.iter().map(|(k, v)| { + let n = format_ident!("{}", k); + let v = format_use_ty(v); + quote! { + #n: #v + } + }); + quote! { + struct #n #lifetime { + #(#fields),* + } + } + } + Model::Enum { + name, + orig: _, + variants, + has_reference + } => { + let n = format_ident!("{}", name); + let lifetime = has_reference.then(|| quote!(<'a>)); + let variants = variants.iter().map(|variant| { + let n = format_ident!("{}", variant.label); + if let Some(x) = &variant.data { + let v = format_use_ty(x); + quote! { + #n (#v) + } + } else { + quote! { + #n + } + } + }); + quote! { + enum #n #lifetime { + #(#variants),* + } + } + } + _ => { + quote! {} + } + } +} + +fn format_use_ty(x: &types::Model) -> TokenStream { + let reference = x.has_reference(); + let lifetime = reference.then(|| quote!(<'a>)); + match x { + Model::Struct { name, .. } => { + let n = format_ident!("{}", name); + quote! {#n #lifetime} + } + Model::Enum { name, .. } => { + let n = format_ident!("{}", name); + quote! {#n #lifetime} + } + Model::Option(y) => { + let y = format_use_ty(y); + quote!(Option<#y>) + } + Model::Vec(y) => { + let y = format_use_ty(y); + quote!(Vec<#y>) + } + Model::Map(y, z) => { + let y = format_use_ty(y); + let z = format_use_ty(z); + quote!(HashMap<#y, #z>) + } + Model::Known { name, .. } => { + match name.as_ref() { + "binary" if reference => quote!(&'a [u8]), + "binary" => quote!(Vec), + "json" if reference => quote!(&'a str), + "json" => quote!(String), + "string" if reference => quote!(&'a str), + "string" => quote!(String), + "number" => quote!(serde_json::Number), + "float" => quote!(f64), + "boolean" => quote!(bool), + "void" => quote!(()), + "JsonElement?" => quote!(()), + _ => { + let n = format_ident!("{}", name); + assert!(!reference); + quote!(#n) + } + } + } + } +} + +fn event_tokens(event: types::Event) -> TokenStream { + let types::Event { orig: _, model, which } = event; + let model = format_ty(&*model); + let which = format_ty(&*which); + quote! { + #model + #which + } +} + +fn method_tokens(method: &types::Method) -> TokenStream { + let types::Method { + orig: + Member { + kind: _, + name, + alias, + experimental, + since: _, + overload_index: _, + required, + is_async, + args: _member_args, + ty: _member_ty, + deprecated, + spec: _spec // TODO + }, + args, + builder, + ty + } = method; + let is_builder = builder.is_some(); + assert!(name == alias || name.starts_with(alias), "{}", name); + let rety = format_use_ty(builder.as_deref().unwrap_or(&*ty)); + let _arg_fields = args.iter().map(|(name, model)| { + let name = format_ident!("{}", name); + let ty = format_use_ty(model); + quote! { + #name: #ty + } + }); + let fn_name = if is_builder { + format_ident!( + "{}_builder", + utils::loud_to_camel(&name.replace("#", "")).to_snake() + ) + } else { + format_ident!("{}", utils::loud_to_snake(&name.replace("#", ""))) + }; + let mark_async = (!is_builder && *is_async) + .then(|| quote!(async)) + .unwrap_or_default(); + let doc_unnecessary = (!required) + .then(|| quote!(#[doc="unnecessary"])) + .unwrap_or_default(); + let doc_experimental = experimental + .then(|| quote!(#[doc="experimental"])) + .unwrap_or_default(); + let mark_deprecated = deprecated + .then(|| quote!(#[deprecated])) + .unwrap_or_default(); + quote! { + #doc_unnecessary + #doc_experimental + #mark_deprecated + #mark_async fn #fn_name() -> #rety { + todo!() + } + } +} + +fn builder_tokens(method: &types::Method) -> TokenStream { + let (name, _orig, fields, has_reference) = match method.builder.as_deref() { + Some(Model::Struct { + name, + orig, + fields, + has_reference + }) => (name, orig, fields, has_reference), + _ => return quote! {} + }; + let ident = format_ident!("{}", name); + let lifetime = has_reference.then(|| quote!(<'a>)); + let new_fields = fields + .iter() + .filter(|(_, model)| model.maybe_option().is_none()) + .map(|(name, model)| { + let ident = format_ident!("{}", name); + let ty = format_use_ty(model); + quote! { + #ident: #ty + } + }); + let execute = format_ident!( + "{}", + utils::loud_to_snake(&method.orig.name.replace("#", "")) + ); + let ty = format_use_ty(&method.ty); + let setter_fields = fields + .iter() + .filter(|(_, model)| model.maybe_option().is_some()) + .map(|(name, model)| { + let ident = format_ident!("{}", name); + // let ty = format_use_ty(model); + let inner_ty = format_use_ty(model.maybe_option().unwrap()); + let clear = format_ident!("clear_{}", name.replace("r#", "")); + // TODO: doc + quote! { + #[allow(clippy::wrong_self_convention)] + pub fn #ident(mut self, x: #inner_ty) -> Self { + self.args.#ident = Some(x); + self + } + + pub fn #clear(mut self) -> Self { + self.args.#ident = None; + self + } + } + }); + quote! { + impl #lifetime #ident #lifetime { + pub(crate) fn new(inner: Weak, #(#new_fields),*) -> Self { + todo!() + } + + pub fn #execute(self) -> #ty { + todo!() + } + + #(#setter_fields)* + } + } +} diff --git a/scripts/src/generate_protocol.rs b/scripts/src/generate_protocol.rs new file mode 100644 index 0000000..960bb40 --- /dev/null +++ b/scripts/src/generate_protocol.rs @@ -0,0 +1,393 @@ +use case::CaseExt; +use proc_macro2::TokenStream; +use quote::{format_ident, quote, TokenStreamExt}; +use scripts::{protocol::*, utils}; + +fn main() { + let protocol: Protocol = serde_yaml::from_reader(std::io::stdin()).unwrap(); + let t = to_tokens(&protocol); + let g = quote! { + use crate::imp::core::OnlyGuid; + pub(crate) type Channel = OnlyGuid; + fn is_default (v: &T) -> bool where T: PartialEq + Default { + T::default().eq(v) + } + }; + println!("{}\n{}\n// vim: foldnestmax=0 ft=rust", g, t); +} + +fn to_tokens(protocol: &Protocol) -> TokenStream { + let mut xs = protocol.0.iter().collect::>(); + xs.sort_by_key(|&(name, n)| match n { + Node::Interface(_) => (1, name), + Node::Object(_) => (2, name), + // partial type of object + Node::Mixin(_) => (3, name), + // sum type is compound but literals is primitive + Node::Enum(_) => (4, name) + }); + let mut tokens = TokenStream::default(); + tokens.append_all(xs.into_iter().map(|(name, node)| node_tokens(name, node))); + tokens +} + +fn node_tokens(name: &str, node: &Node) -> TokenStream { + match node { + Node::Enum(x) => enum_tokens(name, x), + Node::Object(x) | Node::Mixin(x) => object_tokens(name, x), + Node::Interface(x) => interface_tokens(name, x) + } +} + +fn enum_tokens(name: &str, x: &Enum) -> TokenStream { + let variants = x + .literals + .iter() + .map(|s| { + let (variant, is_normalized) = { + let raw = utils::kebab_to_camel(s); + (format_ident!("{}", raw), s != &raw) + }; + let orig = is_normalized + .then(|| quote!(#[serde(rename=#s)])) + .unwrap_or_default(); + quote! { + #orig + #variant + } + }) + .collect::>(); + let name = format_ident!("{}", name); + quote! { + #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Hash)] + pub enum #name { + #(#variants),* + } + } +} + +/// for rooted named object +fn object_tokens(name: &str, x: &Object) -> TokenStream { + child_object_tokens(name, &x.properties, false) +} + +/// for inner unnamed object +/// recursion of declare_object +fn child_object_tokens(name: &str, x: &Properties, borrow: bool) -> TokenStream { + let declare = declare_object(name, x, borrow); + let x = { + let mut x = x.iter().collect::>(); + x.sort_by_cached_key(|&(name, _)| name); + x + }; + let sub = x + .iter() + .map(|&(field_name, ty)| declare_ty(name, field_name, ty, borrow)); + quote! { + #declare + #(#sub)* + } +} + +fn declare_object(name: &str, x: &Properties, borrow: bool) -> TokenStream { + let sorted = { + let mut x = x.iter().collect::>(); + x.sort_by_cached_key(|&(name, _)| name); + x + }; + let struct_name = format_ident!("{}", utils::loud_to_camel(name)); + let fields = sorted.iter().map(|(field_name, ty)| { + let label = format_ident!( + "{}", + utils::loud_to_snake(&field_name.replace("$mixin", "mixin")) + ); + let flatten = field_name + .contains("$mixin") + .then(|| quote!(#[serde(flatten)])) + .unwrap_or_default(); + let (use_ty, serde_borrow) = use_ty(name, field_name, ty, borrow); + let serde_borrow = serde_borrow + .then(|| quote!(#[serde(borrow)])) + .unwrap_or_default(); + let skip_serializing = if name == "Metadata" && *field_name == "internal" { + quote!(#[serde(skip_serializing_if = "is_default")]) + } else { + // FIXME: There are FIELDS that use skip and explicit null. + // TODO: union null to Option + // Option> + quote!() + }; + quote! { + #flatten + #serde_borrow + #skip_serializing + #[serde(rename = #field_name)] + pub(crate) #label: #use_ty + } + }); + let lifetime = (borrow && _has_reference(x)) + .then(|| quote!(<'a>)) + .unwrap_or_default(); + quote! { + #[derive(Debug, Serialize, Deserialize)] + pub struct #struct_name #lifetime { + #(#fields),* + } + } +} + +fn use_ty(scope: &str, name: &str, ty: &Type, borrow: bool) -> (TokenStream, bool) { + match ty { + Type::Name(s) => { + let opt = s.ends_with("?"); + let s = s.replace("?", ""); + let (label, serde_borrow) = match &*s { + "binary" if borrow => (quote!(&'a [u8]), true), + "binary" => (quote!(Vec), false), + "number" => (quote!(serde_json::Number), false), + "json" if borrow => (quote!(&'a str), true), + "json" => (quote!(String), false), + "string" if borrow => (quote!(&'a str), true), + "string" => (quote!(String), false), + "boolean" => (quote!(bool), false), + x => { + let ident = format_ident!("{}", utils::loud_to_camel(x)); + (quote!(crate::protocol::generated::#ident), false) + } + }; + ( + if opt { + quote!(Option<#label>) + } else { + quote!(#label) + }, + serde_borrow + ) + } + Type::Items { r#type, item_type } => { + let (l, serde_borrow) = use_ty(scope, name, item_type, borrow); + ( + if r#type.ends_with("?") { + quote!(Option>) + } else { + quote!(Vec<#l>) + }, + serde_borrow + ) + } + Type::Literals { r#type, .. } => { + let label = format_ident!( + "{}{}", + utils::loud_to_camel(scope), + utils::lower_loud_to_camel(name) + ); + ( + if r#type.ends_with("?") { + quote!(Option<#label>) + } else { + quote!(#label) + }, + false + ) + } + Type::Properties { r#type, .. } => { + let label = format_ident!( + "{}{}", + utils::loud_to_camel(scope), + utils::lower_loud_to_camel(name) + ); + if scope == "AndroidSelector" + && (name == "hasChild" || name == "hasDescendant") + && r#type.ends_with("?") + { + return ( + quote! { + Option> + }, + false + ); + } + match (r#type.ends_with("?"), borrow && has_reference(ty)) { + (true, true) => (quote!(Option<#label<'a>>), true), + (true, false) => (quote!(Option<#label>), false), + (false, true) => (quote!(#label<'a>), true), + (false, false) => (quote!(#label), false) + } + } + } +} + +fn declare_ty(scope: &str, name: &str, ty: &Type, borrow: bool) -> TokenStream { + let label = format!( + "{}{}", + utils::loud_to_camel(scope), + utils::lower_loud_to_camel(name) + ); + match ty { + Type::Name(_) => quote! {}, + Type::Items { r#type, item_type } => { + assert!(r#type == "array" || r#type == "array?", "{}", &r#type); + declare_ty(scope, name, item_type, borrow) + } + Type::Literals { r#type, literals } => { + assert!(r#type == "enum" || r#type == "enum?", "{}", &r#type); + enum_tokens( + &label, + &Enum { + literals: literals.clone() + } + ) + } + Type::Properties { r#type, properties } => { + assert!(r#type == "object" || r#type == "object?", "{}", &r#type); + child_object_tokens(&label, properties, borrow) + } + } +} + +fn has_reference(ty: &Type) -> bool { + match ty { + Type::Name(s) => { + let s: &str = if s.ends_with("?") { + &s[0..s.len() - 1] + } else { + s + }; + ["binary", "string", "json"].contains(&s) + } + Type::Items { r#type, item_type } => has_reference(item_type), + Type::Literals { r#type, literals } => false, + Type::Properties { r#type, properties } => _has_reference(properties) + } +} + +fn _has_reference(properties: &Properties) -> bool { + properties.iter().any(|(_, t)| has_reference(t)) +} + +fn interface_tokens(name: &str, x: &Interface) -> TokenStream { + let Interface { + commands, + events, + extends, + initializer + } = x; + let mod_name = format_ident!("{}", utils::loud_to_camel(name).to_snake()); + let initializer_tokens = initializer + .as_ref() + .map(|properties| child_object_tokens("Initializer", &properties, false)) + .unwrap_or_default(); + let commands_tokens = commands_tokens(commands); + let events_tokens = events_tokens(events); + let doc_extends = extends + .as_deref() + .filter(|&s| s != "EventTarget") + .map(|s| { + let e = format!("Extends {}", s); + quote! { #[doc=#e] } + }) + .unwrap_or_default(); + let struct_name = format_ident!("{}", utils::loud_to_camel(name)); + quote! { + pub(crate) type #struct_name = OnlyGuid; + + #doc_extends + pub mod #mod_name { + #initializer_tokens + + #events_tokens + #commands_tokens + } + } +} + +fn commands_tokens(commands: &Option) -> TokenStream { + let commands = match commands { + Some(x) => { + let mut tmp = x.iter().collect::>(); + tmp.sort_by_cached_key(|&(name, _)| name); + tmp + } + None => return Default::default() + }; + let declares = commands.iter().map(|(name, c)| { + let camel = utils::lower_loud_to_camel(name); + let rety = format_ident!("{camel}"); + let args = format_ident!("{camel}Args"); + let c = match c.as_ref() { + None => { + return quote! { + pub type #rety = (); + pub type #args = (); + } + } + Some(c) => c + }; + let declare_rety = if let Some(returns) = &c.returns { + child_object_tokens(&camel, returns, false) + } else { + quote! { + pub type #rety = (); + } + }; + let declare_args = if let Some(parameters) = &c.parameters { + child_object_tokens(&format!("{camel}Args"), parameters, true) + } else { + quote! { + pub type #args = (); + } + }; + quote! { + #declare_rety + #declare_args + } + }); + quote! { + pub mod commands { + #(#declares)* + } + } +} + +fn events_tokens(events: &Option) -> TokenStream { + let events = match events { + Some(x) => { + let mut tmp = x.iter().collect::>(); + tmp.sort_by_cached_key(|&(name, _)| name); + tmp + } + None => return quote! {} + }; + let variants = events.iter().map(|(name, e)| { + let camel = utils::lower_loud_to_camel(name); + let label = format_ident!("{}", &camel); + if let Some(_) = e { + quote! { + #[serde(rename = #name)] + #label(#label) + } + } else { + quote! { + #[serde(rename = #name)] + #label + } + } + }); + let sub = events.iter().filter_map(|(name, e)| -> Option<_> { + let e = e.as_ref()?; + let camel = utils::lower_loud_to_camel(name); + let declare = child_object_tokens(&camel, &e.parameters, false); + Some(quote! { + #declare + }) + }); + quote! { + pub mod events { + #[derive(Debug, Deserialize, Serialize)] + pub enum Events { + #(#variants),* + } + #(#sub)* + } + } +} diff --git a/scripts/src/lib.rs b/scripts/src/lib.rs new file mode 100644 index 0000000..5effe7b --- /dev/null +++ b/scripts/src/lib.rs @@ -0,0 +1,3 @@ +pub mod api; +pub mod protocol; +pub mod utils; diff --git a/scripts/src/protocol.rs b/scripts/src/protocol.rs new file mode 100644 index 0000000..6a84bd2 --- /dev/null +++ b/scripts/src/protocol.rs @@ -0,0 +1,316 @@ +use case::CaseExt; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +#[derive(Debug, Deserialize)] +#[serde(transparent)] +pub struct Protocol(pub HashMap); + +#[derive(Debug, PartialEq, Clone)] +pub enum Node { + Enum(Enum), + Object(Object), + /// fields embedded in others + Mixin(Object), + Interface(Interface) +} + +impl<'de> Deserialize<'de> for Node { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de> + { + #[derive(Debug, Deserialize, PartialEq)] + struct A { + r#type: String, + commands: Option, + events: Option, + extends: Option, + initializer: Option, + literals: Option>, + properties: Option + } + let a = A::deserialize(deserializer)?; + Ok(match &*a.r#type { + "object" => Self::Object(Object { + properties: a.properties.unwrap() + }), + "mixin" => Self::Mixin(Object { + properties: a.properties.unwrap() + }), + "enum" => Self::Enum(Enum { + literals: a.literals.unwrap() + }), + "interface" => { + let A { + commands, + events, + extends, + initializer, + .. + } = a; + Self::Interface(Interface { + commands, + events, + extends, + initializer + }) + } + _ => unreachable!() + }) + } +} + +#[derive(Debug, Deserialize, PartialEq, Clone)] +pub struct Enum { + pub literals: Vec +} + +#[derive(Debug, Deserialize, PartialEq, Clone)] +pub struct Interface { + pub commands: Option, + pub events: Option, + pub extends: Option, + pub initializer: Option +} + +/// ex. {"close": null} +pub type Commands = HashMap>; +pub type Events = HashMap>; +pub type Properties = HashMap; + +#[derive(Debug, Deserialize, PartialEq, Clone)] +#[serde(transparent)] +pub struct Object { + pub properties: Properties +} + +#[derive(Debug, Deserialize, PartialEq, Clone)] +pub struct Command { + pub parameters: Option, + pub returns: Option, + // True as String + #[serde(default)] + pub experimental: Option, + pub tracing: Option +} + +#[derive(Debug, Deserialize, PartialEq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct Tracing { + pub snapshot: bool, + pub pause_before_input: Option +} + +#[derive(Debug, Deserialize, PartialEq, Clone)] +pub struct Event { + /// response + pub parameters: Properties +} + +#[derive(Debug, Deserialize, PartialEq, Clone, Serialize)] +#[serde(untagged)] +pub enum Type { + Name(String), + Items { + r#type: String, + #[serde(rename = "items")] + item_type: Box + }, + Literals { + r#type: String, + literals: Vec + }, + Properties { + r#type: String, + properties: Properties + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::fs; + + #[test] + fn all_protocol_types() { + let s = fs::read_to_string("../src/protocol/protocol.yml").unwrap(); + let s = s.replace("null", r#""null""#); + let protocol: Protocol = serde_yaml::from_str(&s).unwrap(); + let mut types = Vec::new(); + fn add<'a>(dest: &mut Vec<&'a Type>, t: &'a Type) { + match t { + Type::Name(_) => dest.push(t), + Type::Items { item_type, .. } => add(dest, &item_type), + Type::Literals { .. } => {} + Type::Properties { properties, .. } => { + for (_, t) in properties.iter() { + add(dest, t); + } + } + } + } + for (_, node) in protocol.0.iter() { + match node { + Node::Object(Object { properties }) | Node::Mixin(Object { properties }) => { + for (_, t) in properties { + add(&mut types, t); + } + } + Node::Interface(Interface { + commands, + events, + extends: _, + initializer + }) => { + fn append<'a>(dest: &mut Vec<&'a Type>, props: &'a Option) { + for (_, t) in props.iter().flat_map(|m| m.iter()) { + add(dest, t); + } + } + for (_, c) in commands.iter().flat_map(|m| m.iter()) { + let c = if c.is_none() { + continue; + } else { + c.as_ref().unwrap() + }; + append(&mut types, &c.parameters); + append(&mut types, &c.returns); + } + for (_, e) in events.iter().flat_map(|m| m.iter()) { + let e = if e.is_none() { + continue; + } else { + e.as_ref().unwrap() + }; + for (_, t) in e.parameters.iter() { + add(&mut types, t); + } + } + append(&mut types, initializer); + } + _ => {} + } + } + println!("{}", serde_json::to_string(&types).unwrap()); + } + + #[test] + fn deserialize_type() { + let name = "deviceDescriptors"; + let ty: Type = serde_json::from_str( + r#" + { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": "string", + "descriptor": { + "type": "object", + "properties": { + "userAgent": "string", + "viewport": { + "type": "object", + "properties": { + "width": "number", + "height": "number" + } + }, + "screen": { + "type": "object?", + "properties": { + "width": "number", + "height": "number" + } + }, + "deviceScaleFactor": "number", + "isMobile": "boolean", + "hasTouch": "boolean", + "defaultBrowserType": { + "type": "enum", + "literals": [ + "chromium", + "firefox", + "webkit" + ] + } + } + } + } + } + } + "# + ) + .unwrap(); + println!("{:?}", collect_unnamed(&[], name, &ty)); + } +} + +pub fn collect_unnamed_by_properties<'a>( + prefix: Vec<&str>, + props: &'a Properties +) -> HashMap { + let mut res = HashMap::new(); + for (name, t) in props.iter() { + res.extend(collect_unnamed(&prefix, name, t)); + } + res +} + +pub fn collect_unnamed<'a>(prefix: &[&str], name: &str, ty: &'a Type) -> HashMap { + let mut res = HashMap::new(); + match ty { + Type::Name(_) => {} + Type::Items { r#type, item_type } => { + assert!( + r#type == "array" || r#type == "array?", + "Not match Type::Items" + ); + res.extend(collect_unnamed(prefix, name, &item_type)); + } + Type::Literals { r#type, literals } => { + assert!( + r#type == "enum" || r#type == "enum?", + "Not match Type::Literals" + ); + res.insert( + prefix + .iter() + .map(|s| -> &str { s }) + .chain(std::iter::once(&name as &str)) + .map(|s| s.to_camel()) + .collect(), + Node::Enum(Enum { + literals: literals.clone() + }) + ); + } + Type::Properties { r#type, properties } => { + assert!( + r#type == "object" || r#type == "object?", + "Not match Type::Properties" + ); + res.insert( + prefix + .iter() + .map(|s| -> &str { s }) + .chain(std::iter::once(&name as &str)) + .map(|s| s.to_camel()) + .collect(), + Node::Object(Object { + properties: properties.clone() + }) + ); + res.extend(collect_unnamed_by_properties( + { + let mut p = prefix.to_vec(); + p.push(name); + p + }, + properties + )); + } + } + res +} diff --git a/scripts/src/utils.rs b/scripts/src/utils.rs new file mode 100644 index 0000000..81a4999 --- /dev/null +++ b/scripts/src/utils.rs @@ -0,0 +1,105 @@ +use case::CaseExt; + +pub fn escape(s: &str) -> String { + match s { + // keywords https://doc.rust-lang.org/book/appendix-01-keywords.html + "as" | "async" | "await" | "break" | "const" | "continue" | "crate" | "dyn" | "else" + | "enum" | "extern" | "false" | "fn" | "for" | "if" | "impl" | "in" | "let" | "loop" + | "match" | "mod" | "move" | "mut" | "pub" | "ref" | "return" | "Self" | "self" + | "static" | "struct" | "super" | "trait" | "true" | "type" | "union" | "unsafe" + | "use" | "where" | "while" => { + format!("r#{}", s) + } + // reserved + "abstract" | "become" | "box" | "do" | "final" | "macro" | "override" | "priv" | "try" + | "typeof" | "unsized" | "virtual" | "yield" => { + format!("r#{}", s) + } + _ => s.into() + } +} + +pub fn snake(s: &str) -> String { escape(s).to_snake() } + +// ex. CDPSessionSTORE :-> CdpSessionStore +pub fn loud_to_camel(s: &str) -> String { + let us = s + .chars() + .map(|c| c.is_ascii_uppercase()) + .collect::>(); + if us.len() <= 1 { + return s.to_ascii_uppercase(); + } + let mut spans = Vec::<(usize, usize)>::new(); + let it = { + let a = us.iter(); + let mut b = us.iter(); + b.next(); + a.zip(b) + }; + let mut ctx = (false, 0); + for (i, (cur, peek)) in it.enumerate() { + match (ctx.0, cur, peek) { + (false, false, false) => {} + (false, false, true) => {} + (false, true, false) => {} + (false, true, true) => { + ctx = (true, i); + } + (true, false, false) => {} + (true, false, true) => {} + (true, true, false) => { + spans.push((ctx.1, i)); + ctx = (false, 0); + } + (true, true, true) => {} + } + } + if ctx.0 { + spans.push((ctx.1, us.len())); + } + s.chars() + .enumerate() + .map(|(i, c)| { + if spans.iter().any(|&(start, stop)| start < i && i < stop) { + c.to_ascii_lowercase() + } else { + c + } + }) + .collect() +} + +pub fn loud_to_snake(s: &str) -> String { snake(&loud_to_camel(s)) } + +pub fn lower_loud_to_camel(s: &str) -> String { loud_to_camel(&s).to_camel() } + +pub fn kebab_to_snake(s: &str) -> String { + let u = s.replace("-", "_"); + let snake = if u.starts_with("_") { + format!("neg{}", u) + } else { + u + }; + snake +} + +pub fn kebab_to_camel(s: &str) -> String { kebab_to_snake(s).to_camel() } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn can_loud_to_camel() { + assert_eq!(loud_to_camel("CDPSession"), "CdpSession".to_string()); + assert_eq!(loud_to_camel("JSHandle"), "JsHandle".to_string()); + assert_eq!( + loud_to_camel("APIRequestContext"), + "ApiRequestContext".to_string() + ); + assert_eq!(loud_to_camel("AXNode"), "AxNode".to_string()); + assert_eq!(loud_to_camel("AxisXADog"), "AxisXaDog".to_string()); + assert_eq!(loud_to_camel("AXIS"), "Axis".to_string()); // if last + } +} diff --git a/scripts/types.json b/scripts/types.json deleted file mode 100644 index f886475..0000000 --- a/scripts/types.json +++ /dev/null @@ -1,25478 +0,0 @@ -[ - { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "role", - "async": false, - "comment": "The [role](https://www.w3.org/TR/wai-aria/#usage_intro).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "role", - "required": true, - "spec": [ - { - "text": "The [role](https://www.w3.org/TR/wai-aria/#usage_intro).", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "name", - "async": false, - "comment": "A human readable name for the node.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "A human readable name for the node.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "The current value of the node, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "The current value of the node, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[float]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - } - ] - } - }, - { - "alias": "description", - "async": false, - "comment": "An additional human readable description of the node, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "description", - "required": false, - "spec": [ - { - "text": "An additional human readable description of the node, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "keyshortcuts", - "async": false, - "comment": "Keyboard shortcuts associated with this node, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "keyshortcuts", - "required": false, - "spec": [ - { - "text": "Keyboard shortcuts associated with this node, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "roledescription", - "async": false, - "comment": "A human readable alternative to the role, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "roledescription", - "required": false, - "spec": [ - { - "text": "A human readable alternative to the role, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "valuetext", - "async": false, - "comment": "A description of the current value, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "valuetext", - "required": false, - "spec": [ - { - "text": "A description of the current value, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "disabled", - "async": false, - "comment": "Whether the node is disabled, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "disabled", - "required": false, - "spec": [ - { - "text": "Whether the node is disabled, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "expanded", - "async": false, - "comment": "Whether the node is expanded or collapsed, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "expanded", - "required": false, - "spec": [ - { - "text": "Whether the node is expanded or collapsed, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "focused", - "async": false, - "comment": "Whether the node is focused, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "focused", - "required": false, - "spec": [ - { - "text": "Whether the node is focused, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modal", - "async": false, - "comment": "Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modal", - "required": false, - "spec": [ - { - "text": "Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "multiline", - "async": false, - "comment": "Whether the node text input supports multiline, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "multiline", - "required": false, - "spec": [ - { - "text": "Whether the node text input supports multiline, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "multiselectable", - "async": false, - "comment": "Whether more than one child can be selected, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "multiselectable", - "required": false, - "spec": [ - { - "text": "Whether more than one child can be selected, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "readonly", - "async": false, - "comment": "Whether the node is read only, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "readonly", - "required": false, - "spec": [ - { - "text": "Whether the node is read only, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "required", - "async": false, - "comment": "Whether the node is required, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "required", - "required": false, - "spec": [ - { - "text": "Whether the node is required, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "selected", - "async": false, - "comment": "Whether the node is selected in its parent node, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "selected", - "required": false, - "spec": [ - { - "text": "Whether the node is selected in its parent node, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "checked", - "async": false, - "comment": "Whether the checkbox is checked, or \"mixed\", if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "checked", - "required": false, - "spec": [ - { - "text": "Whether the checkbox is checked, or \"mixed\", if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]|\"mixed\"", - "name": "", - "union": [ - { - "name": "boolean" - }, - { - "name": "\"mixed\"" - } - ] - } - }, - { - "alias": "pressed", - "async": false, - "comment": "Whether the toggle button is checked, or \"mixed\", if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "pressed", - "required": false, - "spec": [ - { - "text": "Whether the toggle button is checked, or \"mixed\", if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]|\"mixed\"", - "name": "", - "union": [ - { - "name": "boolean" - }, - { - "name": "\"mixed\"" - } - ] - } - }, - { - "alias": "level", - "async": false, - "comment": "The level of a heading, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "level", - "required": false, - "spec": [ - { - "text": "The level of a heading, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "valuemin", - "async": false, - "comment": "The minimum value in a node, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "valuemin", - "required": false, - "spec": [ - { - "text": "The minimum value in a node, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "valuemax", - "async": false, - "comment": "The maximum value in a node, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "valuemax", - "required": false, - "spec": [ - { - "text": "The maximum value in a node, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "autocomplete", - "async": false, - "comment": "What kind of autocomplete is supported by a control, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "autocomplete", - "required": false, - "spec": [ - { - "text": "What kind of autocomplete is supported by a control, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "haspopup", - "async": false, - "comment": "What kind of popup is currently being shown for a node, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "haspopup", - "required": false, - "spec": [ - { - "text": "What kind of popup is currently being shown for a node, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "invalid", - "async": false, - "comment": "Whether and in what way this node's value is invalid, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "invalid", - "required": false, - "spec": [ - { - "text": "Whether and in what way this node's value is invalid, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "orientation", - "async": false, - "comment": "Whether the node is oriented horizontally or vertically, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "orientation", - "required": false, - "spec": [ - { - "text": "Whether the node is oriented horizontally or vertically, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "children", - "async": false, - "comment": "Child nodes, if any, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "children", - "required": false, - "spec": [ - { - "text": "Child nodes, if any, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object" - } - ] - } - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "interestingOnly", - "async": false, - "comment": "Prune uninteresting nodes from the tree. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "interestingOnly", - "required": false, - "spec": [ - { - "text": "Prune uninteresting nodes from the tree. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "root", - "async": false, - "comment": "The root DOM element for the snapshot. Defaults to the whole page.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "root", - "required": false, - "spec": [ - { - "text": "The root DOM element for the snapshot. Defaults to the whole page.", - "type": "text" - } - ], - "type": { - "expression": "[ElementHandle]", - "name": "ElementHandle" - } - } - ] - }, - { - "expression": "[Array]<[AndroidDevice]>", - "name": "Array", - "templates": [ - { - "name": "AndroidDevice" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "expression": "[AndroidWebView]", - "name": "AndroidWebView" - }, - { - "name": "void" - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "speed", - "async": false, - "comment": "Optional speed of the drag in pixels per second.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "speed", - "required": false, - "spec": [ - { - "text": "Optional speed of the drag in pixels per second.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[AndroidFlingDirection]<\"down\"|\"up\"|\"left\"|\"right\">", - "name": "AndroidFlingDirection", - "union": [ - { - "name": "\"down\"" - }, - { - "name": "\"up\"" - }, - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "speed", - "async": false, - "comment": "Optional speed of the fling in pixels per second.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "speed", - "required": false, - "spec": [ - { - "text": "Optional speed of the fling in pixels per second.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[AndroidElementInfo]", - "name": "AndroidElementInfo" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[AndroidInput]", - "name": "AndroidInput" - }, - { - "name": "void" - }, - { - "expression": "[string]|[Buffer]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Buffer" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "args", - "async": false, - "comment": "Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "args", - "required": false, - "spec": [ - { - "text": "Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - } - ] - }, - { - "expression": "[ChromiumBrowserContext]", - "name": "ChromiumBrowserContext" - }, - { - "name": "Object", - "properties": [ - { - "alias": "acceptDownloads", - "async": false, - "comment": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "acceptDownloads", - "required": false, - "spec": [ - { - "text": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "bypassCSP", - "async": false, - "comment": "Toggles bypassing page's Content-Security-Policy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypassCSP", - "required": false, - "spec": [ - { - "text": "Toggles bypassing page's Content-Security-Policy.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "colorScheme", - "async": false, - "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "colorScheme", - "required": false, - "spec": [ - { - "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "type": "text" - } - ], - "type": { - "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">", - "name": "ColorScheme", - "union": [ - { - "name": "\"light\"" - }, - { - "name": "\"dark\"" - }, - { - "name": "\"no-preference\"" - } - ] - } - }, - { - "alias": "command", - "async": false, - "comment": "Optional package name to launch instead of default Chrome for Android.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "command", - "required": false, - "spec": [ - { - "text": "Optional package name to launch instead of default Chrome for Android.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "deviceScaleFactor", - "async": false, - "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "deviceScaleFactor", - "required": false, - "spec": [ - { - "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "extraHTTPHeaders", - "async": false, - "comment": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "extraHTTPHeaders", - "required": false, - "spec": [ - { - "text": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "geolocation", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "geolocation", - "required": false, - "spec": [], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "latitude", - "async": false, - "comment": "Latitude between -90 and 90.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "latitude", - "required": true, - "spec": [ - { - "text": "Latitude between -90 and 90.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "longitude", - "async": false, - "comment": "Longitude between -180 and 180.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "longitude", - "required": true, - "spec": [ - { - "text": "Longitude between -180 and 180.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "accuracy", - "async": false, - "comment": "Non-negative accuracy value. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "accuracy", - "required": false, - "spec": [ - { - "text": "Non-negative accuracy value. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "hasTouch", - "async": false, - "comment": "Specifies if viewport supports touch events. Defaults to false.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "hasTouch", - "required": false, - "spec": [ - { - "text": "Specifies if viewport supports touch events. Defaults to false.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "httpCredentials", - "async": false, - "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpCredentials", - "required": false, - "spec": [ - { - "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "username", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "ignoreHTTPSErrors", - "async": false, - "comment": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "ignoreHTTPSErrors", - "required": false, - "spec": [ - { - "text": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "isMobile", - "async": false, - "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported\nin Firefox.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "isMobile", - "required": false, - "spec": [ - { - "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "javaScriptEnabled", - "async": false, - "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "javaScriptEnabled", - "required": false, - "spec": [ - { - "text": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "locale", - "async": false, - "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`\nrequest header value as well as number and date formatting rules.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "locale", - "required": false, - "spec": [ - { - "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "logger", - "async": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "logger", - "required": false, - "spec": [ - { - "text": "Logger sink for Playwright logging.", - "type": "text" - } - ], - "type": { - "expression": "[Logger]", - "name": "Logger" - } - }, - { - "alias": "noViewport", - "async": false, - "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "noViewport", - "required": false, - "spec": [ - { - "text": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "offline", - "async": false, - "comment": "Whether to emulate network being offline. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "offline", - "required": false, - "spec": [ - { - "text": "Whether to emulate network being offline. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "permissions", - "async": false, - "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more\ndetails.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "permissions", - "required": false, - "spec": [ - { - "text": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more details.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "recordHar", - "async": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not\nspecified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHar", - "required": false, - "spec": [ - { - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "omitContent", - "async": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "omitContent", - "required": false, - "spec": [ - { - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path on the filesystem to write the HAR file to.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": true, - "spec": [ - { - "text": "Path on the filesystem to write the HAR file to.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - } - ] - } - }, - { - "alias": "recordHarOmitContent", - "async": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_har_omit_content" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHarOmitContent", - "required": false, - "spec": [ - { - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "recordHarPath", - "async": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the\nfilesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to\nbe saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_har_path" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHarPath", - "required": false, - "spec": [ - { - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "recordVideo", - "async": false, - "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make\nsure to await [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideo", - "required": false, - "spec": [ - { - "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [`method: BrowserContext.close`] for videos to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "dir", - "async": false, - "comment": "Path to the directory to put videos into.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "dir", - "required": true, - "spec": [ - { - "text": "Path to the directory to put videos into.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "size", - "async": false, - "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit\ninto 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "size", - "required": false, - "spec": [ - { - "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - } - ] - } - }, - { - "alias": "recordVideoDir", - "async": false, - "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure\nto call [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_video_dir" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideoDir", - "required": false, - "spec": [ - { - "text": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "recordVideoSize", - "async": false, - "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will\nbe scaled down if necessary to fit the specified size.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_video_size" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideoSize", - "required": false, - "spec": [ - { - "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "screen", - "async": false, - "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`\nis set.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "csharp": "screenSize", - "java": "screenSize" - }, - "overrides": {}, - "types": {} - }, - "name": "screen", - "required": false, - "spec": [ - { - "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "timezoneId", - "async": false, - "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timezoneId", - "required": false, - "spec": [ - { - "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "userAgent", - "async": false, - "comment": "Specific user agent to use in this context.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "userAgent", - "required": false, - "spec": [ - { - "text": "Specific user agent to use in this context.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "videoSize", - "async": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "videoSize", - "required": false, - "spec": [ - { - "text": "**DEPRECATED** Use `recordVideo` instead.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "videosPath", - "async": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "videosPath", - "required": false, - "spec": [ - { - "text": "**DEPRECATED** Use `recordVideo` instead.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "viewport", - "async": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "csharp": "viewportSize", - "java": "viewportSize" - }, - "only": [ - "js", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "viewport", - "required": false, - "spec": [ - { - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - }, - { - "alias": "viewport", - "async": false, - "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "viewport", - "required": false, - "spec": [ - { - "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[AndroidSocket]", - "name": "AndroidSocket" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "Object", - "properties": [ - { - "alias": "speed", - "async": false, - "comment": "Optional speed of the pinch in pixels per second.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "speed", - "required": false, - "spec": [ - { - "text": "Optional speed of the pinch in pixels per second.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "Object", - "properties": [ - { - "alias": "speed", - "async": false, - "comment": "Optional speed of the pinch in pixels per second.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "speed", - "required": false, - "spec": [ - { - "text": "Optional speed of the pinch in pixels per second.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[AndroidKey]", - "name": "AndroidKey" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]|[Buffer]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Buffer" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "mode", - "async": false, - "comment": "Optional file mode, defaults to `644` (`rw-r--r--`).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mode", - "required": false, - "spec": [ - { - "text": "Optional file mode, defaults to `644` (`rw-r--r--`).", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "name": "Object", - "properties": [ - { - "alias": "path", - "async": false, - "comment": "The file path to save the image to. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. If no path is provided, the image won't be saved to the disk.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "The file path to save the image to. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[AndroidScrollDirection]<\"down\"|\"up\"|\"left\"|\"right\">", - "name": "AndroidScrollDirection", - "union": [ - { - "name": "\"down\"" - }, - { - "name": "\"up\"" - }, - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - } - ] - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "Object", - "properties": [ - { - "alias": "speed", - "async": false, - "comment": "Optional speed of the scroll in pixels per second.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "speed", - "required": false, - "spec": [ - { - "text": "Optional speed of the scroll in pixels per second.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "expression": "[AndroidSwipeDirection]<\"down\"|\"up\"|\"left\"|\"right\">", - "name": "AndroidSwipeDirection", - "union": [ - { - "name": "\"down\"" - }, - { - "name": "\"up\"" - }, - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - } - ] - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "Object", - "properties": [ - { - "alias": "speed", - "async": false, - "comment": "Optional speed of the swipe in pixels per second.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "speed", - "required": false, - "spec": [ - { - "text": "Optional speed of the swipe in pixels per second.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "name": "Object", - "properties": [ - { - "alias": "duration", - "async": false, - "comment": "Optional duration of the tap in milliseconds.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "duration", - "required": false, - "spec": [ - { - "text": "Optional duration of the tap in milliseconds.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[AndroidSelector]", - "name": "AndroidSelector" - }, - { - "name": "Object", - "properties": [ - { - "alias": "state", - "async": false, - "comment": "Optional state. Can be either:\n- default - wait for element to be present.\n- `'gone'` - wait for element to not be present.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "state", - "required": false, - "spec": [ - { - "text": "Optional state. Can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "default - wait for element to be present.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'gone'` - wait for element to not be present.", - "type": "li" - } - ], - "type": { - "expression": "\"gone\"", - "name": "\"gone\"" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[any]", - "name": "any" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]|[Object]", - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": true, - "spec": [ - { - "text": "receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: AndroidDevice.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - ] - }, - { - "expression": "[AndroidWebView]", - "name": "AndroidWebView" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "pkg", - "async": false, - "comment": "Package identifier.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "pkg", - "required": true, - "spec": [ - { - "text": "Package identifier.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Array]<[AndroidWebView]>", - "name": "Array", - "templates": [ - { - "name": "AndroidWebView" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[int]", - "name": "int" - }, - { - "name": "void" - }, - { - "expression": "[AndroidKey]", - "name": "AndroidKey" - }, - { - "name": "void" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - ] - }, - { - "expression": "[int]", - "name": "int" - }, - { - "name": "void" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "name": "void" - }, - { - "name": "void" - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "name": "void" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[int]", - "name": "int" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Browser]", - "name": "Browser" - }, - { - "name": "void" - }, - { - "expression": "[Array]<[BrowserContext]>", - "name": "Array", - "templates": [ - { - "name": "BrowserContext" - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[BrowserContext]", - "name": "BrowserContext" - }, - { - "name": "Object", - "properties": [ - { - "alias": "acceptDownloads", - "async": false, - "comment": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "acceptDownloads", - "required": false, - "spec": [ - { - "text": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "bypassCSP", - "async": false, - "comment": "Toggles bypassing page's Content-Security-Policy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypassCSP", - "required": false, - "spec": [ - { - "text": "Toggles bypassing page's Content-Security-Policy.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "colorScheme", - "async": false, - "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "colorScheme", - "required": false, - "spec": [ - { - "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "type": "text" - } - ], - "type": { - "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">", - "name": "ColorScheme", - "union": [ - { - "name": "\"light\"" - }, - { - "name": "\"dark\"" - }, - { - "name": "\"no-preference\"" - } - ] - } - }, - { - "alias": "deviceScaleFactor", - "async": false, - "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "deviceScaleFactor", - "required": false, - "spec": [ - { - "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "extraHTTPHeaders", - "async": false, - "comment": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "extraHTTPHeaders", - "required": false, - "spec": [ - { - "text": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "geolocation", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "geolocation", - "required": false, - "spec": [], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "latitude", - "async": false, - "comment": "Latitude between -90 and 90.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "latitude", - "required": true, - "spec": [ - { - "text": "Latitude between -90 and 90.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "longitude", - "async": false, - "comment": "Longitude between -180 and 180.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "longitude", - "required": true, - "spec": [ - { - "text": "Longitude between -180 and 180.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "accuracy", - "async": false, - "comment": "Non-negative accuracy value. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "accuracy", - "required": false, - "spec": [ - { - "text": "Non-negative accuracy value. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "hasTouch", - "async": false, - "comment": "Specifies if viewport supports touch events. Defaults to false.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "hasTouch", - "required": false, - "spec": [ - { - "text": "Specifies if viewport supports touch events. Defaults to false.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "httpCredentials", - "async": false, - "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpCredentials", - "required": false, - "spec": [ - { - "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "username", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "ignoreHTTPSErrors", - "async": false, - "comment": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "ignoreHTTPSErrors", - "required": false, - "spec": [ - { - "text": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "isMobile", - "async": false, - "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported\nin Firefox.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "isMobile", - "required": false, - "spec": [ - { - "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "javaScriptEnabled", - "async": false, - "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "javaScriptEnabled", - "required": false, - "spec": [ - { - "text": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "locale", - "async": false, - "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`\nrequest header value as well as number and date formatting rules.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "locale", - "required": false, - "spec": [ - { - "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "logger", - "async": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "logger", - "required": false, - "spec": [ - { - "text": "Logger sink for Playwright logging.", - "type": "text" - } - ], - "type": { - "expression": "[Logger]", - "name": "Logger" - } - }, - { - "alias": "noViewport", - "async": false, - "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "noViewport", - "required": false, - "spec": [ - { - "text": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "offline", - "async": false, - "comment": "Whether to emulate network being offline. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "offline", - "required": false, - "spec": [ - { - "text": "Whether to emulate network being offline. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "permissions", - "async": false, - "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more\ndetails.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "permissions", - "required": false, - "spec": [ - { - "text": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more details.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "proxy", - "async": false, - "comment": "Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this\noption to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example\n`launch({ proxy: { server: 'per-context' } })`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "proxy", - "required": false, - "spec": [ - { - "text": "Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'per-context' } })`.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "server", - "async": false, - "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "server", - "required": true, - "spec": [ - { - "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "bypass", - "async": false, - "comment": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypass", - "required": false, - "spec": [ - { - "text": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "username", - "async": false, - "comment": "Optional username to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": false, - "spec": [ - { - "text": "Optional username to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "Optional password to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": false, - "spec": [ - { - "text": "Optional password to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "recordHar", - "async": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not\nspecified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHar", - "required": false, - "spec": [ - { - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "omitContent", - "async": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "omitContent", - "required": false, - "spec": [ - { - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path on the filesystem to write the HAR file to.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": true, - "spec": [ - { - "text": "Path on the filesystem to write the HAR file to.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - } - ] - } - }, - { - "alias": "recordHarOmitContent", - "async": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_har_omit_content" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHarOmitContent", - "required": false, - "spec": [ - { - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "recordHarPath", - "async": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the\nfilesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to\nbe saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_har_path" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHarPath", - "required": false, - "spec": [ - { - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "recordVideo", - "async": false, - "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make\nsure to await [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideo", - "required": false, - "spec": [ - { - "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [`method: BrowserContext.close`] for videos to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "dir", - "async": false, - "comment": "Path to the directory to put videos into.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "dir", - "required": true, - "spec": [ - { - "text": "Path to the directory to put videos into.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "size", - "async": false, - "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit\ninto 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "size", - "required": false, - "spec": [ - { - "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - } - ] - } - }, - { - "alias": "recordVideoDir", - "async": false, - "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure\nto call [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_video_dir" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideoDir", - "required": false, - "spec": [ - { - "text": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "recordVideoSize", - "async": false, - "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will\nbe scaled down if necessary to fit the specified size.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_video_size" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideoSize", - "required": false, - "spec": [ - { - "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "screen", - "async": false, - "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`\nis set.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "csharp": "screenSize", - "java": "screenSize" - }, - "overrides": {}, - "types": {} - }, - "name": "screen", - "required": false, - "spec": [ - { - "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "storageState", - "async": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with\nthe following fields:", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "storageState", - "required": false, - "spec": [ - { - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with the following fields:", - "type": "text" - } - ], - "type": { - "expression": "[path]|[Object]", - "name": "", - "union": [ - { - "name": "path" - }, - { - "name": "Object", - "properties": [ - { - "alias": "cookies", - "async": false, - "comment": "Optional cookies to set for context", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "cookies", - "required": false, - "spec": [ - { - "text": "Optional cookies to set for context", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "url", - "async": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "Optional either url or domain / path are required", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "domain", - "async": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "domain", - "required": false, - "spec": [ - { - "text": "Optional either url or domain / path are required", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Optional either url or domain / path are required", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "expires", - "async": false, - "comment": "Optional Unix time in seconds.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "expires", - "required": false, - "spec": [ - { - "text": "Optional Unix time in seconds.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "httpOnly", - "async": false, - "comment": "Optional httpOnly flag", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpOnly", - "required": false, - "spec": [ - { - "text": "Optional httpOnly flag", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "secure", - "async": false, - "comment": "Optional secure flag", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "secure", - "required": false, - "spec": [ - { - "text": "Optional secure flag", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "sameSite", - "async": false, - "comment": "Optional sameSite flag", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "sameSite", - "required": false, - "spec": [ - { - "text": "Optional sameSite flag", - "type": "text" - } - ], - "type": { - "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">", - "name": "SameSiteAttribute", - "union": [ - { - "name": "\"Strict\"" - }, - { - "name": "\"Lax\"" - }, - { - "name": "\"None\"" - } - ] - } - } - ] - } - ] - } - }, - { - "alias": "origins", - "async": false, - "comment": "Optional localStorage to set for context", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "origins", - "required": false, - "spec": [ - { - "text": "Optional localStorage to set for context", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "origin", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "origin", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "localStorage", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "localStorage", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - ] - } - } - ] - } - ] - } - } - ] - } - ] - } - }, - { - "alias": "storageState", - "async": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "storageState", - "required": false, - "spec": [ - { - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`].", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "storageStatePath", - "async": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "storageStatePath", - "required": false, - "spec": [ - { - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "timezoneId", - "async": false, - "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timezoneId", - "required": false, - "spec": [ - { - "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "userAgent", - "async": false, - "comment": "Specific user agent to use in this context.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "userAgent", - "required": false, - "spec": [ - { - "text": "Specific user agent to use in this context.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "videoSize", - "async": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "videoSize", - "required": false, - "spec": [ - { - "text": "**DEPRECATED** Use `recordVideo` instead.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "videosPath", - "async": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "videosPath", - "required": false, - "spec": [ - { - "text": "**DEPRECATED** Use `recordVideo` instead.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "viewport", - "async": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "csharp": "viewportSize", - "java": "viewportSize" - }, - "only": [ - "js", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "viewport", - "required": false, - "spec": [ - { - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - }, - { - "alias": "viewport", - "async": false, - "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "viewport", - "required": false, - "spec": [ - { - "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - } - ] - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "name": "Object", - "properties": [ - { - "alias": "acceptDownloads", - "async": false, - "comment": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "acceptDownloads", - "required": false, - "spec": [ - { - "text": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "bypassCSP", - "async": false, - "comment": "Toggles bypassing page's Content-Security-Policy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypassCSP", - "required": false, - "spec": [ - { - "text": "Toggles bypassing page's Content-Security-Policy.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "colorScheme", - "async": false, - "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "colorScheme", - "required": false, - "spec": [ - { - "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "type": "text" - } - ], - "type": { - "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">", - "name": "ColorScheme", - "union": [ - { - "name": "\"light\"" - }, - { - "name": "\"dark\"" - }, - { - "name": "\"no-preference\"" - } - ] - } - }, - { - "alias": "deviceScaleFactor", - "async": false, - "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "deviceScaleFactor", - "required": false, - "spec": [ - { - "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "extraHTTPHeaders", - "async": false, - "comment": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "extraHTTPHeaders", - "required": false, - "spec": [ - { - "text": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "geolocation", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "geolocation", - "required": false, - "spec": [], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "latitude", - "async": false, - "comment": "Latitude between -90 and 90.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "latitude", - "required": true, - "spec": [ - { - "text": "Latitude between -90 and 90.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "longitude", - "async": false, - "comment": "Longitude between -180 and 180.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "longitude", - "required": true, - "spec": [ - { - "text": "Longitude between -180 and 180.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "accuracy", - "async": false, - "comment": "Non-negative accuracy value. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "accuracy", - "required": false, - "spec": [ - { - "text": "Non-negative accuracy value. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "hasTouch", - "async": false, - "comment": "Specifies if viewport supports touch events. Defaults to false.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "hasTouch", - "required": false, - "spec": [ - { - "text": "Specifies if viewport supports touch events. Defaults to false.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "httpCredentials", - "async": false, - "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpCredentials", - "required": false, - "spec": [ - { - "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "username", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "ignoreHTTPSErrors", - "async": false, - "comment": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "ignoreHTTPSErrors", - "required": false, - "spec": [ - { - "text": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "isMobile", - "async": false, - "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported\nin Firefox.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "isMobile", - "required": false, - "spec": [ - { - "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "javaScriptEnabled", - "async": false, - "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "javaScriptEnabled", - "required": false, - "spec": [ - { - "text": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "locale", - "async": false, - "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`\nrequest header value as well as number and date formatting rules.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "locale", - "required": false, - "spec": [ - { - "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "logger", - "async": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "logger", - "required": false, - "spec": [ - { - "text": "Logger sink for Playwright logging.", - "type": "text" - } - ], - "type": { - "expression": "[Logger]", - "name": "Logger" - } - }, - { - "alias": "noViewport", - "async": false, - "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "noViewport", - "required": false, - "spec": [ - { - "text": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "offline", - "async": false, - "comment": "Whether to emulate network being offline. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "offline", - "required": false, - "spec": [ - { - "text": "Whether to emulate network being offline. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "permissions", - "async": false, - "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more\ndetails.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "permissions", - "required": false, - "spec": [ - { - "text": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more details.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "proxy", - "async": false, - "comment": "Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this\noption to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example\n`launch({ proxy: { server: 'per-context' } })`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "proxy", - "required": false, - "spec": [ - { - "text": "Network proxy settings to use with this context. Note that browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'per-context' } })`.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "server", - "async": false, - "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "server", - "required": true, - "spec": [ - { - "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "bypass", - "async": false, - "comment": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypass", - "required": false, - "spec": [ - { - "text": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "username", - "async": false, - "comment": "Optional username to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": false, - "spec": [ - { - "text": "Optional username to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "Optional password to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": false, - "spec": [ - { - "text": "Optional password to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "recordHar", - "async": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not\nspecified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHar", - "required": false, - "spec": [ - { - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "omitContent", - "async": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "omitContent", - "required": false, - "spec": [ - { - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path on the filesystem to write the HAR file to.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": true, - "spec": [ - { - "text": "Path on the filesystem to write the HAR file to.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - } - ] - } - }, - { - "alias": "recordHarOmitContent", - "async": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_har_omit_content" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHarOmitContent", - "required": false, - "spec": [ - { - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "recordHarPath", - "async": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the\nfilesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to\nbe saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_har_path" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHarPath", - "required": false, - "spec": [ - { - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "recordVideo", - "async": false, - "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make\nsure to await [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideo", - "required": false, - "spec": [ - { - "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [`method: BrowserContext.close`] for videos to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "dir", - "async": false, - "comment": "Path to the directory to put videos into.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "dir", - "required": true, - "spec": [ - { - "text": "Path to the directory to put videos into.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "size", - "async": false, - "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit\ninto 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "size", - "required": false, - "spec": [ - { - "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - } - ] - } - }, - { - "alias": "recordVideoDir", - "async": false, - "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure\nto call [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_video_dir" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideoDir", - "required": false, - "spec": [ - { - "text": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "recordVideoSize", - "async": false, - "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will\nbe scaled down if necessary to fit the specified size.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_video_size" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideoSize", - "required": false, - "spec": [ - { - "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "screen", - "async": false, - "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`\nis set.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "csharp": "screenSize", - "java": "screenSize" - }, - "overrides": {}, - "types": {} - }, - "name": "screen", - "required": false, - "spec": [ - { - "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "storageState", - "async": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with\nthe following fields:", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "storageState", - "required": false, - "spec": [ - { - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with the following fields:", - "type": "text" - } - ], - "type": { - "expression": "[path]|[Object]", - "name": "", - "union": [ - { - "name": "path" - }, - { - "name": "Object", - "properties": [ - { - "alias": "cookies", - "async": false, - "comment": "Optional cookies to set for context", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "cookies", - "required": false, - "spec": [ - { - "text": "Optional cookies to set for context", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "url", - "async": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "Optional either url or domain / path are required", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "domain", - "async": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "domain", - "required": false, - "spec": [ - { - "text": "Optional either url or domain / path are required", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Optional either url or domain / path are required", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "expires", - "async": false, - "comment": "Optional Unix time in seconds.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "expires", - "required": false, - "spec": [ - { - "text": "Optional Unix time in seconds.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "httpOnly", - "async": false, - "comment": "Optional httpOnly flag", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpOnly", - "required": false, - "spec": [ - { - "text": "Optional httpOnly flag", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "secure", - "async": false, - "comment": "Optional secure flag", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "secure", - "required": false, - "spec": [ - { - "text": "Optional secure flag", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "sameSite", - "async": false, - "comment": "Optional sameSite flag", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "sameSite", - "required": false, - "spec": [ - { - "text": "Optional sameSite flag", - "type": "text" - } - ], - "type": { - "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">", - "name": "SameSiteAttribute", - "union": [ - { - "name": "\"Strict\"" - }, - { - "name": "\"Lax\"" - }, - { - "name": "\"None\"" - } - ] - } - } - ] - } - ] - } - }, - { - "alias": "origins", - "async": false, - "comment": "Optional localStorage to set for context", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "origins", - "required": false, - "spec": [ - { - "text": "Optional localStorage to set for context", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "origin", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "origin", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "localStorage", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "localStorage", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - ] - } - } - ] - } - ] - } - } - ] - } - ] - } - }, - { - "alias": "storageState", - "async": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "storageState", - "required": false, - "spec": [ - { - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`].", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "storageStatePath", - "async": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "storageStatePath", - "required": false, - "spec": [ - { - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "timezoneId", - "async": false, - "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timezoneId", - "required": false, - "spec": [ - { - "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "userAgent", - "async": false, - "comment": "Specific user agent to use in this context.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "userAgent", - "required": false, - "spec": [ - { - "text": "Specific user agent to use in this context.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "videoSize", - "async": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "videoSize", - "required": false, - "spec": [ - { - "text": "**DEPRECATED** Use `recordVideo` instead.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "videosPath", - "async": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "videosPath", - "required": false, - "spec": [ - { - "text": "**DEPRECATED** Use `recordVideo` instead.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "viewport", - "async": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "csharp": "viewportSize", - "java": "viewportSize" - }, - "only": [ - "js", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "viewport", - "required": false, - "spec": [ - { - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - }, - { - "alias": "viewport", - "async": false, - "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "viewport", - "required": false, - "spec": [ - { - "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[BrowserContext]", - "name": "BrowserContext" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "name": "void" - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "url", - "async": false, - "comment": "either url or domain / path are required. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "either url or domain / path are required. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "domain", - "async": false, - "comment": "either url or domain / path are required Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "domain", - "required": false, - "spec": [ - { - "text": "either url or domain / path are required Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "either url or domain / path are required Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "either url or domain / path are required Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "expires", - "async": false, - "comment": "Unix time in seconds. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "expires", - "required": false, - "spec": [ - { - "text": "Unix time in seconds. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "httpOnly", - "async": false, - "comment": "Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpOnly", - "required": false, - "spec": [ - { - "text": "Optional.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "secure", - "async": false, - "comment": "Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "secure", - "required": false, - "spec": [ - { - "text": "Optional.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "sameSite", - "async": false, - "comment": "Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "sameSite", - "required": false, - "spec": [ - { - "text": "Optional.", - "type": "text" - } - ], - "type": { - "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">", - "name": "SameSiteAttribute", - "union": [ - { - "name": "\"Strict\"" - }, - { - "name": "\"Lax\"" - }, - { - "name": "\"None\"" - } - ] - } - } - ] - } - ] - }, - { - "name": "void" - }, - { - "expression": "[function]|[string]|[Object]", - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "path", - "async": false, - "comment": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "content", - "async": false, - "comment": "Raw script content. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "content", - "required": false, - "spec": [ - { - "text": "Raw script content. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - ] - }, - { - "expression": "[string]|[path]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "path" - } - ] - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[path]", - "name": "path" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[null]|[Browser]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Browser" - } - ] - }, - { - "name": "void" - }, - { - "name": "void" - }, - { - "name": "void" - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "domain", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "domain", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "expires", - "async": false, - "comment": "Unix time in seconds.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "expires", - "required": true, - "spec": [ - { - "text": "Unix time in seconds.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "httpOnly", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpOnly", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "secure", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "secure", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "sameSite", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "sameSite", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">", - "name": "SameSiteAttribute", - "union": [ - { - "name": "\"Strict\"" - }, - { - "name": "\"Lax\"" - }, - { - "name": "\"None\"" - } - ] - } - } - ] - } - ] - }, - { - "expression": "[string]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]", - "name": "function" - }, - { - "name": "Object", - "properties": [ - { - "alias": "handle", - "async": false, - "comment": "Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is\nsupported. When passing by value, multiple arguments are supported.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handle", - "required": false, - "spec": [ - { - "text": "Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is supported. When passing by value, multiple arguments are supported.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]", - "name": "function" - }, - { - "name": "void" - }, - { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "origin", - "async": false, - "comment": "The [origin] to grant permissions to, e.g. \"https://example.com\".", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "origin", - "required": false, - "spec": [ - { - "text": "The [origin] to grant permissions to, e.g. \"https://example.com\".", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[Array]<[Page]>", - "name": "Array", - "templates": [ - { - "name": "Page" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "args": [ - { - "name": "Route" - }, - { - "name": "Request" - } - ], - "expression": "[function]([Route], [Request])", - "name": "function", - "returnType": null - }, - { - "args": [ - { - "name": "Route" - } - ], - "expression": "[function]([Route])", - "name": "function", - "returnType": null - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "void" - }, - { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "latitude", - "async": false, - "comment": "Latitude between -90 and 90.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "latitude", - "required": true, - "spec": [ - { - "text": "Latitude between -90 and 90.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "longitude", - "async": false, - "comment": "Longitude between -180 and 180.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "longitude", - "required": true, - "spec": [ - { - "text": "Longitude between -180 and 180.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "accuracy", - "async": false, - "comment": "Non-negative accuracy value. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "accuracy", - "required": false, - "spec": [ - { - "text": "Non-negative accuracy value. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - ] - }, - { - "name": "void" - }, - { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "username", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - ] - }, - { - "name": "void" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "cookies", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "cookies", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "domain", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "domain", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "expires", - "async": false, - "comment": "Unix time in seconds.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "expires", - "required": true, - "spec": [ - { - "text": "Unix time in seconds.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "httpOnly", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpOnly", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "secure", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "secure", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "sameSite", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "sameSite", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">", - "name": "SameSiteAttribute", - "union": [ - { - "name": "\"Strict\"" - }, - { - "name": "\"Lax\"" - }, - { - "name": "\"None\"" - } - ] - } - } - ] - } - ] - } - }, - { - "alias": "origins", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "origins", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "origin", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "origin", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "localStorage", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "localStorage", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "value", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - ] - } - } - ] - } - ] - } - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "path", - "async": false, - "comment": "The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current\nworking directory. If no path is provided, storage state is still returned, but won't be saved to the disk.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "args": [ - { - "name": "Route" - }, - { - "name": "Request" - } - ], - "expression": "[function]([Route], [Request])", - "name": "function", - "returnType": null - }, - { - "args": [ - { - "name": "Route" - } - ], - "expression": "[function]([Route])", - "name": "function", - "returnType": null - }, - { - "expression": "[any]", - "name": "any" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]|[Object]", - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": true, - "spec": [ - { - "text": "receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `Page` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `Page` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "Page" - } - ], - "expression": "[function]([Page]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[Any]", - "name": "Any" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "void" - }, - { - "name": "void" - }, - { - "expression": "[ChildProcess]", - "name": "ChildProcess" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Browser]", - "name": "Browser" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "wsEndpoint", - "async": false, - "comment": "A browser websocket endpoint to connect to.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "wsEndpoint", - "required": true, - "spec": [ - { - "text": "A browser websocket endpoint to connect to.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "slowMo", - "async": false, - "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.\nDefaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "slowMo", - "required": false, - "spec": [ - { - "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "logger", - "async": false, - "comment": "Logger sink for Playwright logging. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "logger", - "required": false, - "spec": [ - { - "text": "Logger sink for Playwright logging. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[Logger]", - "name": "Logger" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to\ndisable timeout.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "slowMo", - "async": false, - "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.\nDefaults to 0.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "slowMo", - "required": false, - "spec": [ - { - "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to\ndisable timeout.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Browser]", - "name": "Browser" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "wsEndpoint", - "async": false, - "comment": "A CDP websocket endpoint to connect to.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "wsEndpoint", - "required": true, - "spec": [ - { - "text": "A CDP websocket endpoint to connect to.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "slowMo", - "async": false, - "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.\nDefaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "slowMo", - "required": false, - "spec": [ - { - "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "logger", - "async": false, - "comment": "Logger sink for Playwright logging. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "logger", - "required": false, - "spec": [ - { - "text": "Logger sink for Playwright logging. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[Logger]", - "name": "Logger" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to\ndisable timeout.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Browser]", - "name": "Browser" - }, - { - "name": "Object", - "properties": [ - { - "alias": "args", - "async": false, - "comment": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](http://peter.sh/experiments/chromium-command-line-switches/).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "args", - "required": false, - "spec": [ - { - "text": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "channel", - "async": false, - "comment": "Browser distribution channel. Read more about using\n[Google Chrome and Microsoft Edge](./browsers#google-chrome--microsoft-edge).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "channel", - "required": false, - "spec": [ - { - "text": "Browser distribution channel. Read more about using [Google Chrome and Microsoft Edge](./browsers#google-chrome--microsoft-edge).", - "type": "text" - } - ], - "type": { - "expression": "[BrowserChannel]<\"chrome\"|\"chrome-beta\"|\"chrome-dev\"|\"chrome-canary\"|\"msedge\"|\"msedge-beta\"|\"msedge-dev\"|\"msedge-canary\">", - "name": "BrowserChannel", - "union": [ - { - "name": "\"chrome\"" - }, - { - "name": "\"chrome-beta\"" - }, - { - "name": "\"chrome-dev\"" - }, - { - "name": "\"chrome-canary\"" - }, - { - "name": "\"msedge\"" - }, - { - "name": "\"msedge-beta\"" - }, - { - "name": "\"msedge-dev\"" - }, - { - "name": "\"msedge-canary\"" - } - ] - } - }, - { - "alias": "chromiumSandbox", - "async": false, - "comment": "Enable Chromium sandboxing. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "chromiumSandbox", - "required": false, - "spec": [ - { - "text": "Enable Chromium sandboxing. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "devtools", - "async": false, - "comment": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless`\noption will be set `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "devtools", - "required": false, - "spec": [ - { - "text": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "downloadsPath", - "async": false, - "comment": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is\ndeleted when browser is closed.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "downloadsPath", - "required": false, - "spec": [ - { - "text": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "env", - "async": false, - "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "env", - "required": false, - "spec": [ - { - "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "env", - "async": false, - "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "env", - "required": false, - "spec": [ - { - "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]|[float]|[boolean]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - }, - { - "name": "boolean" - } - ] - } - ] - } - }, - { - "alias": "executablePath", - "async": false, - "comment": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox\nor WebKit, use at your own risk.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "executablePath", - "required": false, - "spec": [ - { - "text": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "firefoxUserPrefs", - "async": false, - "comment": "Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "firefoxUserPrefs", - "required": false, - "spec": [ - { - "text": "Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]|[float]|[boolean]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - }, - { - "name": "boolean" - } - ] - } - ] - } - }, - { - "alias": "firefoxUserPrefs", - "async": false, - "comment": "Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "firefoxUserPrefs", - "required": false, - "spec": [ - { - "text": "Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [any]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "any" - } - ] - } - }, - { - "alias": "handleSIGHUP", - "async": false, - "comment": "Close the browser process on SIGHUP. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGHUP", - "required": false, - "spec": [ - { - "text": "Close the browser process on SIGHUP. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "handleSIGINT", - "async": false, - "comment": "Close the browser process on Ctrl-C. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGINT", - "required": false, - "spec": [ - { - "text": "Close the browser process on Ctrl-C. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "handleSIGTERM", - "async": false, - "comment": "Close the browser process on SIGTERM. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGTERM", - "required": false, - "spec": [ - { - "text": "Close the browser process on SIGTERM. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "headless", - "async": false, - "comment": "Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "headless", - "required": false, - "spec": [ - { - "text": "Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `devtools` option is `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "ignoreAllDefaultArgs", - "async": false, - "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option;\nuse with care. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "ignoreAllDefaultArgs", - "required": false, - "spec": [ - { - "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "ignoreDefaultArgs", - "async": false, - "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "ignoreDefaultArgs", - "required": false, - "spec": [ - { - "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "boolean" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - } - }, - { - "alias": "ignoreDefaultArgs", - "async": false, - "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option;\nuse with care.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "ignoreDefaultArgs", - "required": false, - "spec": [ - { - "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "logger", - "async": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "logger", - "required": false, - "spec": [ - { - "text": "Logger sink for Playwright logging.", - "type": "text" - } - ], - "type": { - "expression": "[Logger]", - "name": "Logger" - } - }, - { - "alias": "proxy", - "async": false, - "comment": "Network proxy settings.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "proxy", - "required": false, - "spec": [ - { - "text": "Network proxy settings.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "server", - "async": false, - "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "server", - "required": true, - "spec": [ - { - "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "bypass", - "async": false, - "comment": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypass", - "required": false, - "spec": [ - { - "text": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "username", - "async": false, - "comment": "Optional username to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": false, - "spec": [ - { - "text": "Optional username to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "Optional password to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": false, - "spec": [ - { - "text": "Optional password to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "slowMo", - "async": false, - "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "slowMo", - "required": false, - "spec": [ - { - "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to\ndisable timeout.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[BrowserContext]", - "name": "BrowserContext" - }, - { - "expression": "[path]", - "name": "path" - }, - { - "name": "Object", - "properties": [ - { - "alias": "acceptDownloads", - "async": false, - "comment": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "acceptDownloads", - "required": false, - "spec": [ - { - "text": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "args", - "async": false, - "comment": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](http://peter.sh/experiments/chromium-command-line-switches/).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "args", - "required": false, - "spec": [ - { - "text": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "bypassCSP", - "async": false, - "comment": "Toggles bypassing page's Content-Security-Policy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypassCSP", - "required": false, - "spec": [ - { - "text": "Toggles bypassing page's Content-Security-Policy.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "channel", - "async": false, - "comment": "Browser distribution channel.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "channel", - "required": false, - "spec": [ - { - "text": "Browser distribution channel.", - "type": "text" - } - ], - "type": { - "expression": "[BrowserChannel]<\"chrome\"|\"chrome-beta\"|\"chrome-dev\"|\"chrome-canary\"|\"msedge\"|\"msedge-beta\"|\"msedge-dev\"|\"msedge-canary\">", - "name": "BrowserChannel", - "union": [ - { - "name": "\"chrome\"" - }, - { - "name": "\"chrome-beta\"" - }, - { - "name": "\"chrome-dev\"" - }, - { - "name": "\"chrome-canary\"" - }, - { - "name": "\"msedge\"" - }, - { - "name": "\"msedge-beta\"" - }, - { - "name": "\"msedge-dev\"" - }, - { - "name": "\"msedge-canary\"" - } - ] - } - }, - { - "alias": "chromiumSandbox", - "async": false, - "comment": "Enable Chromium sandboxing. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "chromiumSandbox", - "required": false, - "spec": [ - { - "text": "Enable Chromium sandboxing. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "colorScheme", - "async": false, - "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "colorScheme", - "required": false, - "spec": [ - { - "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "type": "text" - } - ], - "type": { - "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">", - "name": "ColorScheme", - "union": [ - { - "name": "\"light\"" - }, - { - "name": "\"dark\"" - }, - { - "name": "\"no-preference\"" - } - ] - } - }, - { - "alias": "deviceScaleFactor", - "async": false, - "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "deviceScaleFactor", - "required": false, - "spec": [ - { - "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "devtools", - "async": false, - "comment": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless`\noption will be set `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "devtools", - "required": false, - "spec": [ - { - "text": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "downloadsPath", - "async": false, - "comment": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is\ndeleted when browser is closed.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "downloadsPath", - "required": false, - "spec": [ - { - "text": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "env", - "async": false, - "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "env", - "required": false, - "spec": [ - { - "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "env", - "async": false, - "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "env", - "required": false, - "spec": [ - { - "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]|[float]|[boolean]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - }, - { - "name": "boolean" - } - ] - } - ] - } - }, - { - "alias": "executablePath", - "async": false, - "comment": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled\nChromium, Firefox or WebKit, use at your own risk.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "executablePath", - "required": false, - "spec": [ - { - "text": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "extraHTTPHeaders", - "async": false, - "comment": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "extraHTTPHeaders", - "required": false, - "spec": [ - { - "text": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "geolocation", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "geolocation", - "required": false, - "spec": [], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "latitude", - "async": false, - "comment": "Latitude between -90 and 90.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "latitude", - "required": true, - "spec": [ - { - "text": "Latitude between -90 and 90.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "longitude", - "async": false, - "comment": "Longitude between -180 and 180.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "longitude", - "required": true, - "spec": [ - { - "text": "Longitude between -180 and 180.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "accuracy", - "async": false, - "comment": "Non-negative accuracy value. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "accuracy", - "required": false, - "spec": [ - { - "text": "Non-negative accuracy value. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "handleSIGHUP", - "async": false, - "comment": "Close the browser process on SIGHUP. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGHUP", - "required": false, - "spec": [ - { - "text": "Close the browser process on SIGHUP. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "handleSIGINT", - "async": false, - "comment": "Close the browser process on Ctrl-C. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGINT", - "required": false, - "spec": [ - { - "text": "Close the browser process on Ctrl-C. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "handleSIGTERM", - "async": false, - "comment": "Close the browser process on SIGTERM. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGTERM", - "required": false, - "spec": [ - { - "text": "Close the browser process on SIGTERM. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "hasTouch", - "async": false, - "comment": "Specifies if viewport supports touch events. Defaults to false.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "hasTouch", - "required": false, - "spec": [ - { - "text": "Specifies if viewport supports touch events. Defaults to false.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "headless", - "async": false, - "comment": "Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "headless", - "required": false, - "spec": [ - { - "text": "Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `devtools` option is `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "httpCredentials", - "async": false, - "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "httpCredentials", - "required": false, - "spec": [ - { - "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "username", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "ignoreAllDefaultArgs", - "async": false, - "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option;\nuse with care. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "ignoreAllDefaultArgs", - "required": false, - "spec": [ - { - "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "ignoreDefaultArgs", - "async": false, - "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "ignoreDefaultArgs", - "required": false, - "spec": [ - { - "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "boolean" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - } - }, - { - "alias": "ignoreDefaultArgs", - "async": false, - "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option;\nuse with care.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "ignoreDefaultArgs", - "required": false, - "spec": [ - { - "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "ignoreHTTPSErrors", - "async": false, - "comment": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "ignoreHTTPSErrors", - "required": false, - "spec": [ - { - "text": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "isMobile", - "async": false, - "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported\nin Firefox.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "isMobile", - "required": false, - "spec": [ - { - "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "javaScriptEnabled", - "async": false, - "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "javaScriptEnabled", - "required": false, - "spec": [ - { - "text": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "locale", - "async": false, - "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`\nrequest header value as well as number and date formatting rules.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "locale", - "required": false, - "spec": [ - { - "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "logger", - "async": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "logger", - "required": false, - "spec": [ - { - "text": "Logger sink for Playwright logging.", - "type": "text" - } - ], - "type": { - "expression": "[Logger]", - "name": "Logger" - } - }, - { - "alias": "noViewport", - "async": false, - "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "noViewport", - "required": false, - "spec": [ - { - "text": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "offline", - "async": false, - "comment": "Whether to emulate network being offline. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "offline", - "required": false, - "spec": [ - { - "text": "Whether to emulate network being offline. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "permissions", - "async": false, - "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more\ndetails.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "permissions", - "required": false, - "spec": [ - { - "text": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more details.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "proxy", - "async": false, - "comment": "Network proxy settings.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "proxy", - "required": false, - "spec": [ - { - "text": "Network proxy settings.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "server", - "async": false, - "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "server", - "required": true, - "spec": [ - { - "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "bypass", - "async": false, - "comment": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypass", - "required": false, - "spec": [ - { - "text": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "username", - "async": false, - "comment": "Optional username to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": false, - "spec": [ - { - "text": "Optional username to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "Optional password to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": false, - "spec": [ - { - "text": "Optional password to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "recordHar", - "async": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not\nspecified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHar", - "required": false, - "spec": [ - { - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "omitContent", - "async": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "omitContent", - "required": false, - "spec": [ - { - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path on the filesystem to write the HAR file to.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": true, - "spec": [ - { - "text": "Path on the filesystem to write the HAR file to.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - } - ] - } - }, - { - "alias": "recordHarOmitContent", - "async": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_har_omit_content" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHarOmitContent", - "required": false, - "spec": [ - { - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "recordHarPath", - "async": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the\nfilesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to\nbe saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_har_path" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordHarPath", - "required": false, - "spec": [ - { - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "recordVideo", - "async": false, - "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make\nsure to await [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideo", - "required": false, - "spec": [ - { - "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [`method: BrowserContext.close`] for videos to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "dir", - "async": false, - "comment": "Path to the directory to put videos into.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "dir", - "required": true, - "spec": [ - { - "text": "Path to the directory to put videos into.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "size", - "async": false, - "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit\ninto 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "size", - "required": false, - "spec": [ - { - "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - } - ] - } - }, - { - "alias": "recordVideoDir", - "async": false, - "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure\nto call [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_video_dir" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideoDir", - "required": false, - "spec": [ - { - "text": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "recordVideoSize", - "async": false, - "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will\nbe scaled down if necessary to fit the specified size.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "python": "record_video_size" - }, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "recordVideoSize", - "required": false, - "spec": [ - { - "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "screen", - "async": false, - "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`\nis set.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "csharp": "screenSize", - "java": "screenSize" - }, - "overrides": {}, - "types": {} - }, - "name": "screen", - "required": false, - "spec": [ - { - "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "slowMo", - "async": false, - "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.\nDefaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "slowMo", - "required": false, - "spec": [ - { - "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to\ndisable timeout.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timezoneId", - "async": false, - "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timezoneId", - "required": false, - "spec": [ - { - "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "userAgent", - "async": false, - "comment": "Specific user agent to use in this context.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "userAgent", - "required": false, - "spec": [ - { - "text": "Specific user agent to use in this context.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "videoSize", - "async": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "videoSize", - "required": false, - "spec": [ - { - "text": "**DEPRECATED** Use `recordVideo` instead.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "Video frame width.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "Video frame width.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "Video frame height.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "Video frame height.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - }, - { - "alias": "videosPath", - "async": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "videosPath", - "required": false, - "spec": [ - { - "text": "**DEPRECATED** Use `recordVideo` instead.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "viewport", - "async": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": { - "csharp": "viewportSize", - "java": "viewportSize" - }, - "only": [ - "js", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "viewport", - "required": false, - "spec": [ - { - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - }, - { - "alias": "viewport", - "async": false, - "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "viewport", - "required": false, - "spec": [ - { - "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - } - ] - }, - { - "expression": "[BrowserServer]", - "name": "BrowserServer" - }, - { - "name": "Object", - "properties": [ - { - "alias": "args", - "async": false, - "comment": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](http://peter.sh/experiments/chromium-command-line-switches/).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "args", - "required": false, - "spec": [ - { - "text": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "chromiumSandbox", - "async": false, - "comment": "Enable Chromium sandboxing. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "chromiumSandbox", - "required": false, - "spec": [ - { - "text": "Enable Chromium sandboxing. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "devtools", - "async": false, - "comment": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless`\noption will be set `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "devtools", - "required": false, - "spec": [ - { - "text": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "downloadsPath", - "async": false, - "comment": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is\ndeleted when browser is closed.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "downloadsPath", - "required": false, - "spec": [ - { - "text": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "env", - "async": false, - "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "env", - "required": false, - "spec": [ - { - "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]|[float]|[boolean]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - }, - { - "name": "boolean" - } - ] - } - ] - } - }, - { - "alias": "executablePath", - "async": false, - "comment": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled\nChromium, Firefox or WebKit, use at your own risk.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "executablePath", - "required": false, - "spec": [ - { - "text": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "firefoxUserPrefs", - "async": false, - "comment": "Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "firefoxUserPrefs", - "required": false, - "spec": [ - { - "text": "Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]|[float]|[boolean]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - }, - { - "name": "boolean" - } - ] - } - ] - } - }, - { - "alias": "handleSIGHUP", - "async": false, - "comment": "Close the browser process on SIGHUP. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGHUP", - "required": false, - "spec": [ - { - "text": "Close the browser process on SIGHUP. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "handleSIGINT", - "async": false, - "comment": "Close the browser process on Ctrl-C. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGINT", - "required": false, - "spec": [ - { - "text": "Close the browser process on Ctrl-C. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "handleSIGTERM", - "async": false, - "comment": "Close the browser process on SIGTERM. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handleSIGTERM", - "required": false, - "spec": [ - { - "text": "Close the browser process on SIGTERM. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "headless", - "async": false, - "comment": "Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "headless", - "required": false, - "spec": [ - { - "text": "Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `devtools` option is `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "ignoreDefaultArgs", - "async": false, - "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "ignoreDefaultArgs", - "required": false, - "spec": [ - { - "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "boolean" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - } - }, - { - "alias": "logger", - "async": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js" - ], - "overrides": {}, - "types": {} - }, - "name": "logger", - "required": false, - "spec": [ - { - "text": "Logger sink for Playwright logging.", - "type": "text" - } - ], - "type": { - "expression": "[Logger]", - "name": "Logger" - } - }, - { - "alias": "port", - "async": false, - "comment": "Port to use for the web socket. Defaults to 0 that picks any available port.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "port", - "required": false, - "spec": [ - { - "text": "Port to use for the web socket. Defaults to 0 that picks any available port.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "proxy", - "async": false, - "comment": "Network proxy settings.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "proxy", - "required": false, - "spec": [ - { - "text": "Network proxy settings.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "server", - "async": false, - "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "server", - "required": true, - "spec": [ - { - "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "bypass", - "async": false, - "comment": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bypass", - "required": false, - "spec": [ - { - "text": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "username", - "async": false, - "comment": "Optional username to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "username", - "required": false, - "spec": [ - { - "text": "Optional username to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "password", - "async": false, - "comment": "Optional password to use if HTTP proxy requires authentication.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "password", - "required": false, - "spec": [ - { - "text": "Optional password to use if HTTP proxy requires authentication.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to\ndisable timeout.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[Object]", - "name": "Object" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Object]", - "name": "Object" - }, - { - "expression": "[CDPSession]", - "name": "CDPSession" - }, - { - "name": "void" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "name": "Object", - "properties": [ - { - "alias": "categories", - "async": false, - "comment": "specify custom categories to use instead of default.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "categories", - "required": false, - "spec": [ - { - "text": "specify custom categories to use instead of default.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "path", - "async": false, - "comment": "A path to write the trace file to.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "A path to write the trace file to.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "screenshots", - "async": false, - "comment": "captures screenshots in the trace.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "screenshots", - "required": false, - "spec": [ - { - "text": "captures screenshots in the trace.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - } - ] - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[Worker]", - "name": "Worker" - }, - { - "expression": "[Array]<[Page]>", - "name": "Array", - "templates": [ - { - "name": "Page" - } - ] - }, - { - "expression": "[CDPSession]", - "name": "CDPSession" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[Array]<[Worker]>", - "name": "Array", - "templates": [ - { - "name": "Worker" - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "resetOnNavigation", - "async": false, - "comment": "Whether to reset coverage on every navigation. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "resetOnNavigation", - "required": false, - "spec": [ - { - "text": "Whether to reset coverage on every navigation. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "reportAnonymousScripts", - "async": false, - "comment": "Whether anonymous scripts generated by the page should be reported. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "reportAnonymousScripts", - "required": false, - "spec": [ - { - "text": "Whether anonymous scripts generated by the page should be reported. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "resetOnNavigation", - "async": false, - "comment": "Whether to reset coverage on every navigation. Defaults to `true`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "resetOnNavigation", - "required": false, - "spec": [ - { - "text": "Whether to reset coverage on every navigation. Defaults to `true`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - } - ] - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "url", - "async": false, - "comment": "StyleSheet URL", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": true, - "spec": [ - { - "text": "StyleSheet URL", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "text", - "async": false, - "comment": "StyleSheet content, if available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "text", - "required": false, - "spec": [ - { - "text": "StyleSheet content, if available.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "ranges", - "async": false, - "comment": "StyleSheet ranges that were used. Ranges are sorted and non-overlapping.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "ranges", - "required": true, - "spec": [ - { - "text": "StyleSheet ranges that were used. Ranges are sorted and non-overlapping.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "start", - "async": false, - "comment": "A start offset in text, inclusive", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "start", - "required": true, - "spec": [ - { - "text": "A start offset in text, inclusive", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "end", - "async": false, - "comment": "An end offset in text, exclusive", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "end", - "required": true, - "spec": [ - { - "text": "An end offset in text, exclusive", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - } - ] - } - ] - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "url", - "async": false, - "comment": "Script URL", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": true, - "spec": [ - { - "text": "Script URL", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "scriptId", - "async": false, - "comment": "Script ID", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "scriptId", - "required": true, - "spec": [ - { - "text": "Script ID", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "source", - "async": false, - "comment": "Script content, if applicable.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "source", - "required": false, - "spec": [ - { - "text": "Script content, if applicable.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "functions", - "async": false, - "comment": "V8-specific coverage format.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "functions", - "required": true, - "spec": [ - { - "text": "V8-specific coverage format.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "functionName", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "functionName", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "isBlockCoverage", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "isBlockCoverage", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "ranges", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "ranges", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "count", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "count", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "startOffset", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "startOffset", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "endOffset", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "endOffset", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - } - ] - } - ] - } - } - ] - } - ] - }, - { - "expression": "[Array]<[JSHandle]>", - "name": "Array", - "templates": [ - { - "name": "JSHandle" - } - ] - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "url", - "async": false, - "comment": "URL of the resource.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": true, - "spec": [ - { - "text": "URL of the resource.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "lineNumber", - "async": false, - "comment": "0-based line number in the resource.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "lineNumber", - "required": true, - "spec": [ - { - "text": "0-based line number in the resource.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "columnNumber", - "async": false, - "comment": "0-based column number in the resource.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "columnNumber", - "required": true, - "spec": [ - { - "text": "0-based column number in the resource.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[null]|[Readable]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Readable" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[null]|[path]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "path" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[path]", - "name": "path" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[ElectronApplication]", - "name": "ElectronApplication" - }, - { - "name": "Object", - "properties": [ - { - "alias": "args", - "async": false, - "comment": "Additional arguments to pass to the application when launching. You typically pass the main script name here.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "args", - "required": false, - "spec": [ - { - "text": "Additional arguments to pass to the application when launching. You typically pass the main script name here.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - }, - { - "alias": "cwd", - "async": false, - "comment": "Current working directory to launch application from.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "cwd", - "required": false, - "spec": [ - { - "text": "Current working directory to launch application from.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "env", - "async": false, - "comment": "Specifies environment variables that will be visible to Electron. Defaults to `process.env`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "env", - "required": false, - "spec": [ - { - "text": "Specifies environment variables that will be visible to Electron. Defaults to `process.env`.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "executablePath", - "async": false, - "comment": "Launches given Electron application. If not specified, launches the default Electron executable installed in this\npackage, located at `node_modules/.bin/electron`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "executablePath", - "required": false, - "spec": [ - { - "text": "Launches given Electron application. If not specified, launches the default Electron executable installed in this package, located at `node_modules/.bin/electron`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "name": "void" - }, - { - "expression": "[BrowserContext]", - "name": "BrowserContext" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[JSHandle]", - "name": "JSHandle" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[any]", - "name": "any" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]|[Object]", - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": true, - "spec": [ - { - "text": "receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - ] - }, - { - "expression": "[Array]<[Page]>", - "name": "Array", - "templates": [ - { - "name": "Page" - } - ] - }, - { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "the x coordinate of the element in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "the x coordinate of the element in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "the y coordinate of the element in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "the y coordinate of the element in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "width", - "async": false, - "comment": "the width of the element in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "the width of the element in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "height", - "async": false, - "comment": "the height of the element in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "the height of the element in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "clickCount", - "async": false, - "comment": "defaults to 1. See [UIEvent.detail].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "clickCount", - "required": false, - "spec": [ - { - "text": "defaults to 1. See [UIEvent.detail].", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[Frame]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Frame" - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[null]|[Frame]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Frame" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[ElementHandle]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Array]<[ElementHandle]>", - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "name": "Object", - "properties": [ - { - "alias": "omitBackground", - "async": false, - "comment": "Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "omitBackground", - "required": false, - "spec": [ - { - "text": "Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "path", - "async": false, - "comment": "The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative\npath, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to\nthe disk.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "quality", - "async": false, - "comment": "The quality of the image, between 0-100. Not applicable to `png` images.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "quality", - "required": false, - "spec": [ - { - "text": "The quality of the image, between 0-100. Not applicable to `png` images.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "type", - "async": false, - "comment": "Specify screenshot type, defaults to `png`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "type", - "required": false, - "spec": [ - { - "text": "Specify screenshot type, defaults to `png`.", - "type": "text" - } - ], - "type": { - "expression": "[ScreenshotType]<\"png\"|\"jpeg\">", - "name": "ScreenshotType", - "union": [ - { - "name": "\"png\"" - }, - { - "name": "\"jpeg\"" - } - ] - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - }, - { - "expression": "[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - }, - { - "name": "ElementHandle" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - }, - { - "expression": "[ElementHandle]|[Array]<[ElementHandle]>", - "name": "", - "union": [ - { - "name": "ElementHandle" - }, - { - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - } - ] - }, - { - "expression": "[int]|[Array]<[int]>", - "name": "", - "union": [ - { - "name": "int" - }, - { - "name": "Array", - "templates": [ - { - "name": "int" - } - ] - } - ] - }, - { - "expression": "[string]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - }, - { - "expression": "[string]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[path]|[Array]<[path]>|[Object]|[Array]<[Object]>", - "name": "", - "union": [ - { - "name": "path" - }, - { - "name": "Array", - "templates": [ - { - "name": "path" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "File name", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "File name", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "mimeType", - "async": false, - "comment": "File type", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mimeType", - "required": true, - "spec": [ - { - "text": "File type", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "buffer", - "async": false, - "comment": "File content", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "buffer", - "required": true, - "spec": [ - { - "text": "File content", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "File name", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "File name", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "mimeType", - "async": false, - "comment": "File type", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mimeType", - "required": true, - "spec": [ - { - "text": "File type", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "buffer", - "async": false, - "comment": "File content", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "buffer", - "required": true, - "spec": [ - { - "text": "File content", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - } - ] - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "delay", - "async": false, - "comment": "Time to wait between key presses in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between key presses in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[ElementState]<\"visible\"|\"hidden\"|\"stable\"|\"enabled\"|\"disabled\"|\"editable\">", - "name": "ElementState", - "union": [ - { - "name": "\"visible\"" - }, - { - "name": "\"hidden\"" - }, - { - "name": "\"stable\"" - }, - { - "name": "\"enabled\"" - }, - { - "name": "\"disabled\"" - }, - { - "name": "\"editable\"" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[ElementHandle]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "state", - "async": false, - "comment": "Defaults to `'visible'`. Can be either:\n- `'attached'` - wait for element to be present in DOM.\n- `'detached'` - wait for element to not be present in DOM.\n- `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without\n any content or with `display:none` has an empty bounding box and is not considered visible.\n- `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.\n This is opposite to the `'visible'` option.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "state", - "required": false, - "spec": [ - { - "text": "Defaults to `'visible'`. Can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'attached'` - wait for element to be present in DOM.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'detached'` - wait for element to not be present in DOM.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without any content or with `display:none` has an empty bounding box and is not considered visible.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`. This is opposite to the `'visible'` option.", - "type": "li" - } - ], - "type": { - "expression": "[WaitForSelectorState]<\"attached\"|\"detached\"|\"visible\"|\"hidden\">", - "name": "WaitForSelectorState", - "union": [ - { - "name": "\"attached\"" - }, - { - "name": "\"detached\"" - }, - { - "name": "\"visible\"" - }, - { - "name": "\"hidden\"" - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[ElementHandle]", - "name": "ElementHandle" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "name": "void" - }, - { - "expression": "[path]|[Array]<[path]>|[Object]|[Array]<[Object]>", - "name": "", - "union": [ - { - "name": "path" - }, - { - "name": "Array", - "templates": [ - { - "name": "path" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "File name", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "File name", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "mimeType", - "async": false, - "comment": "File type", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mimeType", - "required": true, - "spec": [ - { - "text": "File type", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "buffer", - "async": false, - "comment": "File content", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "buffer", - "required": true, - "spec": [ - { - "text": "File content", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "File name", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "File name", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "mimeType", - "async": false, - "comment": "File type", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mimeType", - "required": true, - "spec": [ - { - "text": "File type", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "buffer", - "async": false, - "comment": "File content", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "buffer", - "required": true, - "spec": [ - { - "text": "File content", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - } - ] - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[ElementHandle]", - "name": "ElementHandle" - }, - { - "name": "Object", - "properties": [ - { - "alias": "content", - "async": false, - "comment": "Raw JavaScript content to be injected into frame.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "content", - "required": false, - "spec": [ - { - "text": "Raw JavaScript content to be injected into frame.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the\ncurrent working directory.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "type", - "async": false, - "comment": "Script type. Use 'module' in order to load a Javascript ES6 module. See\n[script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "type", - "required": false, - "spec": [ - { - "text": "Script type. Use 'module' in order to load a Javascript ES6 module. See [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "url", - "async": false, - "comment": "URL of a script to be added.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "URL of a script to be added.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "expression": "[ElementHandle]", - "name": "ElementHandle" - }, - { - "name": "Object", - "properties": [ - { - "alias": "content", - "async": false, - "comment": "Raw CSS content to be injected into frame.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "content", - "required": false, - "spec": [ - { - "text": "Raw CSS content to be injected into frame.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the\ncurrent working directory.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "url", - "async": false, - "comment": "URL of the `` tag.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "URL of the `` tag.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Array]<[Frame]>", - "name": "Array", - "templates": [ - { - "name": "Frame" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "clickCount", - "async": false, - "comment": "defaults to 1. See [UIEvent.detail].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "clickCount", - "required": false, - "spec": [ - { - "text": "defaults to 1. See [UIEvent.detail].", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[JSHandle]", - "name": "JSHandle" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[ElementHandle]", - "name": "ElementHandle" - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[Response]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Response" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "referer", - "async": false, - "comment": "Referer header value. If provided it will take preference over the referer header value set by\n[`method: Page.setExtraHTTPHeaders`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "referer", - "required": false, - "spec": [ - { - "text": "Referer header value. If provided it will take preference over the referer header value set by [`method: Page.setExtraHTTPHeaders`].", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[null]|[Frame]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Frame" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[ElementHandle]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Array]<[ElementHandle]>", - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - }, - { - "name": "ElementHandle" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - }, - { - "expression": "[ElementHandle]|[Array]<[ElementHandle]>", - "name": "", - "union": [ - { - "name": "ElementHandle" - }, - { - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - } - ] - }, - { - "expression": "[int]|[Array]<[int]>", - "name": "", - "union": [ - { - "name": "int" - }, - { - "name": "Array", - "templates": [ - { - "name": "int" - } - ] - } - ] - }, - { - "expression": "[string]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - }, - { - "expression": "[string]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[path]|[Array]<[path]>|[Object]|[Array]<[Object]>", - "name": "", - "union": [ - { - "name": "path" - }, - { - "name": "Array", - "templates": [ - { - "name": "path" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "File name", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "File name", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "mimeType", - "async": false, - "comment": "File type", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mimeType", - "required": true, - "spec": [ - { - "text": "File type", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "buffer", - "async": false, - "comment": "File content", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "buffer", - "required": true, - "spec": [ - { - "text": "File content", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "File name", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "File name", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "mimeType", - "async": false, - "comment": "File type", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mimeType", - "required": true, - "spec": [ - { - "text": "File type", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "buffer", - "async": false, - "comment": "File content", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "buffer", - "required": true, - "spec": [ - { - "text": "File content", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - } - ] - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "delay", - "async": false, - "comment": "Time to wait between key presses in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between key presses in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[JSHandle]", - "name": "JSHandle" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "name": "Object", - "properties": [ - { - "alias": "polling", - "async": false, - "comment": "If `polling` is `'raf'`, then `expression` is constantly executed in `requestAnimationFrame` callback. If `polling` is a\nnumber, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to `raf`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "polling", - "required": false, - "spec": [ - { - "text": "If `polling` is `'raf'`, then `expression` is constantly executed in `requestAnimationFrame` callback. If `polling` is a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to `raf`.", - "type": "text" - } - ], - "type": { - "expression": "[float]|\"raf\"", - "name": "", - "union": [ - { - "name": "float" - }, - { - "name": "\"raf\"" - } - ] - } - }, - { - "alias": "pollingInterval", - "async": false, - "comment": "If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if\nthe option is not specified `expression` is executed in `requestAnimationFrame` callback.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "pollingInterval", - "required": false, - "spec": [ - { - "text": "If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if the option is not specified `expression` is executed in `requestAnimationFrame` callback.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[LoadState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "LoadState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[Response]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Response" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "url", - "async": false, - "comment": "A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[null]|[ElementHandle]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "state", - "async": false, - "comment": "Defaults to `'visible'`. Can be either:\n- `'attached'` - wait for element to be present in DOM.\n- `'detached'` - wait for element to not be present in DOM.\n- `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without\n any content or with `display:none` has an empty bounding box and is not considered visible.\n- `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.\n This is opposite to the `'visible'` option.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "state", - "required": false, - "spec": [ - { - "text": "Defaults to `'visible'`. Can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'attached'` - wait for element to be present in DOM.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'detached'` - wait for element to not be present in DOM.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without any content or with `display:none` has an empty bounding box and is not considered visible.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`. This is opposite to the `'visible'` option.", - "type": "li" - } - ], - "type": { - "expression": "[WaitForSelectorState]<\"attached\"|\"detached\"|\"visible\"|\"hidden\">", - "name": "WaitForSelectorState", - "union": [ - { - "name": "\"attached\"" - }, - { - "name": "\"detached\"" - }, - { - "name": "\"visible\"" - }, - { - "name": "\"hidden\"" - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "void" - }, - { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "expression": "[null]|[ElementHandle]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ElementHandle" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[JSHandle]", - "name": "JSHandle" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[Map]<[string], [JSHandle]>", - "name": "Map", - "templates": [ - { - "name": "string" - }, - { - "name": "JSHandle" - } - ] - }, - { - "expression": "[JSHandle]", - "name": "JSHandle" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "delay", - "async": false, - "comment": "Time to wait between key presses in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between key presses in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "\"verbose\"|\"info\"|\"warning\"|\"error\"", - "name": "", - "union": [ - { - "name": "\"verbose\"" - }, - { - "name": "\"info\"" - }, - { - "name": "\"warning\"" - }, - { - "name": "\"error\"" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "\"verbose\"|\"info\"|\"warning\"|\"error\"", - "name": "", - "union": [ - { - "name": "\"verbose\"" - }, - { - "name": "\"info\"" - }, - { - "name": "\"warning\"" - }, - { - "name": "\"error\"" - } - ] - }, - { - "expression": "[string]|[Error]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Error" - } - ] - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object" - } - ] - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "color", - "async": false, - "comment": "Optional preferred logger color.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "color", - "required": false, - "spec": [ - { - "text": "Optional preferred logger color.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "clickCount", - "async": false, - "comment": "defaults to 1. See [UIEvent.detail].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "clickCount", - "required": false, - "spec": [ - { - "text": "defaults to 1. See [UIEvent.detail].", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "clickCount", - "async": false, - "comment": "defaults to 1. See [UIEvent.detail].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "clickCount", - "required": false, - "spec": [ - { - "text": "defaults to 1. See [UIEvent.detail].", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "Object", - "properties": [ - { - "alias": "steps", - "async": false, - "comment": "defaults to 1. Sends intermediate `mousemove` events.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "steps", - "required": false, - "spec": [ - { - "text": "defaults to 1. Sends intermediate `mousemove` events.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "clickCount", - "async": false, - "comment": "defaults to 1. See [UIEvent.detail].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "clickCount", - "required": false, - "spec": [ - { - "text": "defaults to 1. See [UIEvent.detail].", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[ConsoleMessage]", - "name": "ConsoleMessage" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[Dialog]", - "name": "Dialog" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[Download]", - "name": "Download" - }, - { - "expression": "[FileChooser]", - "name": "FileChooser" - }, - { - "expression": "[Frame]", - "name": "Frame" - }, - { - "expression": "[Frame]", - "name": "Frame" - }, - { - "expression": "[Frame]", - "name": "Frame" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[Error]", - "name": "Error" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "expression": "[Request]", - "name": "Request" - }, - { - "expression": "[Request]", - "name": "Request" - }, - { - "expression": "[Request]", - "name": "Request" - }, - { - "expression": "[Response]", - "name": "Response" - }, - { - "expression": "[WebSocket]", - "name": "WebSocket" - }, - { - "expression": "[Worker]", - "name": "Worker" - }, - { - "expression": "[Accessibility]", - "name": "Accessibility" - }, - { - "name": "void" - }, - { - "expression": "[function]|[string]|[Object]", - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "path", - "async": false, - "comment": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "content", - "async": false, - "comment": "Raw script content. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "content", - "required": false, - "spec": [ - { - "text": "Raw script content. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - ] - }, - { - "expression": "[string]|[path]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "path" - } - ] - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[path]", - "name": "path" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[ElementHandle]", - "name": "ElementHandle" - }, - { - "name": "Object", - "properties": [ - { - "alias": "content", - "async": false, - "comment": "Raw JavaScript content to be injected into frame.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "content", - "required": false, - "spec": [ - { - "text": "Raw JavaScript content to be injected into frame.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the\ncurrent working directory.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "type", - "async": false, - "comment": "Script type. Use 'module' in order to load a Javascript ES6 module. See\n[script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "type", - "required": false, - "spec": [ - { - "text": "Script type. Use 'module' in order to load a Javascript ES6 module. See [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "url", - "async": false, - "comment": "URL of a script to be added.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "URL of a script to be added.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "expression": "[ElementHandle]", - "name": "ElementHandle" - }, - { - "name": "Object", - "properties": [ - { - "alias": "content", - "async": false, - "comment": "Raw CSS content to be injected into frame.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "content", - "required": false, - "spec": [ - { - "text": "Raw CSS content to be injected into frame.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the\ncurrent working directory.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "url", - "async": false, - "comment": "URL of the `` tag.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "URL of the `` tag.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "clickCount", - "async": false, - "comment": "defaults to 1. See [UIEvent.detail].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "clickCount", - "required": false, - "spec": [ - { - "text": "defaults to 1. See [UIEvent.detail].", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "runBeforeUnload", - "async": false, - "comment": "Defaults to `false`. Whether to run the\n[before unload](https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload) page handlers.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "runBeforeUnload", - "required": false, - "spec": [ - { - "text": "Defaults to `false`. Whether to run the [before unload](https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload) page handlers.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[BrowserContext]", - "name": "BrowserContext" - }, - { - "expression": "[null]|[ChromiumCoverage]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ChromiumCoverage" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "button", - "async": false, - "comment": "Defaults to `left`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "button", - "required": false, - "spec": [ - { - "text": "Defaults to `left`.", - "type": "text" - } - ], - "type": { - "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">", - "name": "MouseButton", - "union": [ - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - }, - { - "name": "\"middle\"" - } - ] - } - }, - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "colorScheme", - "async": false, - "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. Passing\n`null` disables color scheme emulation.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "colorScheme", - "required": false, - "spec": [ - { - "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. Passing `null` disables color scheme emulation.", - "type": "text" - } - ], - "type": { - "expression": "null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ColorScheme", - "union": [ - { - "name": "\"light\"" - }, - { - "name": "\"dark\"" - }, - { - "name": "\"no-preference\"" - } - ] - } - ] - } - }, - { - "alias": "media", - "async": false, - "comment": "Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`. Passing `null`\ndisables CSS media emulation.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "media", - "required": false, - "spec": [ - { - "text": "Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`. Passing `null` disables CSS media emulation.", - "type": "text" - } - ], - "type": { - "expression": "null|[Media]<\"screen\"|\"print\">", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Media", - "union": [ - { - "name": "\"screen\"" - }, - { - "name": "\"print\"" - } - ] - } - ] - } - } - ] - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[JSHandle]", - "name": "JSHandle" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]", - "name": "function" - }, - { - "name": "Object", - "properties": [ - { - "alias": "handle", - "async": false, - "comment": "Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is\nsupported. When passing by value, multiple arguments are supported.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "handle", - "required": false, - "spec": [ - { - "text": "Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is supported. When passing by value, multiple arguments are supported.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]", - "name": "function" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[Frame]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Frame" - } - ] - }, - { - "expression": "[string]|[Object]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "Frame name specified in the `iframe`'s `name` attribute. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": false, - "spec": [ - { - "text": "Frame name specified in the `iframe`'s `name` attribute. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "url", - "async": false, - "comment": "A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - } - } - ] - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "Frame name specified in the `iframe`'s `name` attribute. Optional.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "name", - "required": false, - "spec": [ - { - "text": "Frame name specified in the `iframe`'s `name` attribute. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "url", - "async": false, - "comment": "A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object. Optional.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "url", - "required": false, - "spec": [ - { - "text": "A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - } - } - ] - }, - { - "expression": "[null]|[Frame]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Frame" - } - ] - }, - { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "expression": "[Array]<[Frame]>", - "name": "Array", - "templates": [ - { - "name": "Frame" - } - ] - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[Response]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Response" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "expression": "[null]|[Response]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Response" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "expression": "[null]|[Response]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Response" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "referer", - "async": false, - "comment": "Referer header value. If provided it will take preference over the referer header value set by\n[`method: Page.setExtraHTTPHeaders`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "referer", - "required": false, - "spec": [ - { - "text": "Referer header value. If provided it will take preference over the referer header value set by [`method: Page.setExtraHTTPHeaders`].", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Keyboard]", - "name": "Keyboard" - }, - { - "expression": "[Frame]", - "name": "Frame" - }, - { - "expression": "[Mouse]", - "name": "Mouse" - }, - { - "expression": "[null]|[Page]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Page" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "name": "Object", - "properties": [ - { - "alias": "displayHeaderFooter", - "async": false, - "comment": "Display header and footer. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "displayHeaderFooter", - "required": false, - "spec": [ - { - "text": "Display header and footer. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "footerTemplate", - "async": false, - "comment": "HTML template for the print footer. Should use the same format as the `headerTemplate`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "footerTemplate", - "required": false, - "spec": [ - { - "text": "HTML template for the print footer. Should use the same format as the `headerTemplate`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "format", - "async": false, - "comment": "Paper format. If set, takes priority over `width` or `height` options. Defaults to 'Letter'.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "format", - "required": false, - "spec": [ - { - "text": "Paper format. If set, takes priority over `width` or `height` options. Defaults to 'Letter'.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "headerTemplate", - "async": false, - "comment": "HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values\ninto them:\n- `'date'` formatted print date\n- `'title'` document title\n- `'url'` document location\n- `'pageNumber'` current page number\n- `'totalPages'` total pages in the document", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "headerTemplate", - "required": false, - "spec": [ - { - "text": "HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'date'` formatted print date", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'title'` document title", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'url'` document location", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'pageNumber'` current page number", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'totalPages'` total pages in the document", - "type": "li" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "height", - "async": false, - "comment": "Paper height, accepts values labeled with units.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "height", - "required": false, - "spec": [ - { - "text": "Paper height, accepts values labeled with units.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[float]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - } - ] - } - }, - { - "alias": "height", - "async": false, - "comment": "Paper height, accepts values labeled with units.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "height", - "required": false, - "spec": [ - { - "text": "Paper height, accepts values labeled with units.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "landscape", - "async": false, - "comment": "Paper orientation. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "landscape", - "required": false, - "spec": [ - { - "text": "Paper orientation. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "margin", - "async": false, - "comment": "Paper margins, defaults to none.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "margin", - "required": false, - "spec": [ - { - "text": "Paper margins, defaults to none.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "top", - "async": false, - "comment": "Top margin, accepts values labeled with units. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "top", - "required": false, - "spec": [ - { - "text": "Top margin, accepts values labeled with units. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[float]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - } - ] - } - }, - { - "alias": "right", - "async": false, - "comment": "Right margin, accepts values labeled with units. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "right", - "required": false, - "spec": [ - { - "text": "Right margin, accepts values labeled with units. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[float]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - } - ] - } - }, - { - "alias": "bottom", - "async": false, - "comment": "Bottom margin, accepts values labeled with units. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bottom", - "required": false, - "spec": [ - { - "text": "Bottom margin, accepts values labeled with units. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[float]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - } - ] - } - }, - { - "alias": "left", - "async": false, - "comment": "Left margin, accepts values labeled with units. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "left", - "required": false, - "spec": [ - { - "text": "Left margin, accepts values labeled with units. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[float]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - } - ] - } - } - ] - } - }, - { - "alias": "margin", - "async": false, - "comment": "Paper margins, defaults to none.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "margin", - "required": false, - "spec": [ - { - "text": "Paper margins, defaults to none.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "top", - "async": false, - "comment": "Top margin, accepts values labeled with units. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "top", - "required": false, - "spec": [ - { - "text": "Top margin, accepts values labeled with units. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "right", - "async": false, - "comment": "Right margin, accepts values labeled with units. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "right", - "required": false, - "spec": [ - { - "text": "Right margin, accepts values labeled with units. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "bottom", - "async": false, - "comment": "Bottom margin, accepts values labeled with units. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "bottom", - "required": false, - "spec": [ - { - "text": "Bottom margin, accepts values labeled with units. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "left", - "async": false, - "comment": "Left margin, accepts values labeled with units. Defaults to `0`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "left", - "required": false, - "spec": [ - { - "text": "Left margin, accepts values labeled with units. Defaults to `0`.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - }, - { - "alias": "pageRanges", - "async": false, - "comment": "Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "pageRanges", - "required": false, - "spec": [ - { - "text": "Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "path", - "async": false, - "comment": "The file path to save the PDF to. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. If no path is provided, the PDF won't be saved to the disk.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "The file path to save the PDF to. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the PDF won't be saved to the disk.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "preferCSSPageSize", - "async": false, - "comment": "Give any CSS `@page` size declared in the page priority over what is declared in `width` and `height` or `format`\noptions. Defaults to `false`, which will scale the content to fit the paper size.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "preferCSSPageSize", - "required": false, - "spec": [ - { - "text": "Give any CSS `@page` size declared in the page priority over what is declared in `width` and `height` or `format` options. Defaults to `false`, which will scale the content to fit the paper size.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "printBackground", - "async": false, - "comment": "Print background graphics. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "printBackground", - "required": false, - "spec": [ - { - "text": "Print background graphics. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "scale", - "async": false, - "comment": "Scale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "scale", - "required": false, - "spec": [ - { - "text": "Scale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "width", - "async": false, - "comment": "Paper width, accepts values labeled with units.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "width", - "required": false, - "spec": [ - { - "text": "Paper width, accepts values labeled with units.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[float]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "float" - } - ] - } - }, - { - "alias": "width", - "async": false, - "comment": "Paper width, accepts values labeled with units.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "width", - "required": false, - "spec": [ - { - "text": "Paper width, accepts values labeled with units.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "delay", - "async": false, - "comment": "Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[ElementHandle]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Array]<[ElementHandle]>", - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[null]|[Response]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Response" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "args": [ - { - "name": "Route" - }, - { - "name": "Request" - } - ], - "expression": "[function]([Route], [Request])", - "name": "function", - "returnType": null - }, - { - "args": [ - { - "name": "Route" - } - ], - "expression": "[function]([Route])", - "name": "function", - "returnType": null - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "name": "Object", - "properties": [ - { - "alias": "clip", - "async": false, - "comment": "An object which specifies clipping of the resulting image. Should have the following fields:", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "clip", - "required": false, - "spec": [ - { - "text": "An object which specifies clipping of the resulting image. Should have the following fields:", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "x-coordinate of top-left corner of clip area", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "x-coordinate of top-left corner of clip area", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "y-coordinate of top-left corner of clip area", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "y-coordinate of top-left corner of clip area", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "width", - "async": false, - "comment": "width of clipping area", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "width of clipping area", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "height", - "async": false, - "comment": "height of clipping area", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "height of clipping area", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "fullPage", - "async": false, - "comment": "When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to\n`false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "fullPage", - "required": false, - "spec": [ - { - "text": "When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "omitBackground", - "async": false, - "comment": "Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "omitBackground", - "required": false, - "spec": [ - { - "text": "Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "path", - "async": false, - "comment": "The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative\npath, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to\nthe disk.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "quality", - "async": false, - "comment": "The quality of the image, between 0-100. Not applicable to `png` images.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "quality", - "required": false, - "spec": [ - { - "text": "The quality of the image, between 0-100. Not applicable to `png` images.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "type", - "async": false, - "comment": "Specify screenshot type, defaults to `png`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "type", - "required": false, - "spec": [ - { - "text": "Specify screenshot type, defaults to `png`.", - "type": "text" - } - ], - "type": { - "expression": "[ScreenshotType]<\"png\"|\"jpeg\">", - "name": "ScreenshotType", - "union": [ - { - "name": "\"png\"" - }, - { - "name": "\"jpeg\"" - } - ] - } - } - ] - }, - { - "expression": "[Array]<[string]>", - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - }, - { - "name": "ElementHandle" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Array]<[Object]>", - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "value", - "async": false, - "comment": "Matches by `option.value`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "value", - "required": false, - "spec": [ - { - "text": "Matches by `option.value`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "label", - "async": false, - "comment": "Matches by `option.label`. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "label", - "required": false, - "spec": [ - { - "text": "Matches by `option.label`. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "index", - "async": false, - "comment": "Matches by the index. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "index", - "required": false, - "spec": [ - { - "text": "Matches by the index. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - }, - { - "expression": "[ElementHandle]|[Array]<[ElementHandle]>", - "name": "", - "union": [ - { - "name": "ElementHandle" - }, - { - "name": "Array", - "templates": [ - { - "name": "ElementHandle" - } - ] - } - ] - }, - { - "expression": "[int]|[Array]<[int]>", - "name": "", - "union": [ - { - "name": "int" - }, - { - "name": "Array", - "templates": [ - { - "name": "int" - } - ] - } - ] - }, - { - "expression": "[string]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - }, - { - "expression": "[string]|[Array]<[string]>", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Array", - "templates": [ - { - "name": "string" - } - ] - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "void" - }, - { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[path]|[Array]<[path]>|[Object]|[Array]<[Object]>", - "name": "", - "union": [ - { - "name": "path" - }, - { - "name": "Array", - "templates": [ - { - "name": "path" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "File name", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "File name", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "mimeType", - "async": false, - "comment": "File type", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mimeType", - "required": true, - "spec": [ - { - "text": "File type", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "buffer", - "async": false, - "comment": "File content", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "buffer", - "required": true, - "spec": [ - { - "text": "File content", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - } - ] - }, - { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "alias": "name", - "async": false, - "comment": "File name", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "name", - "required": true, - "spec": [ - { - "text": "File name", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "mimeType", - "async": false, - "comment": "File type", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "mimeType", - "required": true, - "spec": [ - { - "text": "File type", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "buffer", - "async": false, - "comment": "File content", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "buffer", - "required": true, - "spec": [ - { - "text": "File content", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - } - ] - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "expression": "[int]", - "name": "int" - }, - { - "expression": "[int]", - "name": "int" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "modifiers", - "async": false, - "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current\nmodifiers back. If not specified, currently pressed modifiers are used.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "modifiers", - "required": false, - "spec": [ - { - "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used.", - "type": "text" - } - ], - "type": { - "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>", - "name": "Array", - "templates": [ - { - "name": "KeyboardModifier", - "union": [ - { - "name": "\"Alt\"" - }, - { - "name": "\"Control\"" - }, - { - "name": "\"Meta\"" - }, - { - "name": "\"Shift\"" - } - ] - } - ] - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "position", - "async": false, - "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the\nelement.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "position", - "required": false, - "spec": [ - { - "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.", - "type": "text" - } - ], - "type": { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "x", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "x", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "y", - "async": false, - "comment": "", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "y", - "required": true, - "spec": [ - { - "text": "", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Touchscreen]", - "name": "Touchscreen" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "delay", - "async": false, - "comment": "Time to wait between key presses in milliseconds. Defaults to 0.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "delay", - "required": false, - "spec": [ - { - "text": "Time to wait between key presses in milliseconds. Defaults to 0.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "force", - "async": false, - "comment": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "force", - "required": false, - "spec": [ - { - "text": "Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "noWaitAfter", - "async": false, - "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can\nopt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to\ninaccessible pages. Defaults to `false`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "noWaitAfter", - "required": false, - "spec": [ - { - "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "args": [ - { - "name": "Route" - }, - { - "name": "Request" - } - ], - "expression": "[function]([Route], [Request])", - "name": "function", - "returnType": null - }, - { - "args": [ - { - "name": "Route" - } - ], - "expression": "[function]([Route])", - "name": "function", - "returnType": null - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[null]|[Video]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Video" - } - ] - }, - { - "expression": "[null]|[Object]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "alias": "width", - "async": false, - "comment": "page width in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "width", - "required": true, - "spec": [ - { - "text": "page width in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - }, - { - "alias": "height", - "async": false, - "comment": "page height in pixels.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "height", - "required": true, - "spec": [ - { - "text": "page height in pixels.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - } - ] - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[ConsoleMessage]", - "name": "ConsoleMessage" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `ConsoleMessage` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `ConsoleMessage` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "ConsoleMessage" - } - ], - "expression": "[function]([ConsoleMessage]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[Download]", - "name": "Download" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `Download` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `Download` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "Download" - } - ], - "expression": "[function]([Download]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[any]", - "name": "any" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]|[Object]", - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": true, - "spec": [ - { - "text": "receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[FileChooser]", - "name": "FileChooser" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `FileChooser` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `FileChooser` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "FileChooser" - } - ], - "expression": "[function]([FileChooser]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[JSHandle]", - "name": "JSHandle" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "name": "Object", - "properties": [ - { - "alias": "polling", - "async": false, - "comment": "If `polling` is `'raf'`, then `expression` is constantly executed in `requestAnimationFrame` callback. If `polling` is a\nnumber, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to `raf`.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "polling", - "required": false, - "spec": [ - { - "text": "If `polling` is `'raf'`, then `expression` is constantly executed in `requestAnimationFrame` callback. If `polling` is a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to `raf`.", - "type": "text" - } - ], - "type": { - "expression": "[float]|\"raf\"", - "name": "", - "union": [ - { - "name": "float" - }, - { - "name": "\"raf\"" - } - ] - } - }, - { - "alias": "pollingInterval", - "async": false, - "comment": "If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if\nthe option is not specified `expression` is executed in `requestAnimationFrame` callback.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "pollingInterval", - "required": false, - "spec": [ - { - "text": "If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if the option is not specified `expression` is executed in `requestAnimationFrame` callback.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[LoadState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "LoadState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[Response]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Response" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "url", - "async": false, - "comment": "A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[Page]", - "name": "Page" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `Page` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `Page` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "Page" - } - ], - "expression": "[function]([Page]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[Request]", - "name": "Request" - }, - { - "expression": "[string]|[RegExp]|[function]([Request]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "Request" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be\nchanged by using the [`method: Page.setDefaultTimeout`] method.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be changed by using the [`method: Page.setDefaultTimeout`] method.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[Response]", - "name": "Response" - }, - { - "expression": "[string]|[RegExp]|[function]([Response]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "Response" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[null]|[ElementHandle]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "ElementHandle" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "state", - "async": false, - "comment": "Defaults to `'visible'`. Can be either:\n- `'attached'` - wait for element to be present in DOM.\n- `'detached'` - wait for element to not be present in DOM.\n- `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without\n any content or with `display:none` has an empty bounding box and is not considered visible.\n- `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.\n This is opposite to the `'visible'` option.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "state", - "required": false, - "spec": [ - { - "text": "Defaults to `'visible'`. Can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'attached'` - wait for element to be present in DOM.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'detached'` - wait for element to not be present in DOM.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without any content or with `display:none` has an empty bounding box and is not considered visible.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`. This is opposite to the `'visible'` option.", - "type": "li" - } - ], - "type": { - "expression": "[WaitForSelectorState]<\"attached\"|\"detached\"|\"visible\"|\"hidden\">", - "name": "WaitForSelectorState", - "union": [ - { - "name": "\"attached\"" - }, - { - "name": "\"detached\"" - }, - { - "name": "\"visible\"" - }, - { - "name": "\"hidden\"" - } - ] - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "name": "void" - }, - { - "expression": "[string]|[RegExp]|[function]([URL]):[boolean]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "RegExp" - }, - { - "args": [ - { - "name": "URL" - } - ], - "name": "function", - "returnType": { - "name": "boolean" - } - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be\nchanged by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`], [`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or [`method: Page.setDefaultTimeout`] methods.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "waitUntil", - "async": false, - "comment": "When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "waitUntil", - "required": false, - "spec": [ - { - "text": "When to consider operation succeeded, defaults to `load`. Events can be either:", - "type": "text" - }, - { - "liType": "bullet", - "text": "`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'load'` - consider operation to be finished when the `load` event is fired.", - "type": "li" - }, - { - "liType": "bullet", - "text": "`'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.", - "type": "li" - } - ], - "type": { - "expression": "[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\">", - "name": "WaitUntilState", - "union": [ - { - "name": "\"load\"" - }, - { - "name": "\"domcontentloaded\"" - }, - { - "name": "\"networkidle\"" - } - ] - } - } - ] - }, - { - "expression": "[WebSocket]", - "name": "WebSocket" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `WebSocket` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `WebSocket` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "WebSocket" - } - ], - "expression": "[function]([WebSocket]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[Worker]", - "name": "Worker" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `Worker` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `Worker` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "Worker" - } - ], - "expression": "[function]([Worker]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[Array]<[Worker]>", - "name": "Array", - "templates": [ - { - "name": "Worker" - } - ] - }, - { - "name": "void" - }, - { - "args": [ - { - "name": "Dialog" - } - ], - "expression": "[function]([Dialog])", - "name": "function", - "returnType": null - }, - { - "expression": "[Any]", - "name": "Any" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[BrowserType]", - "name": "BrowserType" - }, - { - "expression": "[Object]", - "name": "Object" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "TimeoutError", - "async": false, - "comment": "A class of `TimeoutError`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "TimeoutError", - "required": true, - "spec": [ - { - "text": "A class of `TimeoutError`.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - } - ] - }, - { - "expression": "[BrowserType]", - "name": "BrowserType" - }, - { - "expression": "[Selectors]", - "name": "Selectors" - }, - { - "expression": "[BrowserType]", - "name": "BrowserType" - }, - { - "name": "void" - }, - { - "expression": "[Playwright]", - "name": "Playwright" - }, - { - "name": "void" - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[Frame]", - "name": "Frame" - }, - { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[null]|[Buffer]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Buffer" - } - ] - }, - { - "expression": "[null]|[any]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "any" - } - ] - }, - { - "expression": "[null]|[Request]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Request" - } - ] - }, - { - "expression": "[null]|[Request]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Request" - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[null]|[Response]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Response" - } - ] - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "startTime", - "async": false, - "comment": "Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "startTime", - "required": true, - "spec": [ - { - "text": "Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "domainLookupStart", - "async": false, - "comment": "Time immediately before the browser starts the domain name lookup for the resource. The value is given in milliseconds\nrelative to `startTime`, -1 if not available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "domainLookupStart", - "required": true, - "spec": [ - { - "text": "Time immediately before the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "domainLookupEnd", - "async": false, - "comment": "Time immediately after the browser starts the domain name lookup for the resource. The value is given in milliseconds\nrelative to `startTime`, -1 if not available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "domainLookupEnd", - "required": true, - "spec": [ - { - "text": "Time immediately after the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "connectStart", - "async": false, - "comment": "Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The\nvalue is given in milliseconds relative to `startTime`, -1 if not available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "connectStart", - "required": true, - "spec": [ - { - "text": "Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "secureConnectionStart", - "async": false, - "comment": "Time immediately before the browser starts the handshake process to secure the current connection. The value is given in\nmilliseconds relative to `startTime`, -1 if not available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "secureConnectionStart", - "required": true, - "spec": [ - { - "text": "Time immediately before the browser starts the handshake process to secure the current connection. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "connectEnd", - "async": false, - "comment": "Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The\nvalue is given in milliseconds relative to `startTime`, -1 if not available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "connectEnd", - "required": true, - "spec": [ - { - "text": "Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "requestStart", - "async": false, - "comment": "Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The value\nis given in milliseconds relative to `startTime`, -1 if not available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "requestStart", - "required": true, - "spec": [ - { - "text": "Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "responseStart", - "async": false, - "comment": "Time immediately after the browser starts requesting the resource from the server, cache, or local resource. The value\nis given in milliseconds relative to `startTime`, -1 if not available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "responseStart", - "required": true, - "spec": [ - { - "text": "Time immediately after the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - }, - { - "alias": "responseEnd", - "async": false, - "comment": "Time immediately after the browser receives the last byte of the resource or immediately before the transport connection\nis closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "responseEnd", - "required": true, - "spec": [ - { - "text": "Time immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not available.", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[JsonDocument]", - "name": "JsonDocument" - }, - { - "name": "Object", - "properties": [ - { - "alias": "documentOptions", - "async": false, - "comment": "The options that control custom behaviour when parsing the JSON.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "documentOptions", - "required": false, - "spec": [ - { - "text": "The options that control custom behaviour when parsing the JSON.", - "type": "text" - } - ], - "type": { - "expression": "[null]|[JsonDocumentOptions]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "JsonDocumentOptions" - } - ] - } - } - ] - }, - { - "expression": "[Buffer]", - "name": "Buffer" - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[Frame]", - "name": "Frame" - }, - { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[Request]", - "name": "Request" - }, - { - "expression": "[int]", - "name": "int" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[System.Net.HttpStatusCode]", - "name": "System.Net.HttpStatusCode" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "headers", - "async": false, - "comment": "If set changes the request HTTP headers. Header values will be converted to a string.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "headers", - "required": false, - "spec": [ - { - "text": "If set changes the request HTTP headers. Header values will be converted to a string.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "method", - "async": false, - "comment": "If set changes the request method (e.g. GET or POST)", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "method", - "required": false, - "spec": [ - { - "text": "If set changes the request method (e.g. GET or POST)", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "postData", - "async": false, - "comment": "If set changes the post data of request", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "postData", - "required": false, - "spec": [ - { - "text": "If set changes the post data of request", - "type": "text" - } - ], - "type": { - "expression": "[string]|[Buffer]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Buffer" - } - ] - } - }, - { - "alias": "url", - "async": false, - "comment": "If set changes the request URL. New URL must have same protocol as original one.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "url", - "required": false, - "spec": [ - { - "text": "If set changes the request URL. New URL must have same protocol as original one.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "name": "void" - }, - { - "name": "Object", - "properties": [ - { - "alias": "body", - "async": false, - "comment": "Response body.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "js", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "body", - "required": false, - "spec": [ - { - "text": "Response body.", - "type": "text" - } - ], - "type": { - "expression": "[string]|[Buffer]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Buffer" - } - ] - } - }, - { - "alias": "body", - "async": false, - "comment": "Optional response body as text.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "body", - "required": false, - "spec": [ - { - "text": "Optional response body as text.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "bodyBytes", - "async": false, - "comment": "Optional response body as raw bytes.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java" - ], - "overrides": {}, - "types": {} - }, - "name": "bodyBytes", - "required": false, - "spec": [ - { - "text": "Optional response body as raw bytes.", - "type": "text" - } - ], - "type": { - "expression": "[Buffer]", - "name": "Buffer" - } - }, - { - "alias": "contentType", - "async": false, - "comment": "If set, equals to setting `Content-Type` response header.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "contentType", - "required": false, - "spec": [ - { - "text": "If set, equals to setting `Content-Type` response header.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - }, - { - "alias": "headers", - "async": false, - "comment": "Response headers. Header values will be converted to a string.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "headers", - "required": false, - "spec": [ - { - "text": "Response headers. Header values will be converted to a string.", - "type": "text" - } - ], - "type": { - "expression": "[Object]<[string], [string]>", - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ] - } - }, - { - "alias": "path", - "async": false, - "comment": "File path to respond with. The content type will be inferred from file extension. If `path` is a relative path, then it\nis resolved relative to the current working directory.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "File path to respond with. The content type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "status", - "async": false, - "comment": "Response status code, defaults to `200`.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "status", - "required": false, - "spec": [ - { - "text": "Response status code, defaults to `200`.", - "type": "text" - } - ], - "type": { - "expression": "[int]", - "name": "int" - } - } - ] - }, - { - "expression": "[Request]", - "name": "Request" - }, - { - "name": "void" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]|[string]|[Object]", - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "path", - "async": false, - "comment": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "path", - "required": false, - "spec": [ - { - "text": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "content", - "async": false, - "comment": "Raw script content. Optional.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "content", - "required": false, - "spec": [ - { - "text": "Raw script content. Optional.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - } - ] - }, - { - "expression": "[string]|[path]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "path" - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "contentScript", - "async": false, - "comment": "Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same DOM, but\nnot any JavaScript objects from the frame's scripts. Defaults to `false`. Note that running as a content script is not\nguaranteed when this engine is used together with other registered engines.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "contentScript", - "required": false, - "spec": [ - { - "text": "Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same DOM, but not any JavaScript objects from the frame's scripts. Defaults to `false`. Note that running as a content script is not guaranteed when this engine is used together with other registered engines.", - "type": "text" - } - ], - "type": { - "expression": "[boolean]", - "name": "boolean" - } - }, - { - "alias": "path", - "async": false, - "comment": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "path", - "required": false, - "spec": [ - { - "text": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory.", - "type": "text" - } - ], - "type": { - "expression": "[path]", - "name": "path" - } - }, - { - "alias": "script", - "async": false, - "comment": "Raw script content.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "script", - "required": false, - "spec": [ - { - "text": "Raw script content.", - "type": "text" - } - ], - "type": { - "expression": "[string]", - "name": "string" - } - } - ] - }, - { - "name": "void" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "expression": "[float]", - "name": "float" - }, - { - "expression": "[path]", - "name": "path" - }, - { - "expression": "[WebSocket]", - "name": "WebSocket" - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "payload", - "async": false, - "comment": "frame payload", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "payload", - "required": true, - "spec": [ - { - "text": "frame payload", - "type": "text" - } - ], - "type": { - "expression": "[string]|[Buffer]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Buffer" - } - ] - } - } - ] - }, - { - "expression": "[Object]", - "name": "Object", - "properties": [ - { - "alias": "payload", - "async": false, - "comment": "frame payload", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "payload", - "required": true, - "spec": [ - { - "text": "frame payload", - "type": "text" - } - ], - "type": { - "expression": "[string]|[Buffer]", - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Buffer" - } - ] - } - } - ] - }, - { - "expression": "[String]", - "name": "String" - }, - { - "expression": "[boolean]", - "name": "boolean" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[any]", - "name": "any" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[function]|[Object]", - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": true, - "spec": [ - { - "text": "receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - } - ] - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[WebSocketFrame]", - "name": "WebSocketFrame" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `WebSocketFrame` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `WebSocketFrame` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "WebSocketFrame" - } - ], - "expression": "[function]([WebSocketFrame]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[WebSocketFrame]", - "name": "WebSocketFrame" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the `WebSocketFrame` object and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": {}, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the `WebSocketFrame` object and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "args": [ - { - "name": "WebSocketFrame" - } - ], - "expression": "[function]([WebSocketFrame]):[boolean]", - "name": "function", - "returnType": { - "name": "boolean" - } - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - }, - { - "expression": "[Any]", - "name": "Any" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "name": "Object", - "properties": [ - { - "alias": "predicate", - "async": false, - "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "predicate", - "required": false, - "spec": [ - { - "text": "Receives the event data and resolves to truthy value when the waiting should resolve.", - "type": "text" - } - ], - "type": { - "expression": "[function]", - "name": "function" - } - }, - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[null]|[Buffer]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Buffer" - } - ] - }, - { - "expression": "[null]|[string]", - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "string" - } - ] - }, - { - "expression": "[Worker]", - "name": "Worker" - }, - { - "expression": "[Serializable]", - "name": "Serializable" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[JSHandle]", - "name": "JSHandle" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[EvaluationArgument]", - "name": "EvaluationArgument" - }, - { - "expression": "[string]", - "name": "string" - }, - { - "expression": "[Worker]", - "name": "Worker" - }, - { - "name": "Object", - "properties": [ - { - "alias": "timeout", - "async": false, - "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "deprecated": false, - "kind": "property", - "langs": { - "aliases": {}, - "only": [ - "csharp", - "java", - "python" - ], - "overrides": {}, - "types": {} - }, - "name": "timeout", - "required": false, - "spec": [ - { - "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", - "type": "text" - } - ], - "type": { - "expression": "[float]", - "name": "float" - } - } - ] - }, - { - "expression": "[Runnable]", - "name": "Runnable" - } -] diff --git a/src/api/api.json b/src/api/api.json index a3b2aca..94319ce 100644 --- a/src/api/api.json +++ b/src/api/api.json @@ -4,19 +4,19 @@ "spec": [ { "type": "text", - "text": "The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access)." + "text": "The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by↵assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or↵[switches](https://en.wikipedia.org/wiki/Switch_access)." }, { "type": "text", - "text": "Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output." + "text": "Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might↵have wildly different output." }, { "type": "text", - "text": "Rendering engines of Chromium, Firefox and WebKit have a concept of \"accessibility tree\", which is then translated into different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree." + "text": "Rendering engines of Chromium, Firefox and WebKit have a concept of \"accessibility tree\", which is then translated into different↵platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree." }, { "type": "text", - "text": "Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the \"interesting\" nodes of the tree." + "text": "Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific AX-Tree or by↵assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the↵\"interesting\" nodes of the tree." } ], "langs": { @@ -29,7 +29,8 @@ "types": {}, "overrides": {} }, - "comment": "The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by\nassistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or\n[switches](https://en.wikipedia.org/wiki/Switch_access).\n\nAccessibility is a very platform-specific thing. On different platforms, there are different screen readers that might\nhave wildly different output.\n\nRendering engines of Chromium, Firefox and WebKit have a concept of \"accessibility tree\", which is then translated into\ndifferent platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.\n\nMost of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific\nAX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing\nonly the \"interesting\" nodes of the tree.", + "comment": "The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is\nused by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or\n[switches](https://en.wikipedia.org/wiki/Switch_access).\n\nAccessibility is a very platform-specific thing. On different platforms, there are different screen readers that\nmight have wildly different output.\n\nRendering engines of Chromium, Firefox and WebKit have a concept of \"accessibility tree\", which is then translated\ninto different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.\n\nMost of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific\nAX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering,\nexposing only the \"interesting\" nodes of the tree.", + "since": "v1.8", "members": [ { "kind": "method", @@ -46,9 +47,24 @@ } ], "expression": "[null]|[string]" + }, + "csharp": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "JsonElement" + } + ], + "expression": "[null]|[JsonElement]" } } }, + "experimental": false, + "since": "v1.8", + "deprecated": "This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.", "name": "snapshot", "type": { "name": "", @@ -62,6 +78,8 @@ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "role", "type": { "name": "string", @@ -75,13 +93,16 @@ ], "required": true, "comment": "The [role](https://www.w3.org/TR/wai-aria/#usage_intro).", - "deprecated": false, "async": false, - "alias": "role" + "alias": "role", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "name", "type": { "name": "string", @@ -95,13 +116,16 @@ ], "required": true, "comment": "A human readable name for the node.", - "deprecated": false, "async": false, - "alias": "name" + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "value", "type": { "name": "", @@ -121,15 +145,18 @@ "text": "The current value of the node, if applicable." } ], - "required": false, + "required": true, "comment": "The current value of the node, if applicable.", - "deprecated": false, "async": false, - "alias": "value" + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "description", "type": { "name": "string", @@ -141,15 +168,18 @@ "text": "An additional human readable description of the node, if applicable." } ], - "required": false, + "required": true, "comment": "An additional human readable description of the node, if applicable.", - "deprecated": false, "async": false, - "alias": "description" + "alias": "description", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "keyshortcuts", "type": { "name": "string", @@ -161,15 +191,18 @@ "text": "Keyboard shortcuts associated with this node, if applicable." } ], - "required": false, + "required": true, "comment": "Keyboard shortcuts associated with this node, if applicable.", - "deprecated": false, "async": false, - "alias": "keyshortcuts" + "alias": "keyshortcuts", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "roledescription", "type": { "name": "string", @@ -181,15 +214,18 @@ "text": "A human readable alternative to the role, if applicable." } ], - "required": false, + "required": true, "comment": "A human readable alternative to the role, if applicable.", - "deprecated": false, "async": false, - "alias": "roledescription" + "alias": "roledescription", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "valuetext", "type": { "name": "string", @@ -201,15 +237,18 @@ "text": "A description of the current value, if applicable." } ], - "required": false, + "required": true, "comment": "A description of the current value, if applicable.", - "deprecated": false, "async": false, - "alias": "valuetext" + "alias": "valuetext", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "disabled", "type": { "name": "boolean", @@ -221,15 +260,18 @@ "text": "Whether the node is disabled, if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node is disabled, if applicable.", - "deprecated": false, "async": false, - "alias": "disabled" + "alias": "disabled", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "expanded", "type": { "name": "boolean", @@ -241,15 +283,18 @@ "text": "Whether the node is expanded or collapsed, if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node is expanded or collapsed, if applicable.", - "deprecated": false, "async": false, - "alias": "expanded" + "alias": "expanded", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "focused", "type": { "name": "boolean", @@ -261,15 +306,18 @@ "text": "Whether the node is focused, if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node is focused, if applicable.", - "deprecated": false, "async": false, - "alias": "focused" + "alias": "focused", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "modal", "type": { "name": "boolean", @@ -281,15 +329,18 @@ "text": "Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable.", - "deprecated": false, "async": false, - "alias": "modal" + "alias": "modal", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "multiline", "type": { "name": "boolean", @@ -301,15 +352,18 @@ "text": "Whether the node text input supports multiline, if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node text input supports multiline, if applicable.", - "deprecated": false, "async": false, - "alias": "multiline" + "alias": "multiline", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "multiselectable", "type": { "name": "boolean", @@ -321,15 +375,18 @@ "text": "Whether more than one child can be selected, if applicable." } ], - "required": false, + "required": true, "comment": "Whether more than one child can be selected, if applicable.", - "deprecated": false, "async": false, - "alias": "multiselectable" + "alias": "multiselectable", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "readonly", "type": { "name": "boolean", @@ -341,15 +398,18 @@ "text": "Whether the node is read only, if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node is read only, if applicable.", - "deprecated": false, "async": false, - "alias": "readonly" + "alias": "readonly", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "required", "type": { "name": "boolean", @@ -361,15 +421,18 @@ "text": "Whether the node is required, if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node is required, if applicable.", - "deprecated": false, "async": false, - "alias": "required" + "alias": "required", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "selected", "type": { "name": "boolean", @@ -381,15 +444,18 @@ "text": "Whether the node is selected in its parent node, if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node is selected in its parent node, if applicable.", - "deprecated": false, "async": false, - "alias": "selected" + "alias": "selected", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "checked", "type": { "name": "", @@ -409,15 +475,18 @@ "text": "Whether the checkbox is checked, or \"mixed\", if applicable." } ], - "required": false, + "required": true, "comment": "Whether the checkbox is checked, or \"mixed\", if applicable.", - "deprecated": false, "async": false, - "alias": "checked" + "alias": "checked", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "pressed", "type": { "name": "", @@ -437,15 +506,18 @@ "text": "Whether the toggle button is checked, or \"mixed\", if applicable." } ], - "required": false, + "required": true, "comment": "Whether the toggle button is checked, or \"mixed\", if applicable.", - "deprecated": false, "async": false, - "alias": "pressed" + "alias": "pressed", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "level", "type": { "name": "int", @@ -457,15 +529,18 @@ "text": "The level of a heading, if applicable." } ], - "required": false, + "required": true, "comment": "The level of a heading, if applicable.", - "deprecated": false, "async": false, - "alias": "level" + "alias": "level", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "valuemin", "type": { "name": "float", @@ -477,15 +552,18 @@ "text": "The minimum value in a node, if applicable." } ], - "required": false, + "required": true, "comment": "The minimum value in a node, if applicable.", - "deprecated": false, "async": false, - "alias": "valuemin" + "alias": "valuemin", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "valuemax", "type": { "name": "float", @@ -497,15 +575,18 @@ "text": "The maximum value in a node, if applicable." } ], - "required": false, + "required": true, "comment": "The maximum value in a node, if applicable.", - "deprecated": false, "async": false, - "alias": "valuemax" + "alias": "valuemax", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "autocomplete", "type": { "name": "string", @@ -517,15 +598,18 @@ "text": "What kind of autocomplete is supported by a control, if applicable." } ], - "required": false, + "required": true, "comment": "What kind of autocomplete is supported by a control, if applicable.", - "deprecated": false, "async": false, - "alias": "autocomplete" + "alias": "autocomplete", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "haspopup", "type": { "name": "string", @@ -537,15 +621,18 @@ "text": "What kind of popup is currently being shown for a node, if applicable." } ], - "required": false, + "required": true, "comment": "What kind of popup is currently being shown for a node, if applicable.", - "deprecated": false, "async": false, - "alias": "haspopup" + "alias": "haspopup", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "invalid", "type": { "name": "string", @@ -557,15 +644,18 @@ "text": "Whether and in what way this node's value is invalid, if applicable." } ], - "required": false, + "required": true, "comment": "Whether and in what way this node's value is invalid, if applicable.", - "deprecated": false, "async": false, - "alias": "invalid" + "alias": "invalid", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "orientation", "type": { "name": "string", @@ -577,15 +667,18 @@ "text": "Whether the node is oriented horizontally or vertically, if applicable." } ], - "required": false, + "required": true, "comment": "Whether the node is oriented horizontally or vertically, if applicable.", - "deprecated": false, "async": false, - "alias": "orientation" + "alias": "orientation", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "children", "type": { "name": "Array", @@ -602,11 +695,12 @@ "text": "Child nodes, if any, if applicable." } ], - "required": false, + "required": true, "comment": "Child nodes, if any, if applicable.", - "deprecated": false, "async": false, - "alias": "children" + "alias": "children", + "overloadIndex": 0, + "paramOrOption": null } ] } @@ -616,12 +710,16 @@ "spec": [ { "type": "text", - "text": "Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page." + "text": "Captures the current state of the accessibility tree. The returned object represents the root accessible node of the↵page." }, { "type": "note", "noteType": "note", - "text": "The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`." + "text": "The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright↵will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`." + }, + { + "type": "text", + "text": "**Usage**" }, { "type": "text", @@ -662,8 +760,8 @@ { "type": "code", "lines": [ - "var accessibilitySnapshot = await Page.Accessibility.SnapshotAsync();", - "Console.WriteLine(accessibilitySnapshot);" + "var accessibilitySnapshot = await page.Accessibility.SnapshotAsync();", + "Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));" ], "codeLang": "csharp" }, @@ -683,7 +781,8 @@ " return node;", " for (const child of node.children || []) {", " const foundNode = findFocusedNode(child);", - " return foundNode;", + " if (foundNode)", + " return foundNode;", " }", " return null;", "}" @@ -693,26 +792,8 @@ { "type": "code", "lines": [ - "Func findFocusedNode = root =>", - "{", - " var nodes = new Stack(new[] { root });", - " while (nodes.Count > 0)", - " {", - " var node = nodes.Pop();", - " if (node.Focused) return node;", - " foreach (var innerNode in node.Children)", - " {", - " nodes.Push(innerNode);", - " }", - " }", - "", - " return null;", - "};", - "", - "var accessibilitySnapshot = await Page.Accessibility.SnapshotAsync();", - "var focusedNode = findFocusedNode(accessibilitySnapshot);", - "if(focusedNode != null)", - " Console.WriteLine(focusedNode.Name);" + "var accessibilitySnapshot = await page.Accessibility.SnapshotAsync();", + "Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));" ], "codeLang": "csharp" }, @@ -728,11 +809,12 @@ "type": "code", "lines": [ "def find_focused_node(node):", - " if (node.get(\"focused\"))", + " if node.get(\"focused\"):", " return node", " for child in (node.get(\"children\") or []):", " found_node = find_focused_node(child)", - " return found_node", + " if found_node:", + " return found_node", " return None", "", "snapshot = await page.accessibility.snapshot()", @@ -746,11 +828,12 @@ "type": "code", "lines": [ "def find_focused_node(node):", - " if (node.get(\"focused\"))", + " if node.get(\"focused\"):", " return node", " for child in (node.get(\"children\") or []):", " found_node = find_focused_node(child)", - " return found_node", + " if found_node:", + " return found_node", " return None", "", "snapshot = page.accessibility.snapshot()", @@ -762,14 +845,17 @@ } ], "required": true, - "comment": "Captures the current state of the accessibility tree. The returned object represents the root accessible node of the\npage.\n\n> NOTE: The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers.\nPlaywright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.\n\nAn example of dumping the entire accessibility tree:\n\n```js\nconst snapshot = await page.accessibility.snapshot();\nconsole.log(snapshot);\n```\n\n```java\nString snapshot = page.accessibility().snapshot();\nSystem.out.println(snapshot);\n```\n\n```python async\nsnapshot = await page.accessibility.snapshot()\nprint(snapshot)\n```\n\n```python sync\nsnapshot = page.accessibility.snapshot()\nprint(snapshot)\n```\n\n```csharp\nvar accessibilitySnapshot = await Page.Accessibility.SnapshotAsync();\nConsole.WriteLine(accessibilitySnapshot);\n```\n\nAn example of logging the focused node's name:\n\n```js\nconst snapshot = await page.accessibility.snapshot();\nconst node = findFocusedNode(snapshot);\nconsole.log(node && node.name);\n\nfunction findFocusedNode(node) {\n if (node.focused)\n return node;\n for (const child of node.children || []) {\n const foundNode = findFocusedNode(child);\n return foundNode;\n }\n return null;\n}\n```\n\n```csharp\nFunc findFocusedNode = root =>\n{\n var nodes = new Stack(new[] { root });\n while (nodes.Count > 0)\n {\n var node = nodes.Pop();\n if (node.Focused) return node;\n foreach (var innerNode in node.Children)\n {\n nodes.Push(innerNode);\n }\n }\n\n return null;\n};\n\nvar accessibilitySnapshot = await Page.Accessibility.SnapshotAsync();\nvar focusedNode = findFocusedNode(accessibilitySnapshot);\nif(focusedNode != null)\n Console.WriteLine(focusedNode.Name);\n```\n\n```java\n// FIXME\nString snapshot = page.accessibility().snapshot();\n```\n\n```python async\ndef find_focused_node(node):\n if (node.get(\"focused\"))\n return node\n for child in (node.get(\"children\") or []):\n found_node = find_focused_node(child)\n return found_node\n return None\n\nsnapshot = await page.accessibility.snapshot()\nnode = find_focused_node(snapshot)\nif node:\n print(node[\"name\"])\n```\n\n```python sync\ndef find_focused_node(node):\n if (node.get(\"focused\"))\n return node\n for child in (node.get(\"children\") or []):\n found_node = find_focused_node(child)\n return found_node\n return None\n\nsnapshot = page.accessibility.snapshot()\nnode = find_focused_node(snapshot)\nif node:\n print(node[\"name\"])\n```\n", - "deprecated": false, + "comment": "Captures the current state of the accessibility tree. The returned object represents the root accessible node of\nthe page.\n\n**NOTE** The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen\nreaders. Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to\n`false`.\n\n**Usage**\n\nAn example of dumping the entire accessibility tree:\n\n```js\nconst snapshot = await page.accessibility.snapshot();\nconsole.log(snapshot);\n```\n\n```java\nString snapshot = page.accessibility().snapshot();\nSystem.out.println(snapshot);\n```\n\n```py\nsnapshot = await page.accessibility.snapshot()\nprint(snapshot)\n```\n\n```py\nsnapshot = page.accessibility.snapshot()\nprint(snapshot)\n```\n\n```csharp\nvar accessibilitySnapshot = await page.Accessibility.SnapshotAsync();\nConsole.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));\n```\n\nAn example of logging the focused node's name:\n\n```js\nconst snapshot = await page.accessibility.snapshot();\nconst node = findFocusedNode(snapshot);\nconsole.log(node && node.name);\n\nfunction findFocusedNode(node) {\n if (node.focused)\n return node;\n for (const child of node.children || []) {\n const foundNode = findFocusedNode(child);\n if (foundNode)\n return foundNode;\n }\n return null;\n}\n```\n\n```csharp\nvar accessibilitySnapshot = await page.Accessibility.SnapshotAsync();\nConsole.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));\n```\n\n```java\n// FIXME\nString snapshot = page.accessibility().snapshot();\n```\n\n```py\ndef find_focused_node(node):\n if node.get(\"focused\"):\n return node\n for child in (node.get(\"children\") or []):\n found_node = find_focused_node(child)\n if found_node:\n return found_node\n return None\n\nsnapshot = await page.accessibility.snapshot()\nnode = find_focused_node(snapshot)\nif node:\n print(node[\"name\"])\n```\n\n```py\ndef find_focused_node(node):\n if node.get(\"focused\"):\n return node\n for child in (node.get(\"children\") or []):\n found_node = find_focused_node(child)\n if found_node:\n return found_node\n return None\n\nsnapshot = page.accessibility.snapshot()\nnode = find_focused_node(snapshot)\nif node:\n print(node[\"name\"])\n```\n", "async": true, "alias": "snapshot", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "options", "type": { "name": "Object", @@ -777,6 +863,8 @@ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.8", "name": "interestingOnly", "type": { "name": "boolean", @@ -790,13 +878,16 @@ ], "required": false, "comment": "Prune uninteresting nodes from the tree. Defaults to `true`.", - "deprecated": false, "async": false, - "alias": "interestingOnly" + "alias": "interestingOnly", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.8", "name": "root", "type": { "name": "ElementHandle", @@ -810,17 +901,19 @@ ], "required": false, "comment": "The root DOM element for the snapshot. Defaults to the whole page.", - "deprecated": false, "async": false, - "alias": "root" + "alias": "root", + "overloadIndex": 0, + "paramOrOption": null } ] }, "required": false, "comment": "", - "deprecated": false, "async": false, - "alias": "options" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] } @@ -831,14 +924,54 @@ "spec": [ { "type": "text", - "text": "Playwright has **experimental** support for Android automation. You can access android namespace via:" + "text": "Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView." }, { - "type": "code", - "lines": [ - "const { _android: android } = require('playwright');" - ], - "codeLang": "js" + "type": "text", + "text": "*Requirements*" + }, + { + "type": "li", + "text": "Android device or AVD Emulator.", + "liType": "bullet" + }, + { + "type": "li", + "text": "[ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device. Typically running `adb devices` is all you need to do.", + "liType": "bullet" + }, + { + "type": "li", + "text": "[`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device", + "liType": "bullet" + }, + { + "type": "li", + "text": "\"Enable command line on non-rooted devices\" enabled in `chrome://flags`.", + "liType": "bullet" + }, + { + "type": "text", + "text": "*Known limitations*" + }, + { + "type": "li", + "text": "Raw USB operation is not yet supported, so you need ADB.", + "liType": "bullet" + }, + { + "type": "li", + "text": "Device needs to be awake to produce screenshots. Enabling \"Stay awake\" developer mode will help.", + "liType": "bullet" + }, + { + "type": "li", + "text": "We didn't run all the tests against the device, so not everything works.", + "liType": "bullet" + }, + { + "type": "text", + "text": "*How to run*" }, { "type": "text", @@ -867,8 +1000,12 @@ " const webview = await device.webView({ pkg: 'org.chromium.webview_shell' });", "", " // Fill the input box.", - " await device.fill({ res: 'org.chromium.webview_shell:id/url_field' }, 'github.com/microsoft/playwright');", - " await device.press({ res: 'org.chromium.webview_shell:id/url_field' }, 'Enter');", + " await device.fill({", + " res: 'org.chromium.webview_shell:id/url_field',", + " }, 'github.com/microsoft/playwright');", + " await device.press({", + " res: 'org.chromium.webview_shell:id/url_field',", + " }, 'Enter');", "", " // Work with WebView's page as usual.", " const page = await webview.page();", @@ -905,96 +1042,9 @@ { "type": "code", "lines": [ - "$ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright" - ], - "codeLang": "sh js" - } - ], - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "comment": "Playwright has **experimental** support for Android automation. You can access android namespace via:\n\n```js\nconst { _android: android } = require('playwright');\n```\n\nAn example of the Android automation script would be:\n\n```js\nconst { _android: android } = require('playwright');\n\n(async () => {\n // Connect to the device.\n const [device] = await android.devices();\n console.log(`Model: ${device.model()}`);\n console.log(`Serial: ${device.serial()}`);\n // Take screenshot of the whole device.\n await device.screenshot({ path: 'device.png' });\n\n {\n // --------------------- WebView -----------------------\n\n // Launch an application with WebView.\n await device.shell('am force-stop org.chromium.webview_shell');\n await device.shell('am start org.chromium.webview_shell/.WebViewBrowserActivity');\n // Get the WebView.\n const webview = await device.webView({ pkg: 'org.chromium.webview_shell' });\n\n // Fill the input box.\n await device.fill({ res: 'org.chromium.webview_shell:id/url_field' }, 'github.com/microsoft/playwright');\n await device.press({ res: 'org.chromium.webview_shell:id/url_field' }, 'Enter');\n\n // Work with WebView's page as usual.\n const page = await webview.page();\n await page.waitForNavigation({ url: /.*microsoft\\/playwright.*/ });\n console.log(await page.title());\n }\n\n {\n // --------------------- Browser -----------------------\n\n // Launch Chrome browser.\n await device.shell('am force-stop com.android.chrome');\n const context = await device.launchBrowser();\n\n // Use BrowserContext as usual.\n const page = await context.newPage();\n await page.goto('https://webkit.org/');\n console.log(await page.evaluate(() => window.location.href));\n await page.screenshot({ path: 'page.png' });\n\n await context.close();\n }\n\n // Close the device.\n await device.close();\n})();\n```\n\nNote that since you don't need Playwright to install web browsers when testing Android, you can omit browser download\nvia setting the following environment variable when installing Playwright:\n\n```sh js\n$ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright\n```\n", - "members": [ - { - "kind": "method", - "langs": {}, - "name": "devices", - "type": { - "name": "Array", - "templates": [ - { - "name": "AndroidDevice" - } - ], - "expression": "[Array]<[AndroidDevice]>" - }, - "spec": [ - { - "type": "text", - "text": "Returns the list of detected Android devices." - } - ], - "required": true, - "comment": "Returns the list of detected Android devices.", - "deprecated": false, - "async": true, - "alias": "devices", - "args": [] - }, - { - "kind": "method", - "langs": {}, - "name": "setDefaultTimeout", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "This setting will change the default maximum time for all the methods accepting `timeout` option." - } + "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright" ], - "required": true, - "comment": "This setting will change the default maximum time for all the methods accepting `timeout` option.", - "deprecated": false, - "async": false, - "alias": "setDefaultTimeout", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "timeout", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Maximum time in milliseconds" - } - ], - "required": true, - "comment": "Maximum time in milliseconds", - "deprecated": false, - "async": false, - "alias": "timeout" - } - ] - } - ] - }, - { - "name": "AndroidDevice", - "spec": [ - { - "type": "text", - "text": "`AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using [`method: Android.devices`]." + "codeLang": "bash js" } ], "langs": { @@ -1005,161 +1055,101 @@ "types": {}, "overrides": {} }, - "comment": "`AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using\n[`method: Android.devices`].", + "comment": "Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android\nWebView.\n\n*Requirements*\n- Android device or AVD Emulator.\n- [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device.\n Typically running `adb devices` is all you need to do.\n- [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the\n device\n- \"Enable command line on non-rooted devices\" enabled in `chrome://flags`.\n\n*Known limitations*\n- Raw USB operation is not yet supported, so you need ADB.\n- Device needs to be awake to produce screenshots. Enabling \"Stay awake\" developer mode will help.\n- We didn't run all the tests against the device, so not everything works.\n\n*How to run*\n\nAn example of the Android automation script would be:\n\n```js\nconst { _android: android } = require('playwright');\n\n(async () => {\n // Connect to the device.\n const [device] = await android.devices();\n console.log(`Model: ${device.model()}`);\n console.log(`Serial: ${device.serial()}`);\n // Take screenshot of the whole device.\n await device.screenshot({ path: 'device.png' });\n\n {\n // --------------------- WebView -----------------------\n\n // Launch an application with WebView.\n await device.shell('am force-stop org.chromium.webview_shell');\n await device.shell('am start org.chromium.webview_shell/.WebViewBrowserActivity');\n // Get the WebView.\n const webview = await device.webView({ pkg: 'org.chromium.webview_shell' });\n\n // Fill the input box.\n await device.fill({\n res: 'org.chromium.webview_shell:id/url_field',\n }, 'github.com/microsoft/playwright');\n await device.press({\n res: 'org.chromium.webview_shell:id/url_field',\n }, 'Enter');\n\n // Work with WebView's page as usual.\n const page = await webview.page();\n await page.waitForNavigation({ url: /.*microsoft\\/playwright.*/ });\n console.log(await page.title());\n }\n\n {\n // --------------------- Browser -----------------------\n\n // Launch Chrome browser.\n await device.shell('am force-stop com.android.chrome');\n const context = await device.launchBrowser();\n\n // Use BrowserContext as usual.\n const page = await context.newPage();\n await page.goto('https://webkit.org/');\n console.log(await page.evaluate(() => window.location.href));\n await page.screenshot({ path: 'page.png' });\n\n await context.close();\n }\n\n // Close the device.\n await device.close();\n})();\n```\n\nNote that since you don't need Playwright to install web browsers when testing Android, you can omit browser\ndownload via setting the following environment variable when installing Playwright:\n\n```bash\nPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright\n```\n", + "since": "v1.9", "members": [ - { - "kind": "event", - "langs": {}, - "name": "webView", - "type": { - "name": "AndroidWebView", - "expression": "[AndroidWebView]" - }, - "spec": [ - { - "type": "text", - "text": "Emitted when a new WebView instance is detected." - } - ], - "required": true, - "comment": "Emitted when a new WebView instance is detected.", - "deprecated": false, - "async": false, - "alias": "webView", - "args": [] - }, - { - "kind": "method", - "langs": {}, - "name": "close", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Disconnects from the device." - } - ], - "required": true, - "comment": "Disconnects from the device.", - "deprecated": false, - "async": true, - "alias": "close", - "args": [] - }, { "kind": "method", "langs": {}, - "name": "drag", + "experimental": false, + "since": "v1.28", + "name": "connect", "type": { - "name": "void" + "name": "AndroidDevice", + "expression": "[AndroidDevice]" }, "spec": [ { "type": "text", - "text": "Drags the widget defined by `selector` towards `dest` point." + "text": "This methods attaches Playwright to an existing Android device.↵Use [`method: Android.launchServer`] to launch a new Android server instance." } ], "required": true, - "comment": "Drags the widget defined by `selector` towards `dest` point.", - "deprecated": false, + "comment": "This methods attaches Playwright to an existing Android device. Use [`method: Android.launchServer`] to launch a\nnew Android server instance.", "async": true, - "alias": "drag", + "alias": "connect", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "selector", + "experimental": false, + "since": "v1.28", + "name": "wsEndpoint", "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Selector to drag." + "text": "A browser websocket endpoint to connect to." } ], "required": true, - "comment": "Selector to drag.", - "deprecated": false, + "comment": "A browser websocket endpoint to connect to.", "async": false, - "alias": "selector" + "alias": "wsEndpoint", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "dest", + "experimental": false, + "since": "v1.0", + "name": "options", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "x", + "experimental": false, + "since": "v1.28", + "name": "headers", "type": { - "name": "float", - "expression": "[float]" + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" }, "spec": [ { "type": "text", - "text": "" + "text": "Additional HTTP headers to be sent with web socket connect request. Optional." } ], - "required": true, - "comment": "", - "deprecated": false, + "required": false, + "comment": "Additional HTTP headers to be sent with web socket connect request. Optional.", "async": false, - "alias": "x" + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "y", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "y" - } - ], - "expression": "[Object]" - }, - "spec": [ - { - "type": "text", - "text": "Point to drag to." - } - ], - "required": true, - "comment": "Point to drag to.", - "deprecated": false, - "async": false, - "alias": "dest" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "speed", + "experimental": false, + "since": "v1.28", + "name": "slowMo", "type": { "name": "float", "expression": "[float]" @@ -1167,25 +1157,21 @@ "spec": [ { "type": "text", - "text": "Optional speed of the drag in pixels per second." + "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you↵can see what is going on. Defaults to `0`." } ], "required": false, - "comment": "Optional speed of the drag in pixels per second.", - "deprecated": false, + "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non. Defaults to `0`.", "async": false, - "alias": "speed" + "alias": "slowMo", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, + "langs": {}, + "experimental": false, + "since": "v1.28", "name": "timeout", "type": { "name": "float", @@ -1194,435 +1180,648 @@ "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Maximum time in milliseconds to wait for the connection to be established. Defaults to↵`30000` (30 seconds). Pass `0` to disable timeout." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass\n`0` to disable timeout.", "async": false, - "alias": "timeout" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null } ] }, "required": false, "comment": "", - "deprecated": false, "async": false, - "alias": "options" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "fill", + "experimental": false, + "since": "v1.9", + "name": "devices", "type": { - "name": "void" + "name": "Array", + "templates": [ + { + "name": "AndroidDevice" + } + ], + "expression": "[Array]<[AndroidDevice]>" }, "spec": [ { "type": "text", - "text": "Fills the specific `selector` input box with `text`." + "text": "Returns the list of detected Android devices." } ], "required": true, - "comment": "Fills the specific `selector` input box with `text`.", - "deprecated": false, + "comment": "Returns the list of detected Android devices.", "async": true, - "alias": "fill", + "alias": "devices", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to fill." - } - ], - "required": true, - "comment": "Selector to fill.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "text", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Text to be filled in the input box." - } - ], - "required": true, - "comment": "Text to be filled in the input box.", - "deprecated": false, - "async": false, - "alias": "text" - }, - { - "kind": "property", - "langs": {}, + "experimental": false, + "since": "v1.0", "name": "options", "type": { "name": "Object", "properties": [ { "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} + "langs": {}, + "experimental": false, + "since": "v1.22", + "name": "host", + "type": { + "name": "string", + "expression": "[string]" }, - "name": "timeout", + "spec": [ + { + "type": "text", + "text": "Optional host to establish ADB server connection. Default to `127.0.0.1`." + } + ], + "required": false, + "comment": "Optional host to establish ADB server connection. Default to `127.0.0.1`.", + "async": false, + "alias": "host", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.21", + "name": "omitDriverInstall", "type": { - "name": "float", - "expression": "[float]" + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Prevents automatic playwright driver installation on attach. Assumes that the drivers have been installed already." + } + ], + "required": false, + "comment": "Prevents automatic playwright driver installation on attach. Assumes that the drivers have been installed already.", + "async": false, + "alias": "omitDriverInstall", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.20", + "name": "port", + "type": { + "name": "int", + "expression": "[int]" }, "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Optional port to establish ADB server connection. Default to `5037`." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Optional port to establish ADB server connection. Default to `5037`.", "async": false, - "alias": "timeout" + "alias": "port", + "overloadIndex": 0, + "paramOrOption": null } ] }, "required": false, "comment": "", - "deprecated": false, "async": false, - "alias": "options" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", - "langs": {}, - "name": "fling", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.28", + "name": "launchServer", "type": { - "name": "void" + "name": "BrowserServer", + "expression": "[BrowserServer]" }, "spec": [ { "type": "text", - "text": "Flings the widget defined by `selector` in the specified `direction`." + "text": "Launches Playwright Android server that clients can connect to. See the following example:" + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "Server Side:" + }, + { + "type": "code", + "lines": [ + "const { _android } = require('playwright');", + "", + "(async () => {", + " const browserServer = await _android.launchServer({", + " // If you have multiple devices connected and want to use a specific one.", + " // deviceSerialNumber: '',", + " });", + " const wsEndpoint = browserServer.wsEndpoint();", + " console.log(wsEndpoint);", + "})();" + ], + "codeLang": "js" + }, + { + "type": "text", + "text": "Client Side:" + }, + { + "type": "code", + "lines": [ + "const { _android } = require('playwright');", + "", + "(async () => {", + " const device = await _android.connect('');", + "", + " console.log(device.model());", + " console.log(device.serial());", + " await device.shell('am force-stop com.android.chrome');", + " const context = await device.launchBrowser();", + "", + " const page = await context.newPage();", + " await page.goto('https://webkit.org/');", + " console.log(await page.evaluate(() => window.location.href));", + " await page.screenshot({ path: 'page-chrome-1.png' });", + "", + " await context.close();", + "})();" + ], + "codeLang": "js" } ], "required": true, - "comment": "Flings the widget defined by `selector` in the specified `direction`.", - "deprecated": false, + "comment": "Launches Playwright Android server that clients can connect to. See the following example:\n\n**Usage**\n\nServer Side:\n\n```js\nconst { _android } = require('playwright');\n\n(async () => {\n const browserServer = await _android.launchServer({\n // If you have multiple devices connected and want to use a specific one.\n // deviceSerialNumber: '',\n });\n const wsEndpoint = browserServer.wsEndpoint();\n console.log(wsEndpoint);\n})();\n```\n\nClient Side:\n\n```js\nconst { _android } = require('playwright');\n\n(async () => {\n const device = await _android.connect('');\n\n console.log(device.model());\n console.log(device.serial());\n await device.shell('am force-stop com.android.chrome');\n const context = await device.launchBrowser();\n\n const page = await context.newPage();\n await page.goto('https://webkit.org/');\n console.log(await page.evaluate(() => window.location.href));\n await page.screenshot({ path: 'page-chrome-1.png' });\n\n await context.close();\n})();\n```\n", "async": true, - "alias": "fling", + "alias": "launchServer", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to fling." - } - ], - "required": true, - "comment": "Selector to fling.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "direction", + "experimental": false, + "since": "v1.0", + "name": "options", "type": { - "name": "AndroidFlingDirection", - "union": [ + "name": "Object", + "properties": [ { - "name": "\"down\"" + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.28", + "name": "adbHost", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional host to establish ADB server connection. Default to `127.0.0.1`." + } + ], + "required": false, + "comment": "Optional host to establish ADB server connection. Default to `127.0.0.1`.", + "async": false, + "alias": "adbHost", + "overloadIndex": 0, + "paramOrOption": null }, { - "name": "\"up\"" + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.28", + "name": "adbPort", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Optional port to establish ADB server connection. Default to `5037`." + } + ], + "required": false, + "comment": "Optional port to establish ADB server connection. Default to `5037`.", + "async": false, + "alias": "adbPort", + "overloadIndex": 0, + "paramOrOption": null }, { - "name": "\"left\"" + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.28", + "name": "deviceSerialNumber", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional device serial number to launch the browser on. If not specified, it will↵throw if multiple devices are connected." + } + ], + "required": false, + "comment": "Optional device serial number to launch the browser on. If not specified, it will throw if multiple devices are\nconnected.", + "async": false, + "alias": "deviceSerialNumber", + "overloadIndex": 0, + "paramOrOption": null }, - { - "name": "\"right\"" - } - ], - "expression": "[AndroidFlingDirection]<\"down\"|\"up\"|\"left\"|\"right\">" - }, - "spec": [ - { - "type": "text", - "text": "Fling direction." - } - ], - "required": true, - "comment": "Fling direction.", - "deprecated": false, - "async": false, - "alias": "direction" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ { "kind": "property", "langs": {}, - "name": "speed", + "experimental": false, + "since": "v1.28", + "name": "omitDriverInstall", "type": { - "name": "float", - "expression": "[float]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "Optional speed of the fling in pixels per second." + "text": "Prevents automatic playwright driver installation on attach. Assumes that the drivers have been installed already." } ], "required": false, - "comment": "Optional speed of the fling in pixels per second.", - "deprecated": false, + "comment": "Prevents automatic playwright driver installation on attach. Assumes that the drivers have been installed already.", "async": false, - "alias": "speed" + "alias": "omitDriverInstall", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} + "langs": {}, + "experimental": false, + "since": "v1.28", + "name": "port", + "type": { + "name": "int", + "expression": "[int]" }, - "name": "timeout", + "spec": [ + { + "type": "text", + "text": "Port to use for the web socket. Defaults to 0 that picks any available port." + } + ], + "required": false, + "comment": "Port to use for the web socket. Defaults to 0 that picks any available port.", + "async": false, + "alias": "port", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.28", + "name": "wsPath", "type": { - "name": "float", - "expression": "[float]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Path at which to serve the Android Server. For security, this defaults to an↵unguessable string." + }, + { + "type": "note", + "noteType": "warning", + "text": "Any process or web page (including those running in Playwright) with knowledge↵of the `wsPath` can take control of the OS user. For this reason, you should↵use an unguessable token when using this option." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Path at which to serve the Android Server. For security, this defaults to an unguessable string.\n\n**NOTE** Any process or web page (including those running in Playwright) with knowledge of the `wsPath` can take\ncontrol of the OS user. For this reason, you should use an unguessable token when using this option.", "async": false, - "alias": "timeout" + "alias": "wsPath", + "overloadIndex": 0, + "paramOrOption": null } ] }, "required": false, "comment": "", - "deprecated": false, "async": false, - "alias": "options" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "info", + "experimental": false, + "since": "v1.9", + "name": "setDefaultTimeout", "type": { - "name": "AndroidElementInfo", - "expression": "[AndroidElementInfo]" + "name": "void" }, "spec": [ { "type": "text", - "text": "Returns information about a widget defined by `selector`." + "text": "This setting will change the default maximum time for all the methods accepting `timeout` option." } ], "required": true, - "comment": "Returns information about a widget defined by `selector`.", - "deprecated": false, - "async": true, - "alias": "info", + "comment": "This setting will change the default maximum time for all the methods accepting `timeout` option.", + "async": false, + "alias": "setDefaultTimeout", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "selector", + "experimental": false, + "since": "v1.9", + "name": "timeout", "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Selector to return information about." + "text": "Maximum time in milliseconds" } ], "required": true, - "comment": "Selector to return information about.", - "deprecated": false, + "comment": "Maximum time in milliseconds", "async": false, - "alias": "selector" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null } ] + } + ] + }, + { + "name": "AndroidDevice", + "spec": [ + { + "type": "text", + "text": "`AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using [`method: Android.devices`]." + } + ], + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "comment": "`AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using\n[`method: Android.devices`].", + "since": "v1.9", + "members": [ + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.28", + "name": "close", + "type": { + "name": "AndroidDevice", + "expression": "[AndroidDevice]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when the device connection gets closed." + } + ], + "required": true, + "comment": "Emitted when the device connection gets closed.", + "async": false, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] }, { - "kind": "property", + "kind": "event", "langs": {}, - "name": "input", + "experimental": false, + "since": "v1.9", + "name": "webView", "type": { - "name": "AndroidInput", - "expression": "[AndroidInput]" + "name": "AndroidWebView", + "expression": "[AndroidWebView]" }, - "spec": [], + "spec": [ + { + "type": "text", + "text": "Emitted when a new WebView instance is detected." + } + ], "required": true, - "comment": "", - "deprecated": false, + "comment": "Emitted when a new WebView instance is detected.", "async": false, - "alias": "input", + "alias": "webView", + "overloadIndex": 0, + "paramOrOption": null, "args": [] }, { "kind": "method", "langs": {}, - "name": "installApk", + "experimental": false, + "since": "v1.9", + "name": "close", "type": { "name": "void" }, "spec": [ { "type": "text", - "text": "Installs an apk on the device." + "text": "Disconnects from the device." } ], "required": true, - "comment": "Installs an apk on the device.", - "deprecated": false, + "comment": "Disconnects from the device.", "async": true, - "alias": "installApk", + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "drag", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Drags the widget defined by `selector` towards `dest` point." + } + ], + "required": true, + "comment": "Drags the widget defined by `selector` towards `dest` point.", + "async": true, + "alias": "drag", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "file", + "experimental": false, + "since": "v1.9", + "name": "selector", "type": { - "name": "", - "union": [ - { - "name": "string" - }, - { - "name": "Buffer" - } - ], - "expression": "[string]|[Buffer]" + "name": "AndroidSelector", + "expression": "[AndroidSelector]" }, "spec": [ { "type": "text", - "text": "Either a path to the apk file, or apk file content." + "text": "Selector to drag." } ], "required": true, - "comment": "Either a path to the apk file, or apk file content.", - "deprecated": false, + "comment": "Selector to drag.", "async": false, - "alias": "file" + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "options", + "experimental": false, + "since": "v1.9", + "name": "dest", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "args", + "experimental": false, + "since": "v1.0", + "name": "x", "type": { - "name": "Array", - "templates": [ - { - "name": "string" - } - ], - "expression": "[Array]<[string]>" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`." + "text": "" } ], - "required": false, - "comment": "Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`.", - "deprecated": false, + "required": true, + "comment": "", + "async": false, + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "y", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", "async": false, - "alias": "args" + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null } - ] + ], + "expression": "[Object]" }, - "required": false, - "comment": "", - "deprecated": false, + "spec": [ + { + "type": "text", + "text": "Point to drag to." + } + ], + "required": true, + "comment": "Point to drag to.", "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "launchBrowser", - "type": { - "name": "BrowserContext", - "expression": "[BrowserContext]" - }, - "spec": [ - { - "type": "text", - "text": "Launches Chrome browser on the device, and returns its persistent context." - } - ], - "required": true, - "comment": "Launches Chrome browser on the device, and returns its persistent context.", - "deprecated": false, - "async": true, - "alias": "launchBrowser", - "args": [ + "alias": "dest", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "options", "type": { "name": "Object", @@ -1630,98 +1829,312 @@ { "kind": "property", "langs": {}, - "name": "acceptDownloads", + "experimental": false, + "since": "v1.9", + "name": "speed", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled." + "text": "Optional speed of the drag in pixels per second." } ], "required": false, - "comment": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "deprecated": false, + "comment": "Optional speed of the drag in pixels per second.", "async": false, - "alias": "acceptDownloads" + "alias": "speed", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "bypassCSP", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Toggles bypassing page's Content-Security-Policy." + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." } ], "required": false, - "comment": "Toggles bypassing page's Content-Security-Policy.", - "deprecated": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", "async": false, - "alias": "bypassCSP" - }, - { - "kind": "property", - "langs": {}, - "name": "colorScheme", - "type": { - "name": "ColorScheme", - "union": [ - { - "name": "\"light\"" - }, - { - "name": "\"dark\"" - }, - { - "name": "\"no-preference\"" - } - ], - "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "fill", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Fills the specific `selector` input box with `text`." + } + ], + "required": true, + "comment": "Fills the specific `selector` input box with `text`.", + "async": true, + "alias": "fill", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "AndroidSelector", + "expression": "[AndroidSelector]" + }, + "spec": [ + { + "type": "text", + "text": "Selector to fill." + } + ], + "required": true, + "comment": "Selector to fill.", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "text", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Text to be filled in the input box." + } + ], + "required": true, + "comment": "Text to be filled in the input box.", + "async": false, + "alias": "text", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Defaults to `'light'`." + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." } ], "required": false, - "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "deprecated": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", "async": false, - "alias": "colorScheme" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "fling", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Flings the widget defined by `selector` in the specified `direction`." + } + ], + "required": true, + "comment": "Flings the widget defined by `selector` in the specified `direction`.", + "async": true, + "alias": "fling", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "AndroidSelector", + "expression": "[AndroidSelector]" + }, + "spec": [ + { + "type": "text", + "text": "Selector to fling." + } + ], + "required": true, + "comment": "Selector to fling.", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "direction", + "type": { + "name": "AndroidFlingDirection", + "union": [ + { + "name": "\"down\"" + }, + { + "name": "\"up\"" + }, + { + "name": "\"left\"" }, + { + "name": "\"right\"" + } + ], + "expression": "[AndroidFlingDirection]<\"down\"|\"up\"|\"left\"|\"right\">" + }, + "spec": [ + { + "type": "text", + "text": "Fling direction." + } + ], + "required": true, + "comment": "Fling direction.", + "async": false, + "alias": "direction", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ { "kind": "property", "langs": {}, - "name": "command", + "experimental": false, + "since": "v1.9", + "name": "speed", "type": { - "name": "string", - "expression": "[string]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Optional package name to launch instead of default Chrome for Android." + "text": "Optional speed of the fling in pixels per second." } ], "required": false, - "comment": "Optional package name to launch instead of default Chrome for Android.", - "deprecated": false, + "comment": "Optional speed of the fling in pixels per second.", "async": false, - "alias": "command" + "alias": "speed", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "deviceScaleFactor", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", "type": { "name": "float", "expression": "[float]" @@ -1729,124 +2142,233 @@ "spec": [ { "type": "text", - "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`." + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." } ], "required": false, - "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "deprecated": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", "async": false, - "alias": "deviceScaleFactor" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "info", + "type": { + "name": "AndroidElementInfo", + "expression": "[AndroidElementInfo]" + }, + "spec": [ + { + "type": "text", + "text": "Returns information about a widget defined by `selector`." + } + ], + "required": true, + "comment": "Returns information about a widget defined by `selector`.", + "async": true, + "alias": "info", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "AndroidSelector", + "expression": "[AndroidSelector]" + }, + "spec": [ + { + "type": "text", + "text": "Selector to return information about." + } + ], + "required": true, + "comment": "Selector to return information about.", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "input", + "type": { + "name": "AndroidInput", + "expression": "[AndroidInput]" + }, + "spec": [], + "required": true, + "comment": "", + "async": false, + "alias": "input", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "installApk", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Installs an apk on the device." + } + ], + "required": true, + "comment": "Installs an apk on the device.", + "async": true, + "alias": "installApk", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "file", + "type": { + "name": "", + "union": [ + { + "name": "string" }, + { + "name": "Buffer" + } + ], + "expression": "[string]|[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "Either a path to the apk file, or apk file content." + } + ], + "required": true, + "comment": "Either a path to the apk file, or apk file content.", + "async": false, + "alias": "file", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ { "kind": "property", "langs": {}, - "name": "extraHTTPHeaders", + "experimental": false, + "since": "v1.9", + "name": "args", "type": { - "name": "Object", + "name": "Array", "templates": [ - { - "name": "string" - }, { "name": "string" } ], - "expression": "[Object]<[string], [string]>" + "expression": "[Array]<[string]>" }, "spec": [ { "type": "text", - "text": "An object containing additional HTTP headers to be sent with every request. All header values must be strings." + "text": "Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`." } ], "required": false, - "comment": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "deprecated": false, - "async": false, - "alias": "extraHTTPHeaders" - }, - { - "kind": "property", - "langs": {}, - "name": "geolocation", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "latitude", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Latitude between -90 and 90." - } - ], - "required": true, - "comment": "Latitude between -90 and 90.", - "deprecated": false, - "async": false, - "alias": "latitude" - }, - { - "kind": "property", - "langs": {}, - "name": "longitude", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Longitude between -180 and 180." - } - ], - "required": true, - "comment": "Longitude between -180 and 180.", - "deprecated": false, - "async": false, - "alias": "longitude" - }, - { - "kind": "property", - "langs": {}, - "name": "accuracy", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Non-negative accuracy value. Defaults to `0`." - } - ], - "required": false, - "comment": "Non-negative accuracy value. Defaults to `0`.", - "deprecated": false, - "async": false, - "alias": "accuracy" - } - ], - "expression": "[Object]" - }, - "spec": [], - "required": false, - "comment": "", - "deprecated": false, + "comment": "Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`.", "async": false, - "alias": "geolocation" - }, + "alias": "args", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "launchBrowser", + "type": { + "name": "BrowserContext", + "expression": "[BrowserContext]" + }, + "spec": [ + { + "type": "text", + "text": "Launches Chrome browser on the device, and returns its persistent context." + } + ], + "required": true, + "comment": "Launches Chrome browser on the device, and returns its persistent context.", + "async": true, + "alias": "launchBrowser", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ { "kind": "property", "langs": {}, - "name": "hasTouch", + "experimental": false, + "since": "v1.9", + "name": "acceptDownloads", "type": { "name": "boolean", "expression": "[boolean]" @@ -1854,121 +2376,88 @@ "spec": [ { "type": "text", - "text": "Specifies if viewport supports touch events. Defaults to false." + "text": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted." } ], "required": false, - "comment": "Specifies if viewport supports touch events. Defaults to false.", - "deprecated": false, + "comment": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.", "async": false, - "alias": "hasTouch" + "alias": "acceptDownloads", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "httpCredentials", + "experimental": false, + "since": "v1.29", + "name": "args", "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "username", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "username" - }, + "name": "Array", + "templates": [ { - "kind": "property", - "langs": {}, - "name": "password", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "password" + "name": "string" } ], - "expression": "[Object]" + "expression": "[Array]<[string]>" }, "spec": [ { "type": "text", - "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)." + "text": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](http://peter.sh/experiments/chromium-command-line-switches/)." } ], "required": false, - "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "deprecated": false, + "comment": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](http://peter.sh/experiments/chromium-command-line-switches/).", "async": false, - "alias": "httpCredentials" + "alias": "args", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "ignoreHTTPSErrors", + "experimental": false, + "since": "v1.9", + "name": "baseURL", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Whether to ignore HTTPS errors during navigation. Defaults to `false`." - } - ], - "required": false, - "comment": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "deprecated": false, - "async": false, - "alias": "ignoreHTTPSErrors" - }, - { - "kind": "property", - "langs": {}, - "name": "isMobile", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ + "text": "When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`], [`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:" + }, { - "type": "text", - "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox." + "type": "li", + "text": "baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" } ], "required": false, - "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported\nin Firefox.", - "deprecated": false, + "comment": "When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`],\n[`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by\nusing the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the\ncorresponding URL. Unset by default. Examples:\n- baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`", "async": false, - "alias": "isMobile" + "alias": "baseURL", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "javaScriptEnabled", + "experimental": false, + "since": "v1.9", + "name": "bypassCSP", "type": { "name": "boolean", "expression": "[boolean]" @@ -1976,533 +2465,466 @@ "spec": [ { "type": "text", - "text": "Whether or not to enable JavaScript in the context. Defaults to `true`." - } - ], - "required": false, - "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "deprecated": false, - "async": false, - "alias": "javaScriptEnabled" - }, - { - "kind": "property", - "langs": {}, - "name": "locale", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules." + "text": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`." } ], "required": false, - "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`\nrequest header value as well as number and date formatting rules.", - "deprecated": false, + "comment": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`.", "async": false, - "alias": "locale" + "alias": "bypassCSP", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js" + "js", + "java" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "logger", + "experimental": false, + "since": "v1.9", + "name": "colorScheme", "type": { - "name": "Logger", - "expression": "[Logger]" + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">" }, "spec": [ { "type": "text", - "text": "Logger sink for Playwright logging." + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`." } ], "required": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.", "async": false, - "alias": "logger" + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ + "csharp", "python" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "noViewport", + "experimental": false, + "since": "v1.9", + "name": "colorScheme", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">" }, "spec": [ { "type": "text", - "text": "Does not enforce fixed viewport, allows resizing window in the headed mode." + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`." } ], "required": false, - "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "deprecated": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'light'`.", "async": false, - "alias": "noViewport" + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "offline", + "experimental": false, + "since": "v1.9", + "name": "command", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Whether to emulate network being offline. Defaults to `false`." + "text": "Optional package name to launch instead of default Chrome for Android." } ], "required": false, - "comment": "Whether to emulate network being offline. Defaults to `false`.", - "deprecated": false, + "comment": "Optional package name to launch instead of default Chrome for Android.", "async": false, - "alias": "offline" + "alias": "command", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "permissions", + "experimental": false, + "since": "v1.9", + "name": "deviceScaleFactor", "type": { - "name": "Array", - "templates": [ - { - "name": "string" - } - ], - "expression": "[Array]<[string]>" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more details." + "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about [emulating devices with device scale factor](../emulation.md#devices)." } ], "required": false, - "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more\ndetails.", - "deprecated": false, + "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](../emulation.md#devices).", "async": false, - "alias": "permissions" + "alias": "deviceScaleFactor", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "name": "recordHar", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "extraHTTPHeaders", "type": { "name": "Object", - "properties": [ + "templates": [ { - "kind": "property", - "langs": {}, - "name": "omitContent", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." - } - ], - "required": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "async": false, - "alias": "omitContent" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "path", - "type": { - "name": "path", - "expression": "[path]" - }, - "spec": [ - { - "type": "text", - "text": "Path on the filesystem to write the HAR file to." - } - ], - "required": true, - "comment": "Path on the filesystem to write the HAR file to.", - "deprecated": false, - "async": false, - "alias": "path" + "name": "string" } ], - "expression": "[Object]" + "expression": "[Object]<[string], [string]>" }, "spec": [ { "type": "text", - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved." + "text": "An object containing additional HTTP headers to be sent with every request. Defaults to none." } ], "required": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not\nspecified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "deprecated": false, + "comment": "An object containing additional HTTP headers to be sent with every request. Defaults to none.", "async": false, - "alias": "recordHar" + "alias": "extraHTTPHeaders", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "csharp", - "java", - "python" + "js", + "java" ], - "aliases": { - "python": "record_har_omit_content" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "recordHarOmitContent", + "experimental": false, + "since": "v1.9", + "name": "forcedColors", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ForcedColors", + "union": [ + { + "name": "\"active\"" + }, + { + "name": "\"none\"" + } + ] + } + ], + "expression": "null|[ForcedColors]<\"active\"|\"none\">" }, "spec": [ { "type": "text", - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." + "text": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`." } ], "required": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, + "comment": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'none'`.", "async": false, - "alias": "recordHarOmitContent" + "alias": "forcedColors", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ "csharp", - "java", "python" ], - "aliases": { - "python": "record_har_path" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "recordHarPath", + "experimental": false, + "since": "v1.9", + "name": "forcedColors", "type": { - "name": "path", - "expression": "[path]" + "name": "ForcedColors", + "union": [ + { + "name": "\"active\"" + }, + { + "name": "\"none\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ForcedColors]<\"active\"|\"none\"|\"null\">" }, "spec": [ { "type": "text", - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to be saved." + "text": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`." } ], "required": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the\nfilesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to\nbe saved.", - "deprecated": false, + "comment": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'none'`.", "async": false, - "alias": "recordHarPath" + "alias": "forcedColors", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "name": "recordVideo", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "geolocation", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "dir", + "experimental": false, + "since": "v1.0", + "name": "latitude", "type": { - "name": "path", - "expression": "[path]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Path to the directory to put videos into." + "text": "Latitude between -90 and 90." } ], "required": true, - "comment": "Path to the directory to put videos into.", - "deprecated": false, + "comment": "Latitude between -90 and 90.", "async": false, - "alias": "dir" + "alias": "latitude", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "size", + "experimental": false, + "since": "v1.0", + "name": "longitude", "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame width." - } - ], - "required": true, - "comment": "Video frame width.", - "deprecated": false, - "async": false, - "alias": "width" - }, - { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame height." - } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" - } - ], - "expression": "[Object]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size." + "text": "Longitude between -180 and 180." + } + ], + "required": true, + "comment": "Longitude between -180 and 180.", + "async": false, + "alias": "longitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "accuracy", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Non-negative accuracy value. Defaults to `0`." } ], "required": false, - "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit\ninto 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", - "deprecated": false, + "comment": "Non-negative accuracy value. Defaults to `0`.", "async": false, - "alias": "size" + "alias": "accuracy", + "overloadIndex": 0, + "paramOrOption": null } ], "expression": "[Object]" }, - "spec": [ - { - "type": "text", - "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [`method: BrowserContext.close`] for videos to be saved." - } - ], + "spec": [], "required": false, - "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make\nsure to await [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, + "comment": "", "async": false, - "alias": "recordVideo" + "alias": "geolocation", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "csharp", - "java", - "python" - ], - "aliases": { - "python": "record_video_dir" - }, - "types": {}, - "overrides": {} - }, - "name": "recordVideoDir", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "hasTouch", "type": { - "name": "path", - "expression": "[path]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved." + "text": "Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.md#devices)." } ], "required": false, - "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure\nto call [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, + "comment": "Specifies if viewport supports touch events. Defaults to false. Learn more about\n[mobile emulation](../emulation.md#devices).", "async": false, - "alias": "recordVideoDir" + "alias": "hasTouch", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "csharp", - "java", - "python" - ], - "aliases": { - "python": "record_video_size" - }, - "types": {}, - "overrides": {} - }, - "name": "recordVideoSize", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "httpCredentials", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "width", + "experimental": false, + "since": "v1.0", + "name": "username", "type": { - "name": "int", - "expression": "[int]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Video frame width." + "text": "" } ], "required": true, - "comment": "Video frame width.", - "deprecated": false, + "comment": "", "async": false, - "alias": "width" + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame height." - } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" - } - ], - "expression": "[Object]" - }, - "spec": [ - { - "type": "text", - "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size." - } - ], - "required": false, - "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will\nbe scaled down if necessary to fit the specified size.", - "deprecated": false, - "async": false, - "alias": "recordVideoSize" - }, - { - "kind": "property", - "langs": { - "aliases": { - "java": "screenSize", - "csharp": "screenSize" - }, - "types": {}, - "overrides": {} - }, - "name": "screen", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", + "experimental": false, + "since": "v1.0", + "name": "password", "type": { - "name": "int", - "expression": "[int]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "page width in pixels." + "text": "" } ], "required": true, - "comment": "page width in pixels.", - "deprecated": false, + "comment": "", "async": false, - "alias": "width" + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "height", + "experimental": false, + "since": "v1.0", + "name": "origin", "type": { - "name": "int", - "expression": "[int]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "page height in pixels." + "text": "Restrain sending http credentials on specific origin (scheme://host:port)." } ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, + "required": false, + "comment": "Restrain sending http credentials on specific origin (scheme://host:port).", "async": false, - "alias": "height" + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null } ], "expression": "[Object]" @@ -2510,123 +2932,107 @@ "spec": [ { "type": "text", - "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set." + "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses." } ], "required": false, - "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`\nis set.", - "deprecated": false, + "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.", "async": false, - "alias": "screen" + "alias": "httpCredentials", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "timezoneId", + "experimental": false, + "since": "v1.9", + "name": "ignoreHTTPSErrors", "type": { - "name": "string", - "expression": "[string]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs." + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." } ], "required": false, - "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs.", - "deprecated": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", "async": false, - "alias": "timezoneId" + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "userAgent", + "experimental": false, + "since": "v1.9", + "name": "isMobile", "type": { - "name": "string", - "expression": "[string]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "Specific user agent to use in this context." + "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile)." } ], "required": false, - "comment": "Specific user agent to use in this context.", - "deprecated": false, + "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,\nso you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more\nabout [mobile emulation](../emulation.md#ismobile).", "async": false, - "alias": "userAgent" + "alias": "isMobile", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "javaScriptEnabled", + "type": { + "name": "boolean", + "expression": "[boolean]" }, - "name": "videoSize", + "spec": [ + { + "type": "text", + "text": "Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about [disabling JavaScript](../emulation.md#javascript-enabled)." + } + ], + "required": false, + "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about\n[disabling JavaScript](../emulation.md#javascript-enabled).", + "async": false, + "alias": "javaScriptEnabled", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "locale", "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame width." - } - ], - "required": true, - "comment": "Video frame width.", - "deprecated": false, - "async": false, - "alias": "width" - }, - { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame height." - } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" - } - ], - "expression": "[Object]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "**DEPRECATED** Use `recordVideo` instead." + "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)." } ], "required": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, + "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).", "async": false, - "alias": "videoSize" + "alias": "locale", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", @@ -2638,618 +3044,589 @@ "types": {}, "overrides": {} }, - "name": "videosPath", + "experimental": false, + "since": "v1.9", + "name": "logger", "type": { - "name": "path", - "expression": "[path]" + "name": "Logger", + "expression": "[Logger]" }, "spec": [ { "type": "text", - "text": "**DEPRECATED** Use `recordVideo` instead." + "text": "Logger sink for Playwright logging." } ], "required": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, + "comment": "Logger sink for Playwright logging.", "async": false, - "alias": "videosPath" + "alias": "logger", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js", - "java" + "python" ], - "aliases": { - "java": "viewportSize" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "viewport", + "experimental": false, + "since": "v1.9", + "name": "noViewport", "type": { - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" - }, - { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page height in pixels." - } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" - } - ] - } - ], - "expression": "[null]|[Object]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport." + "text": "Does not enforce fixed viewport, allows resizing window in the headed mode." } ], "required": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "deprecated": false, + "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", "async": false, - "alias": "viewport" + "alias": "noViewport", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "csharp" - ], - "aliases": { - "csharp": "viewportSize" - }, - "types": {}, - "overrides": {} + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "offline", + "type": { + "name": "boolean", + "expression": "[boolean]" }, - "name": "viewport", + "spec": [ + { + "type": "text", + "text": "Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)." + } + ], + "required": false, + "comment": "Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).", + "async": false, + "alias": "offline", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "permissions", "type": { - "name": "", - "union": [ + "name": "Array", + "templates": [ { - "name": "null" + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "A list of permissions to grant to all pages in this context. See↵[`method: BrowserContext.grantPermissions`] for more details. Defaults to none." + } + ], + "required": false, + "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for\nmore details. Defaults to none.", + "async": false, + "alias": "permissions", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.29", + "name": "proxy", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "server", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy." + } + ], + "required": true, + "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", + "async": false, + "alias": "server", + "overloadIndex": 0, + "paramOrOption": null }, { - "name": "Object", - "properties": [ + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "bypass", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" - }, + "type": "text", + "text": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`." + } + ], + "required": false, + "comment": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", + "async": false, + "alias": "bypass", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page height in pixels." - } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" + "type": "text", + "text": "Optional username to use if HTTP proxy requires authentication." } - ] + ], + "required": false, + "comment": "Optional username to use if HTTP proxy requires authentication.", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional password to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional password to use if HTTP proxy requires authentication.", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null } ], - "expression": "[null]|[Object]" + "expression": "[Object]" }, "spec": [ { "type": "text", - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the default viewport." + "text": "Network proxy settings." } ], "required": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable\nthe default viewport.", - "deprecated": false, + "comment": "Network proxy settings.", "async": false, - "alias": "viewport" + "alias": "proxy", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "python" + "js" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "viewport", + "experimental": false, + "since": "v1.9", + "name": "recordHar", "type": { - "name": "", - "union": [ + "name": "Object", + "properties": [ { - "name": "null" + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "omitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.", + "async": false, + "alias": "omitContent", + "overloadIndex": 0, + "paramOrOption": null }, { - "name": "Object", - "properties": [ + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "content", + "type": { + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" + }, + "spec": [ { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" + "type": "text", + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.", + "async": false, + "alias": "content", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default." + } + ], + "required": true, + "comment": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" - }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", + "async": false, + "alias": "mode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "urlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" }, - "spec": [ - { - "type": "text", - "text": "page height in pixels." - } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [ + { + "type": "text", + "text": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none." } - ] + ], + "required": false, + "comment": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.", + "async": false, + "alias": "urlFilter", + "overloadIndex": 0, + "paramOrOption": null } ], - "expression": "[null]|[Object]" + "expression": "[Object]" }, "spec": [ { "type": "text", - "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport." + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved." } ], "required": false, - "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "deprecated": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.", "async": false, - "alias": "viewport" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "longTap", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Performs a long tap on the widget defined by `selector`." - } - ], - "required": true, - "comment": "Performs a long tap on the widget defined by `selector`.", - "deprecated": false, - "async": true, - "alias": "longTap", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to tap on." - } - ], - "required": true, - "comment": "Selector to tap on.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ + "alias": "recordHar", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", "langs": { "only": [ - "js" + "csharp", + "java", + "python" ], - "aliases": {}, + "aliases": { + "python": "record_har_content" + }, "types": {}, "overrides": {} }, - "name": "timeout", + "experimental": false, + "since": "v1.9", + "name": "recordHarContent", "type": { - "name": "float", - "expression": "[float]" + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" }, "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files and all of these files are archived along with the\nHAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.", "async": false, - "alias": "timeout" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "model", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Device model." - } - ], - "required": true, - "comment": "Device model.", - "deprecated": false, - "async": false, - "alias": "model", - "args": [] - }, - { - "kind": "method", - "langs": {}, - "name": "open", - "type": { - "name": "AndroidSocket", - "expression": "[AndroidSocket]" - }, - "spec": [ - { - "type": "text", - "text": "Launches a process in the shell on the device and returns a socket to communicate with the launched process." - } - ], - "required": true, - "comment": "Launches a process in the shell on the device and returns a socket to communicate with the launched process.", - "deprecated": false, - "async": true, - "alias": "open", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "command", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "command" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "pinchClose", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Pinches the widget defined by `selector` in the closing direction." - } - ], - "required": true, - "comment": "Pinches the widget defined by `selector` in the closing direction.", - "deprecated": false, - "async": true, - "alias": "pinchClose", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to pinch close." - } - ], - "required": true, - "comment": "Selector to pinch close.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "percent", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "The size of the pinch as a percentage of the widget's size." - } - ], - "required": true, - "comment": "The size of the pinch as a percentage of the widget's size.", - "deprecated": false, - "async": false, - "alias": "percent" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ + "alias": "recordHarContent", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", - "langs": {}, - "name": "speed", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_mode" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "recordHarMode", "type": { - "name": "float", - "expression": "[float]" + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" }, "spec": [ { "type": "text", - "text": "Optional speed of the pinch in pixels per second." + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." } ], "required": false, - "comment": "Optional speed of the pinch in pixels per second.", - "deprecated": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", "async": false, - "alias": "speed" + "alias": "recordHarMode", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js" + "csharp", + "java", + "python" ], - "aliases": {}, + "aliases": { + "python": "record_har_omit_content" + }, "types": {}, "overrides": {} }, - "name": "timeout", + "experimental": false, + "since": "v1.9", + "name": "recordHarOmitContent", "type": { - "name": "float", - "expression": "[float]" - }, + "name": "boolean", + "expression": "[boolean]" + }, "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", "async": false, - "alias": "timeout" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "pinchOpen", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Pinches the widget defined by `selector` in the open direction." - } - ], - "required": true, - "comment": "Pinches the widget defined by `selector` in the open direction.", - "deprecated": false, - "async": true, - "alias": "pinchOpen", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to pinch open." - } - ], - "required": true, - "comment": "Selector to pinch open.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "percent", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "The size of the pinch as a percentage of the widget's size." - } - ], - "required": true, - "comment": "The size of the pinch as a percentage of the widget's size.", - "deprecated": false, - "async": false, - "alias": "percent" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ + "alias": "recordHarOmitContent", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", - "langs": {}, - "name": "speed", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_path" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "recordHarPath", "type": { - "name": "float", - "expression": "[float]" + "name": "path", + "expression": "[path]" }, "spec": [ { "type": "text", - "text": "Optional speed of the pinch in pixels per second." + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved." } ], "required": false, - "comment": "Optional speed of the pinch in pixels per second.", - "deprecated": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.", + "async": false, + "alias": "recordHarPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_url_filter" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "recordHarUrlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [], + "required": false, + "comment": "", "async": false, - "alias": "speed" + "alias": "recordHarUrlFilter", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", @@ -3261,780 +3638,514 @@ "types": {}, "overrides": {} }, - "name": "timeout", + "experimental": false, + "since": "v1.9", + "name": "recordVideo", "type": { - "name": "float", - "expression": "[float]" + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "dir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to the directory to put videos into." + } + ], + "required": true, + "comment": "Path to the directory to put videos into.", + "async": false, + "alias": "dir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "size", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "size", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" }, "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.", "async": false, - "alias": "timeout" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "press", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Presses the specific `key` in the widget defined by `selector`." - } - ], - "required": true, - "comment": "Presses the specific `key` in the widget defined by `selector`.", - "deprecated": false, - "async": true, - "alias": "press", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to press the key in." - } - ], - "required": true, - "comment": "Selector to press the key in.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "key", - "type": { - "name": "AndroidKey", - "expression": "[AndroidKey]" - }, - "spec": [ - { - "type": "text", - "text": "The key to press." - } - ], - "required": true, - "comment": "The key to press.", - "deprecated": false, - "async": false, - "alias": "key" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ + "alias": "recordVideo", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", "langs": { "only": [ - "js" + "csharp", + "java", + "python" ], - "aliases": {}, + "aliases": { + "python": "record_video_dir" + }, "types": {}, "overrides": {} }, - "name": "timeout", + "experimental": false, + "since": "v1.9", + "name": "recordVideoDir", "type": { - "name": "float", - "expression": "[float]" + "name": "path", + "expression": "[path]" }, "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.", "async": false, - "alias": "timeout" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "push", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Copies a file to the device." - } - ], - "required": true, - "comment": "Copies a file to the device.", - "deprecated": false, - "async": true, - "alias": "push", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "file", - "type": { - "name": "", - "union": [ - { - "name": "string" + "alias": "recordVideoDir", + "overloadIndex": 0, + "paramOrOption": null }, - { - "name": "Buffer" - } - ], - "expression": "[string]|[Buffer]" - }, - "spec": [ - { - "type": "text", - "text": "Either a path to the file, or file content." - } - ], - "required": true, - "comment": "Either a path to the file, or file content.", - "deprecated": false, - "async": false, - "alias": "file" - }, - { - "kind": "property", - "langs": {}, - "name": "path", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Path to the file on the device." - } - ], - "required": true, - "comment": "Path to the file on the device.", - "deprecated": false, - "async": false, - "alias": "path" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ { "kind": "property", - "langs": {}, - "name": "mode", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_size" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "recordVideoSize", "type": { - "name": "int", - "expression": "[int]" + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" }, "spec": [ { "type": "text", - "text": "Optional file mode, defaults to `644` (`rw-r--r--`)." + "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." } ], "required": false, - "comment": "Optional file mode, defaults to `644` (`rw-r--r--`).", - "deprecated": false, + "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", "async": false, - "alias": "mode" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "screenshot", - "type": { - "name": "Buffer", - "expression": "[Buffer]" - }, - "spec": [ - { - "type": "text", - "text": "Returns the buffer with the captured screenshot of the device." - } - ], - "required": true, - "comment": "Returns the buffer with the captured screenshot of the device.", - "deprecated": false, - "async": true, - "alias": "screenshot", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ + "alias": "recordVideoSize", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", - "langs": {}, - "name": "path", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "reducedMotion", "type": { - "name": "path", - "expression": "[path]" + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ReducedMotion", + "union": [ + { + "name": "\"reduce\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ReducedMotion]<\"reduce\"|\"no-preference\">" }, "spec": [ { "type": "text", - "text": "The file path to save the image to. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk." + "text": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`." } ], "required": false, - "comment": "The file path to save the image to. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. If no path is provided, the image won't be saved to the disk.", - "deprecated": false, + "comment": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'no-preference'`.", "async": false, - "alias": "path" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "scroll", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Scrolls the widget defined by `selector` in the specified `direction`." - } - ], - "required": true, - "comment": "Scrolls the widget defined by `selector` in the specified `direction`.", - "deprecated": false, - "async": true, - "alias": "scroll", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to scroll." - } - ], - "required": true, - "comment": "Selector to scroll.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "direction", - "type": { - "name": "AndroidScrollDirection", - "union": [ - { - "name": "\"down\"" - }, - { - "name": "\"up\"" + "alias": "reducedMotion", + "overloadIndex": 0, + "paramOrOption": null }, - { - "name": "\"left\"" - }, - { - "name": "\"right\"" - } - ], - "expression": "[AndroidScrollDirection]<\"down\"|\"up\"|\"left\"|\"right\">" - }, - "spec": [ - { - "type": "text", - "text": "Scroll direction." - } - ], - "required": true, - "comment": "Scroll direction.", - "deprecated": false, - "async": false, - "alias": "direction" - }, - { - "kind": "property", - "langs": {}, - "name": "percent", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Distance to scroll as a percentage of the widget's size." - } - ], - "required": true, - "comment": "Distance to scroll as a percentage of the widget's size.", - "deprecated": false, - "async": false, - "alias": "percent" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ { "kind": "property", - "langs": {}, - "name": "speed", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "reducedMotion", "type": { - "name": "float", - "expression": "[float]" + "name": "ReducedMotion", + "union": [ + { + "name": "\"reduce\"" + }, + { + "name": "\"no-preference\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">" }, "spec": [ { "type": "text", - "text": "Optional speed of the scroll in pixels per second." + "text": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`." } ], "required": false, - "comment": "Optional speed of the scroll in pixels per second.", - "deprecated": false, + "comment": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'no-preference'`.", "async": false, - "alias": "speed" + "alias": "reducedMotion", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { - "only": [ - "js" - ], - "aliases": {}, + "aliases": { + "java": "screenSize", + "csharp": "screenSize" + }, "types": {}, "overrides": {} }, - "name": "timeout", + "experimental": false, + "since": "v1.9", + "name": "screen", "type": { - "name": "float", - "expression": "[float]" + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" }, "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the↵`viewport` is set." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the\n`viewport` is set.", "async": false, - "alias": "timeout" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "serial", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Device serial number." - } - ], - "required": true, - "comment": "Device serial number.", - "deprecated": false, - "async": false, - "alias": "serial", - "args": [] - }, - { - "kind": "method", - "langs": {}, - "name": "setDefaultTimeout", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "This setting will change the default maximum time for all the methods accepting `timeout` option." - } - ], - "required": true, - "comment": "This setting will change the default maximum time for all the methods accepting `timeout` option.", - "deprecated": false, - "async": false, - "alias": "setDefaultTimeout", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "timeout", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Maximum time in milliseconds" - } - ], - "required": true, - "comment": "Maximum time in milliseconds", - "deprecated": false, - "async": false, - "alias": "timeout" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "shell", - "type": { - "name": "Buffer", - "expression": "[Buffer]" - }, - "spec": [ - { - "type": "text", - "text": "Executes a shell command on the device and returns its output." - } - ], - "required": true, - "comment": "Executes a shell command on the device and returns its output.", - "deprecated": false, - "async": true, - "alias": "shell", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "command", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Shell command to execute." - } - ], - "required": true, - "comment": "Shell command to execute.", - "deprecated": false, - "async": false, - "alias": "command" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "swipe", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Swipes the widget defined by `selector` in the specified `direction`." - } - ], - "required": true, - "comment": "Swipes the widget defined by `selector` in the specified `direction`.", - "deprecated": false, - "async": true, - "alias": "swipe", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to swipe." - } - ], - "required": true, - "comment": "Selector to swipe.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "direction", - "type": { - "name": "AndroidSwipeDirection", - "union": [ - { - "name": "\"down\"" - }, - { - "name": "\"up\"" + "alias": "screen", + "overloadIndex": 0, + "paramOrOption": null }, { - "name": "\"left\"" + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "serviceWorkers", + "type": { + "name": "ServiceWorkerPolicy", + "union": [ + { + "name": "\"allow\"" + }, + { + "name": "\"block\"" + } + ], + "expression": "[ServiceWorkerPolicy]<\"allow\"|\"block\">" + }, + "spec": [ + { + "type": "text", + "text": "Whether to allow sites to register Service workers. Defaults to `'allow'`." + }, + { + "type": "li", + "text": "`'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'block'`: Playwright will block all registration of Service Workers.", + "liType": "bullet" + } + ], + "required": false, + "comment": "Whether to allow sites to register Service workers. Defaults to `'allow'`.\n- `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be\n registered.\n- `'block'`: Playwright will block all registration of Service Workers.", + "async": false, + "alias": "serviceWorkers", + "overloadIndex": 0, + "paramOrOption": null }, - { - "name": "\"right\"" - } - ], - "expression": "[AndroidSwipeDirection]<\"down\"|\"up\"|\"left\"|\"right\">" - }, - "spec": [ - { - "type": "text", - "text": "Swipe direction." - } - ], - "required": true, - "comment": "Swipe direction.", - "deprecated": false, - "async": false, - "alias": "direction" - }, - { - "kind": "property", - "langs": {}, - "name": "percent", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Distance to swipe as a percentage of the widget's size." - } - ], - "required": true, - "comment": "Distance to swipe as a percentage of the widget's size.", - "deprecated": false, - "async": false, - "alias": "percent" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ { "kind": "property", "langs": {}, - "name": "speed", + "experimental": false, + "since": "v1.9", + "name": "strictSelectors", "type": { - "name": "float", - "expression": "[float]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "Optional speed of the swipe in pixels per second." + "text": "If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations↵on selectors that imply single target DOM element will throw when more than one element matches the selector.↵This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.↵See `Locator` to learn more about the strict mode." } ], "required": false, - "comment": "Optional speed of the swipe in pixels per second.", - "deprecated": false, + "comment": "If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on\nselectors that imply single target DOM element will throw when more than one element matches the selector. This\noption does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See `Locator` to learn\nmore about the strict mode.", "async": false, - "alias": "speed" + "alias": "strictSelectors", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "name": "timeout", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "timezoneId", "type": { - "name": "float", - "expression": "[float]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.", "async": false, - "alias": "timeout" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "tap", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Taps on the widget defined by `selector`." - } - ], - "required": true, - "comment": "Taps on the widget defined by `selector`.", - "deprecated": false, - "async": true, - "alias": "tap", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "selector", - "type": { - "name": "AndroidSelector", - "expression": "[AndroidSelector]" - }, - "spec": [ - { - "type": "text", - "text": "Selector to tap on." - } - ], - "required": true, - "comment": "Selector to tap on.", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ + "alias": "timezoneId", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", "langs": {}, - "name": "duration", + "experimental": false, + "since": "v1.9", + "name": "userAgent", "type": { - "name": "float", - "expression": "[float]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Optional duration of the tap in milliseconds." + "text": "Specific user agent to use in this context." } ], "required": false, - "comment": "Optional duration of the tap in milliseconds.", - "deprecated": false, + "comment": "Specific user agent to use in this context.", "async": false, - "alias": "duration" + "alias": "userAgent", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", @@ -4046,55 +4157,407 @@ "types": {}, "overrides": {} }, - "name": "timeout", + "experimental": false, + "since": "v1.9", + "deprecated": "Use `recordVideo` instead.", + "name": "videoSize", "type": { - "name": "float", - "expression": "[float]" + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" }, - "spec": [ - { - "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." - } - ], + "spec": [], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "", + "async": false, + "alias": "videoSize", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "deprecated": "Use `recordVideo` instead.", + "name": "videosPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "videosPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": { + "java": "viewportSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport)." + }, + { + "type": "note", + "noteType": "note", + "text": "The `null` value opts out from the default presets, makes viewport depend on the↵host window size defined by the operating system. It makes the execution of the↵tests non-deterministic." + } + ], + "required": false, + "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent\nviewport emulation. Learn more about [viewport emulation](../emulation#viewport).\n\n**NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined\nby the operating system. It makes the execution of the tests non-deterministic.", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": { + "csharp": "viewportSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport)." + }, + { + "type": "note", + "noteType": "note", + "text": "The `ViewportSize.NoViewport` value opts out from the default presets,↵makes viewport depend on the host window size defined by the operating system.↵It makes the execution of the tests non-deterministic." + } + ], + "required": false, + "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to\ndisable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport).\n\n**NOTE** The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host\nwindow size defined by the operating system. It makes the execution of the tests non-deterministic.", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport. Learn more about [viewport emulation](../emulation.md#viewport)." + } + ], + "required": false, + "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed\nviewport. Learn more about [viewport emulation](../emulation.md#viewport).", "async": false, - "alias": "timeout" + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null } ] }, "required": false, "comment": "", - "deprecated": false, "async": false, - "alias": "options" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "wait", + "experimental": false, + "since": "v1.9", + "name": "longTap", "type": { "name": "void" }, "spec": [ { "type": "text", - "text": "Waits for the specific `selector` to either appear or disappear, depending on the `state`." + "text": "Performs a long tap on the widget defined by `selector`." } ], "required": true, - "comment": "Waits for the specific `selector` to either appear or disappear, depending on the `state`.", - "deprecated": false, + "comment": "Performs a long tap on the widget defined by `selector`.", "async": true, - "alias": "wait", + "alias": "longTap", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.9", "name": "selector", "type": { "name": "AndroidSelector", @@ -4103,52 +4566,25 @@ "spec": [ { "type": "text", - "text": "Selector to wait for." + "text": "Selector to tap on." } ], "required": true, - "comment": "Selector to wait for.", - "deprecated": false, + "comment": "Selector to tap on.", "async": false, - "alias": "selector" + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "options", "type": { "name": "Object", "properties": [ - { - "kind": "property", - "langs": {}, - "name": "state", - "type": { - "name": "\"gone\"", - "expression": "\"gone\"" - }, - "spec": [ - { - "type": "text", - "text": "Optional state. Can be either:" - }, - { - "type": "li", - "text": "default - wait for element to be present.", - "liType": "bullet" - }, - { - "type": "li", - "text": "`'gone'` - wait for element to not be present.", - "liType": "bullet" - } - ], - "required": false, - "comment": "Optional state. Can be either:\n- default - wait for element to be present.\n- `'gone'` - wait for element to not be present.", - "deprecated": false, - "async": false, - "alias": "state" - }, { "kind": "property", "langs": { @@ -4159,6 +4595,8 @@ "types": {}, "overrides": {} }, + "experimental": false, + "since": "v1.9", "name": "timeout", "type": { "name": "float", @@ -4167,201 +4605,194 @@ "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", "async": false, - "alias": "timeout" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null } ] }, "required": false, "comment": "", - "deprecated": false, "async": false, - "alias": "options" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "waitForEvent", + "experimental": false, + "since": "v1.9", + "name": "model", "type": { - "name": "any", - "expression": "[any]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value." + "text": "Device model." } ], "required": true, - "comment": "Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue.", - "deprecated": false, + "comment": "Device model.", + "async": false, + "alias": "model", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "open", + "type": { + "name": "AndroidSocket", + "expression": "[AndroidSocket]" + }, + "spec": [ + { + "type": "text", + "text": "Launches a process in the shell on the device and returns a socket to communicate with the launched process." + } + ], + "required": true, + "comment": "Launches a process in the shell on the device and returns a socket to communicate with the launched process.", "async": true, - "alias": "waitForEvent", + "alias": "open", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "event", + "experimental": false, + "since": "v1.9", + "name": "command", "type": { "name": "string", "expression": "[string]" }, - "spec": [ - { - "type": "text", - "text": "Event name, same one typically passed into `*.on(event)`." - } - ], + "spec": [], "required": true, - "comment": "Event name, same one typically passed into `*.on(event)`.", - "deprecated": false, - "async": false, - "alias": "event" - }, - { - "kind": "property", - "langs": {}, - "name": "optionsOrPredicate", - "type": { - "name": "", - "union": [ - { - "name": "function" - }, - { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "predicate", - "type": { - "name": "function", - "expression": "[function]" - }, - "spec": [ - { - "type": "text", - "text": "receives the event data and resolves to truthy value when the waiting should resolve." - } - ], - "required": true, - "comment": "receives the event data and resolves to truthy value when the waiting should resolve.", - "deprecated": false, - "async": false, - "alias": "predicate" - }, - { - "kind": "property", - "langs": {}, - "name": "timeout", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`]." - } - ], - "required": false, - "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default\nvalue can be changed by using the [`method: AndroidDevice.setDefaultTimeout`].", - "deprecated": false, - "async": false, - "alias": "timeout" - } - ] - } - ], - "expression": "[function]|[Object]" - }, - "spec": [ - { - "type": "text", - "text": "Either a predicate that receives an event or an options object. Optional." - } - ], - "required": false, - "comment": "Either a predicate that receives an event or an options object. Optional.", - "deprecated": false, + "comment": "", "async": false, - "alias": "optionsOrPredicate" + "alias": "command", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "webView", + "experimental": false, + "since": "v1.9", + "name": "pinchClose", "type": { - "name": "AndroidWebView", - "expression": "[AndroidWebView]" + "name": "void" }, "spec": [ { "type": "text", - "text": "This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an open `AndroidWebView` matching the `selector`, returns immediately." + "text": "Pinches the widget defined by `selector` in the closing direction." } ], "required": true, - "comment": "This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an open\n`AndroidWebView` matching the `selector`, returns immediately.", - "deprecated": false, + "comment": "Pinches the widget defined by `selector` in the closing direction.", "async": true, - "alias": "webView", + "alias": "pinchClose", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.9", "name": "selector", + "type": { + "name": "AndroidSelector", + "expression": "[AndroidSelector]" + }, + "spec": [ + { + "type": "text", + "text": "Selector to pinch close." + } + ], + "required": true, + "comment": "Selector to pinch close.", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "percent", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "The size of the pinch as a percentage of the widget's size." + } + ], + "required": true, + "comment": "The size of the pinch as a percentage of the widget's size.", + "async": false, + "alias": "percent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "pkg", + "experimental": false, + "since": "v1.9", + "name": "speed", "type": { - "name": "string", - "expression": "[string]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Package identifier." + "text": "Optional speed of the pinch in pixels per second." } ], - "required": true, - "comment": "Package identifier.", - "deprecated": false, + "required": false, + "comment": "Optional speed of the pinch in pixels per second.", "async": false, - "alias": "pkg" - } - ], - "expression": "[Object]" - }, - "spec": [], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "selector" - }, - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ + "alias": "speed", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", "langs": { @@ -4372,6 +4803,8 @@ "types": {}, "overrides": {} }, + "experimental": false, + "since": "v1.9", "name": "timeout", "type": { "name": "float", @@ -4380,157 +4813,110 @@ "spec": [ { "type": "text", - "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`] method." + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." } ], "required": false, - "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.", - "deprecated": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", "async": false, - "alias": "timeout" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null } ] }, "required": false, "comment": "", - "deprecated": false, "async": false, - "alias": "options" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "webViews", - "type": { - "name": "Array", - "templates": [ - { - "name": "AndroidWebView" - } - ], - "expression": "[Array]<[AndroidWebView]>" - }, - "spec": [ - { - "type": "text", - "text": "Currently open WebViews." - } - ], - "required": true, - "comment": "Currently open WebViews.", - "deprecated": false, - "async": false, - "alias": "webViews", - "args": [] - } - ] - }, - { - "name": "AndroidInput", - "spec": [], - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "members": [ - { - "kind": "method", - "langs": {}, - "name": "drag", + "experimental": false, + "since": "v1.9", + "name": "pinchOpen", "type": { "name": "void" }, "spec": [ { "type": "text", - "text": "Performs a drag between `from` and `to` points." + "text": "Pinches the widget defined by `selector` in the open direction." } ], "required": true, - "comment": "Performs a drag between `from` and `to` points.", - "deprecated": false, + "comment": "Pinches the widget defined by `selector` in the open direction.", "async": true, - "alias": "drag", + "alias": "pinchOpen", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "from", + "experimental": false, + "since": "v1.9", + "name": "selector", "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "x", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "x" - }, - { - "kind": "property", - "langs": {}, - "name": "y", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "y" - } - ], - "expression": "[Object]" + "name": "AndroidSelector", + "expression": "[AndroidSelector]" }, "spec": [ { "type": "text", - "text": "The start point of the drag." + "text": "Selector to pinch open." } ], "required": true, - "comment": "The start point of the drag.", - "deprecated": false, + "comment": "Selector to pinch open.", "async": false, - "alias": "from" + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "to", + "experimental": false, + "since": "v1.9", + "name": "percent", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "The size of the pinch as a percentage of the widget's size." + } + ], + "required": true, + "comment": "The size of the pinch as a percentage of the widget's size.", + "async": false, + "alias": "percent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "x", + "experimental": false, + "since": "v1.9", + "name": "speed", "type": { "name": "float", "expression": "[float]" @@ -4538,19 +4924,29 @@ "spec": [ { "type": "text", - "text": "" + "text": "Optional speed of the pinch in pixels per second." } ], - "required": true, - "comment": "", - "deprecated": false, + "required": false, + "comment": "Optional speed of the pinch in pixels per second.", "async": false, - "alias": "x" + "alias": "speed", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "y", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", "type": { "name": "float", "expression": "[float]" @@ -4558,293 +4954,450 @@ "spec": [ { "type": "text", - "text": "" + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." } ], - "required": true, - "comment": "", - "deprecated": false, + "required": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", "async": false, - "alias": "y" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null } - ], - "expression": "[Object]" + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "press", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Presses the specific `key` in the widget defined by `selector`." + } + ], + "required": true, + "comment": "Presses the specific `key` in the widget defined by `selector`.", + "async": true, + "alias": "press", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "AndroidSelector", + "expression": "[AndroidSelector]" }, "spec": [ { "type": "text", - "text": "The end point of the drag." + "text": "Selector to press the key in." } ], "required": true, - "comment": "The end point of the drag.", - "deprecated": false, + "comment": "Selector to press the key in.", "async": false, - "alias": "to" + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "steps", + "experimental": false, + "since": "v1.9", + "name": "key", "type": { - "name": "int", - "expression": "[int]" + "name": "AndroidKey", + "expression": "[AndroidKey]" }, "spec": [ { "type": "text", - "text": "The number of steps in the drag. Each step takes 5 milliseconds to complete." + "text": "The key to press." } ], "required": true, - "comment": "The number of steps in the drag. Each step takes 5 milliseconds to complete.", - "deprecated": false, + "comment": "The key to press.", + "async": false, + "alias": "key", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." + } + ], + "required": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", "async": false, - "alias": "steps" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "press", + "experimental": false, + "since": "v1.9", + "name": "push", "type": { "name": "void" }, "spec": [ { "type": "text", - "text": "Presses the `key`." + "text": "Copies a file to the device." } ], "required": true, - "comment": "Presses the `key`.", - "deprecated": false, + "comment": "Copies a file to the device.", "async": true, - "alias": "press", + "alias": "push", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "key", + "experimental": false, + "since": "v1.9", + "name": "file", "type": { - "name": "AndroidKey", - "expression": "[AndroidKey]" + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "Buffer" + } + ], + "expression": "[string]|[Buffer]" }, "spec": [ { "type": "text", - "text": "Key to press." + "text": "Either a path to the file, or file content." } ], "required": true, - "comment": "Key to press.", - "deprecated": false, + "comment": "Either a path to the file, or file content.", + "async": false, + "alias": "file", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "path", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Path to the file on the device." + } + ], + "required": true, + "comment": "Path to the file on the device.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "mode", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Optional file mode, defaults to `644` (`rw-r--r--`)." + } + ], + "required": false, + "comment": "Optional file mode, defaults to `644` (`rw-r--r--`).", + "async": false, + "alias": "mode", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", "async": false, - "alias": "key" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "swipe", + "experimental": false, + "since": "v1.9", + "name": "screenshot", "type": { - "name": "void" + "name": "Buffer", + "expression": "[Buffer]" }, "spec": [ { "type": "text", - "text": "Swipes following the path defined by `segments`." + "text": "Returns the buffer with the captured screenshot of the device." } ], "required": true, - "comment": "Swipes following the path defined by `segments`.", - "deprecated": false, + "comment": "Returns the buffer with the captured screenshot of the device.", "async": true, - "alias": "swipe", + "alias": "screenshot", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "from", + "experimental": false, + "since": "v1.0", + "name": "options", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "x", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "x" - }, - { - "kind": "property", - "langs": {}, - "name": "y", + "experimental": false, + "since": "v1.9", + "name": "path", "type": { - "name": "float", - "expression": "[float]" + "name": "path", + "expression": "[path]" }, "spec": [ { "type": "text", - "text": "" + "text": "The file path to save the image to. If `path` is a↵relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be↵saved to the disk." } ], - "required": true, - "comment": "", - "deprecated": false, + "required": false, + "comment": "The file path to save the image to. If `path` is a relative path, then it is resolved relative to the current\nworking directory. If no path is provided, the image won't be saved to the disk.", "async": false, - "alias": "y" + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null } - ], - "expression": "[Object]" + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "scroll", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Scrolls the widget defined by `selector` in the specified `direction`." + } + ], + "required": true, + "comment": "Scrolls the widget defined by `selector` in the specified `direction`.", + "async": true, + "alias": "scroll", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "AndroidSelector", + "expression": "[AndroidSelector]" }, "spec": [ { "type": "text", - "text": "The point to start swiping from." + "text": "Selector to scroll." } ], "required": true, - "comment": "The point to start swiping from.", - "deprecated": false, + "comment": "Selector to scroll.", "async": false, - "alias": "from" + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "segments", + "experimental": false, + "since": "v1.9", + "name": "direction", "type": { - "name": "Array", - "templates": [ + "name": "AndroidScrollDirection", + "union": [ { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "x", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "x" - }, - { - "kind": "property", - "langs": {}, - "name": "y", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "y" - } - ] + "name": "\"down\"" + }, + { + "name": "\"up\"" + }, + { + "name": "\"left\"" + }, + { + "name": "\"right\"" } ], - "expression": "[Array]<[Object]>" + "expression": "[AndroidScrollDirection]<\"down\"|\"up\"|\"left\"|\"right\">" }, "spec": [ { "type": "text", - "text": "Points following the `from` point in the swipe gesture." + "text": "Scroll direction." } ], "required": true, - "comment": "Points following the `from` point in the swipe gesture.", - "deprecated": false, + "comment": "Scroll direction.", "async": false, - "alias": "segments" + "alias": "direction", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "steps", + "experimental": false, + "since": "v1.9", + "name": "percent", "type": { - "name": "int", - "expression": "[int]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "The number of steps for each segment. Each step takes 5 milliseconds to complete, so 100 steps means half a second per each segment." + "text": "Distance to scroll as a percentage of the widget's size." } ], "required": true, - "comment": "The number of steps for each segment. Each step takes 5 milliseconds to complete, so 100 steps means half a second per\neach segment.", - "deprecated": false, + "comment": "Distance to scroll as a percentage of the widget's size.", "async": false, - "alias": "steps" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "tap", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "Taps at the specified `point`." - } - ], - "required": true, - "comment": "Taps at the specified `point`.", - "deprecated": false, - "async": true, - "alias": "tap", - "args": [ + "alias": "percent", + "overloadIndex": 0, + "paramOrOption": null + }, { "kind": "property", "langs": {}, - "name": "point", + "experimental": false, + "since": "v1.0", + "name": "options", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "x", + "experimental": false, + "since": "v1.9", + "name": "speed", "type": { "name": "float", "expression": "[float]" @@ -4852,19 +5405,29 @@ "spec": [ { "type": "text", - "text": "" + "text": "Optional speed of the scroll in pixels per second." } ], - "required": true, - "comment": "", - "deprecated": false, + "required": false, + "comment": "Optional speed of the scroll in pixels per second.", "async": false, - "alias": "x" + "alias": "speed", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "y", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", "type": { "name": "float", "expression": "[float]" @@ -4872,55 +5435,127 @@ "spec": [ { "type": "text", - "text": "" + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." } ], - "required": true, - "comment": "", - "deprecated": false, + "required": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", "async": false, - "alias": "y" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null } - ], - "expression": "[Object]" + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "serial", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Device serial number." + } + ], + "required": true, + "comment": "Device serial number.", + "async": false, + "alias": "serial", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "setDefaultTimeout", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "This setting will change the default maximum time for all the methods accepting `timeout` option." + } + ], + "required": true, + "comment": "This setting will change the default maximum time for all the methods accepting `timeout` option.", + "async": false, + "alias": "setDefaultTimeout", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "The point to tap at." + "text": "Maximum time in milliseconds" } ], "required": true, - "comment": "The point to tap at.", - "deprecated": false, + "comment": "Maximum time in milliseconds", "async": false, - "alias": "point" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", "langs": {}, - "name": "type", + "experimental": false, + "since": "v1.9", + "name": "shell", "type": { - "name": "void" + "name": "Buffer", + "expression": "[Buffer]" }, "spec": [ { "type": "text", - "text": "Types `text` into currently focused widget." + "text": "Executes a shell command on the device and returns its output." } ], "required": true, - "comment": "Types `text` into currently focused widget.", - "deprecated": false, + "comment": "Executes a shell command on the device and returns its output.", "async": true, - "alias": "type", + "alias": "shell", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "text", + "experimental": false, + "since": "v1.9", + "name": "command", "type": { "name": "string", "expression": "[string]" @@ -4928,664 +5563,874 @@ "spec": [ { "type": "text", - "text": "Text to type." + "text": "Shell command to execute." } ], "required": true, - "comment": "Text to type.", - "deprecated": false, + "comment": "Shell command to execute.", "async": false, - "alias": "text" + "alias": "command", + "overloadIndex": 0, + "paramOrOption": null } ] - } - ] - }, - { - "name": "AndroidSocket", - "spec": [ - { - "type": "text", - "text": "`AndroidSocket` is a way to communicate with a process launched on the `AndroidDevice`. Use [`method: AndroidDevice.open`] to open a socket." - } - ], - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "comment": "`AndroidSocket` is a way to communicate with a process launched on the `AndroidDevice`. Use\n[`method: AndroidDevice.open`] to open a socket.", - "members": [ + }, { - "kind": "event", + "kind": "method", "langs": {}, - "name": "close", + "experimental": false, + "since": "v1.9", + "name": "swipe", "type": { "name": "void" }, "spec": [ { "type": "text", - "text": "Emitted when the socket is closed." + "text": "Swipes the widget defined by `selector` in the specified `direction`." } ], "required": true, - "comment": "Emitted when the socket is closed.", - "deprecated": false, - "async": false, - "alias": "close", - "args": [] - }, - { - "kind": "event", - "langs": {}, - "name": "data", - "type": { - "name": "Buffer", - "expression": "[Buffer]" - }, - "spec": [ + "comment": "Swipes the widget defined by `selector` in the specified `direction`.", + "async": true, + "alias": "swipe", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ { - "type": "text", - "text": "Emitted when data is available to read from the socket." + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "AndroidSelector", + "expression": "[AndroidSelector]" + }, + "spec": [ + { + "type": "text", + "text": "Selector to swipe." + } + ], + "required": true, + "comment": "Selector to swipe.", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "direction", + "type": { + "name": "AndroidSwipeDirection", + "union": [ + { + "name": "\"down\"" + }, + { + "name": "\"up\"" + }, + { + "name": "\"left\"" + }, + { + "name": "\"right\"" + } + ], + "expression": "[AndroidSwipeDirection]<\"down\"|\"up\"|\"left\"|\"right\">" + }, + "spec": [ + { + "type": "text", + "text": "Swipe direction." + } + ], + "required": true, + "comment": "Swipe direction.", + "async": false, + "alias": "direction", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "percent", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Distance to swipe as a percentage of the widget's size." + } + ], + "required": true, + "comment": "Distance to swipe as a percentage of the widget's size.", + "async": false, + "alias": "percent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "speed", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Optional speed of the swipe in pixels per second." + } + ], + "required": false, + "comment": "Optional speed of the swipe in pixels per second.", + "async": false, + "alias": "speed", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." + } + ], + "required": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } - ], - "required": true, - "comment": "Emitted when data is available to read from the socket.", - "deprecated": false, - "async": false, - "alias": "data", - "args": [] + ] }, { "kind": "method", "langs": {}, - "name": "close", + "experimental": false, + "since": "v1.9", + "name": "tap", "type": { "name": "void" }, "spec": [ { "type": "text", - "text": "Closes the socket." + "text": "Taps on the widget defined by `selector`." } ], "required": true, - "comment": "Closes the socket.", - "deprecated": false, + "comment": "Taps on the widget defined by `selector`.", "async": true, - "alias": "close", - "args": [] + "alias": "tap", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "AndroidSelector", + "expression": "[AndroidSelector]" + }, + "spec": [ + { + "type": "text", + "text": "Selector to tap on." + } + ], + "required": true, + "comment": "Selector to tap on.", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "duration", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Optional duration of the tap in milliseconds." + } + ], + "required": false, + "comment": "Optional duration of the tap in milliseconds.", + "async": false, + "alias": "duration", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." + } + ], + "required": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] }, { "kind": "method", "langs": {}, - "name": "write", + "experimental": false, + "since": "v1.9", + "name": "wait", "type": { "name": "void" }, "spec": [ { "type": "text", - "text": "Writes some `data` to the socket." + "text": "Waits for the specific `selector` to either appear or disappear, depending on the `state`." } ], "required": true, - "comment": "Writes some `data` to the socket.", - "deprecated": false, + "comment": "Waits for the specific `selector` to either appear or disappear, depending on the `state`.", "async": true, - "alias": "write", + "alias": "wait", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "data", + "experimental": false, + "since": "v1.9", + "name": "selector", "type": { - "name": "Buffer", - "expression": "[Buffer]" + "name": "AndroidSelector", + "expression": "[AndroidSelector]" }, "spec": [ { "type": "text", - "text": "Data to write." + "text": "Selector to wait for." } ], "required": true, - "comment": "Data to write.", - "deprecated": false, + "comment": "Selector to wait for.", "async": false, - "alias": "data" - } - ] - } - ] - }, - { - "name": "AndroidWebView", - "spec": [ - { - "type": "text", - "text": "`AndroidWebView` represents a WebView open on the `AndroidDevice`. WebView is usually obtained using [`method: AndroidDevice.webView`]." - } - ], - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "comment": "`AndroidWebView` represents a WebView open on the `AndroidDevice`. WebView is usually obtained using\n[`method: AndroidDevice.webView`].", - "members": [ - { - "kind": "event", - "langs": {}, - "name": "close", - "type": { - "name": "void" - }, - "spec": [ + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + }, { - "type": "text", - "text": "Emitted when the WebView is closed." + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "state", + "type": { + "name": "AndroidDeviceState", + "union": [ + { + "name": "\"gone\"" + } + ], + "expression": "[AndroidDeviceState]<\"gone\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional state. Can be either:" + }, + { + "type": "li", + "text": "default - wait for element to be present.", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'gone'` - wait for element to not be present.", + "liType": "bullet" + } + ], + "required": false, + "comment": "Optional state. Can be either:\n- default - wait for element to be present.\n- `'gone'` - wait for element to not be present.", + "async": false, + "alias": "state", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." + } + ], + "required": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } - ], - "required": true, - "comment": "Emitted when the WebView is closed.", - "deprecated": false, - "async": false, - "alias": "close", - "args": [] + ] }, { "kind": "method", "langs": {}, - "name": "page", + "experimental": false, + "since": "v1.9", + "name": "waitForEvent", "type": { - "name": "Page", - "expression": "[Page]" + "name": "any", + "expression": "[any]" }, "spec": [ { "type": "text", - "text": "Connects to the WebView and returns a regular Playwright `Page` to interact with." + "text": "Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value." } ], "required": true, - "comment": "Connects to the WebView and returns a regular Playwright `Page` to interact with.", - "deprecated": false, + "comment": "Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue.", "async": true, - "alias": "page", - "args": [] - }, - { - "kind": "method", - "langs": {}, - "name": "pid", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ + "alias": "waitForEvent", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ { - "type": "text", - "text": "WebView process PID." + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "event", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Event name, same one typically passed into `*.on(event)`." + } + ], + "required": true, + "comment": "Event name, same one typically passed into `*.on(event)`.", + "async": false, + "alias": "event", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "optionsOrPredicate", + "type": { + "name": "", + "union": [ + { + "name": "function" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "predicate", + "type": { + "name": "function", + "expression": "[function]" + }, + "spec": [ + { + "type": "text", + "text": "receives the event data and resolves to truthy value when the waiting should resolve." + } + ], + "required": true, + "comment": "receives the event data and resolves to truthy value when the waiting should resolve.", + "async": false, + "alias": "predicate", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`]." + } + ], + "required": false, + "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`].", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[function]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Either a predicate that receives an event or an options object. Optional." + } + ], + "required": false, + "comment": "Either a predicate that receives an event or an options object. Optional.", + "async": false, + "alias": "optionsOrPredicate", + "overloadIndex": 0, + "paramOrOption": null } - ], - "required": true, - "comment": "WebView process PID.", - "deprecated": false, - "async": false, - "alias": "pid", - "args": [] + ] }, { "kind": "method", "langs": {}, - "name": "pkg", + "experimental": false, + "since": "v1.9", + "name": "webView", "type": { - "name": "string", - "expression": "[string]" + "name": "AndroidWebView", + "expression": "[AndroidWebView]" }, "spec": [ { "type": "text", - "text": "WebView package identifier." + "text": "This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an open `AndroidWebView` matching the `selector`, returns immediately." } ], "required": true, - "comment": "WebView package identifier.", - "deprecated": false, - "async": false, - "alias": "pkg", - "args": [] - } - ] - }, - { - "name": "Browser", - "spec": [ - { - "type": "li", - "text": "extends: [EventEmitter]", - "liType": "bullet" - }, - { - "type": "text", - "text": "A Browser is created via [`method: BrowserType.launch`]. An example of using a `Browser` to create a `Page`:" - }, - { - "type": "code", - "lines": [ - "const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.", - "", - "(async () => {", - " const browser = await firefox.launch();", - " const page = await browser.newPage();", - " await page.goto('https://example.com');", - " await browser.close();", - "})();" - ], - "codeLang": "js" - }, - { - "type": "code", - "lines": [ - "import com.microsoft.playwright.*;", - "", - "public class Example {", - " public static void main(String[] args) {", - " try (Playwright playwright = Playwright.create()) {", - " BrowserType firefox = playwright.firefox()", - " Browser browser = firefox.launch();", - " Page page = browser.newPage();", - " page.navigate('https://example.com');", - " browser.close();", - " }", - " }", - "}" - ], - "codeLang": "java" - }, - { - "type": "code", - "lines": [ - "import asyncio", - "from playwright.async_api import async_playwright", - "", - "async def run(playwright):", - " firefox = playwright.firefox", - " browser = await firefox.launch()", - " page = await browser.new_page()", - " await page.goto(\"https://example.com\")", - " await browser.close()", - "", - "async def main():", - " async with async_playwright() as playwright:", - " await run(playwright)", - "asyncio.run(main())" - ], - "codeLang": "python async" - }, - { - "type": "code", - "lines": [ - "from playwright.sync_api import sync_playwright", - "", - "def run(playwright):", - " firefox = playwright.firefox", - " browser = firefox.launch()", - " page = browser.new_page()", - " page.goto(\"https://example.com\")", - " browser.close()", - "", - "with sync_playwright() as playwright:", - " run(playwright)" - ], - "codeLang": "python sync" - } - ], - "extends": "EventEmitter", - "langs": {}, - "comment": "- extends: [EventEmitter]\n\nA Browser is created via [`method: BrowserType.launch`]. An example of using a `Browser` to create a `Page`:\n\n```js\nconst { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n const browser = await firefox.launch();\n const page = await browser.newPage();\n await page.goto('https://example.com');\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType firefox = playwright.firefox()\n Browser browser = firefox.launch();\n Page page = browser.newPage();\n page.navigate('https://example.com');\n browser.close();\n }\n }\n}\n```\n\n```python async\nimport asyncio\nfrom playwright.async_api import async_playwright\n\nasync def run(playwright):\n firefox = playwright.firefox\n browser = await firefox.launch()\n page = await browser.new_page()\n await page.goto(\"https://example.com\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```python sync\nfrom playwright.sync_api import sync_playwright\n\ndef run(playwright):\n firefox = playwright.firefox\n browser = firefox.launch()\n page = browser.new_page()\n page.goto(\"https://example.com\")\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n", - "members": [ - { - "kind": "event", - "langs": {}, - "name": "disconnected", - "type": { - "name": "Browser", - "expression": "[Browser]" - }, - "spec": [ - { - "type": "text", - "text": "Emitted when Browser gets disconnected from the browser application. This might happen because of one of the following:" - }, - { - "type": "li", - "text": "Browser application is closed or crashed.", - "liType": "bullet" - }, - { - "type": "li", - "text": "The [`method: Browser.close`] method was called.", - "liType": "bullet" - } - ], - "required": true, - "comment": "Emitted when Browser gets disconnected from the browser application. This might happen because of one of the following:\n- Browser application is closed or crashed.\n- The [`method: Browser.close`] method was called.", - "deprecated": false, - "async": false, - "alias": "disconnected", - "args": [] - }, - { - "kind": "method", - "langs": {}, - "name": "close", - "type": { - "name": "void" - }, - "spec": [ - { - "type": "text", - "text": "In case this browser is obtained using [`method: BrowserType.launch`], closes the browser and all of its pages (if any were opened)." - }, + "comment": "This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an\nopen `AndroidWebView` matching the `selector`, returns immediately.", + "async": true, + "alias": "webView", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ { - "type": "text", - "text": "In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the browser server." + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "pkg", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional Package identifier." + } + ], + "required": false, + "comment": "Optional Package identifier.", + "async": false, + "alias": "pkg", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "socketName", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional webview socket name." + } + ], + "required": false, + "comment": "Optional webview socket name.", + "async": false, + "alias": "socketName", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": true, + "comment": "", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null }, { - "type": "text", - "text": "The `Browser` object itself is considered to be disposed and cannot be used anymore." + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method." + } + ], + "required": false, + "comment": "Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } - ], - "required": true, - "comment": "In case this browser is obtained using [`method: BrowserType.launch`], closes the browser and all of its pages (if any\nwere opened).\n\nIn case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the\nbrowser server.\n\nThe `Browser` object itself is considered to be disposed and cannot be used anymore.", - "deprecated": false, - "async": true, - "alias": "close", - "args": [] + ] }, { "kind": "method", "langs": {}, - "name": "contexts", + "experimental": false, + "since": "v1.9", + "name": "webViews", "type": { "name": "Array", "templates": [ { - "name": "BrowserContext" + "name": "AndroidWebView" } ], - "expression": "[Array]<[BrowserContext]>" - }, - "spec": [ - { - "type": "text", - "text": "Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts." - }, - { - "type": "code", - "lines": [ - "const browser = await pw.webkit.launch();", - "console.log(browser.contexts().length); // prints `0`", - "", - "const context = await browser.newContext();", - "console.log(browser.contexts().length); // prints `1`" - ], - "codeLang": "js" - }, - { - "type": "code", - "lines": [ - "Browser browser = pw.webkit().launch();", - "System.out.println(browser.contexts().size()); // prints \"0\"", - "BrowserContext context = browser.newContext();", - "System.out.println(browser.contexts().size()); // prints \"1\"" - ], - "codeLang": "java" - }, - { - "type": "code", - "lines": [ - "browser = await pw.webkit.launch()", - "print(len(browser.contexts())) # prints `0`", - "context = await browser.new_context()", - "print(len(browser.contexts())) # prints `1`" - ], - "codeLang": "python async" - }, - { - "type": "code", - "lines": [ - "browser = pw.webkit.launch()", - "print(len(browser.contexts())) # prints `0`", - "context = browser.new_context()", - "print(len(browser.contexts())) # prints `1`" - ], - "codeLang": "python sync" - } - ], - "required": true, - "comment": "Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts.\n\n```js\nconst browser = await pw.webkit.launch();\nconsole.log(browser.contexts().length); // prints `0`\n\nconst context = await browser.newContext();\nconsole.log(browser.contexts().length); // prints `1`\n```\n\n```java\nBrowser browser = pw.webkit().launch();\nSystem.out.println(browser.contexts().size()); // prints \"0\"\nBrowserContext context = browser.newContext();\nSystem.out.println(browser.contexts().size()); // prints \"1\"\n```\n\n```python async\nbrowser = await pw.webkit.launch()\nprint(len(browser.contexts())) # prints `0`\ncontext = await browser.new_context()\nprint(len(browser.contexts())) # prints `1`\n```\n\n```python sync\nbrowser = pw.webkit.launch()\nprint(len(browser.contexts())) # prints `0`\ncontext = browser.new_context()\nprint(len(browser.contexts())) # prints `1`\n```\n", - "deprecated": false, - "async": false, - "alias": "contexts", - "args": [] - }, - { - "kind": "method", - "langs": {}, - "name": "isConnected", - "type": { - "name": "boolean", - "expression": "[boolean]" + "expression": "[Array]<[AndroidWebView]>" }, "spec": [ { "type": "text", - "text": "Indicates that the browser is connected." + "text": "Currently open WebViews." } ], "required": true, - "comment": "Indicates that the browser is connected.", - "deprecated": false, + "comment": "Currently open WebViews.", "async": false, - "alias": "isConnected", - "args": [] - }, - { - "kind": "method", - "langs": { - "only": [ - "js", - "python" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "name": "newBrowserCDPSession", - "type": { - "name": "CDPSession", - "expression": "[CDPSession]" - }, - "spec": [ - { - "type": "note", - "noteType": "note", - "text": "CDP Sessions are only supported on Chromium-based browsers." - }, - { - "type": "text", - "text": "Returns the newly created browser session." - } - ], - "required": true, - "comment": "> NOTE: CDP Sessions are only supported on Chromium-based browsers.\n\nReturns the newly created browser session.", - "deprecated": false, - "async": true, - "alias": "newBrowserCDPSession", + "alias": "webViews", + "overloadIndex": 0, + "paramOrOption": null, "args": [] - }, + } + ] + }, + { + "name": "AndroidInput", + "spec": [], + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "since": "v1.9", + "members": [ { "kind": "method", "langs": {}, - "name": "newContext", + "experimental": false, + "since": "v1.9", + "name": "drag", "type": { - "name": "BrowserContext", - "expression": "[BrowserContext]" + "name": "void" }, "spec": [ { "type": "text", - "text": "Creates a new browser context. It won't share cookies/cache with other browser contexts." - }, - { - "type": "code", - "lines": [ - "(async () => {", - " const browser = await playwright.firefox.launch(); // Or 'chromium' or 'webkit'.", - " // Create a new incognito browser context.", - " const context = await browser.newContext();", - " // Create a new page in a pristine context.", - " const page = await context.newPage();", - " await page.goto('https://example.com');", - "})();" - ], - "codeLang": "js" - }, - { - "type": "code", - "lines": [ - "Browser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'.", - "// Create a new incognito browser context.", - "BrowserContext context = browser.newContext();", - "// Create a new page in a pristine context.", - "Page page = context.newPage();", - "page.navigate('https://example.com');" - ], - "codeLang": "java" - }, - { - "type": "code", - "lines": [ - "browser = await playwright.firefox.launch() # or \"chromium\" or \"webkit\".", - "# create a new incognito browser context.", - "context = await browser.new_context()", - "# create a new page in a pristine context.", - "page = await context.new_page()", - "await page.goto(\"https://example.com\")" - ], - "codeLang": "python async" - }, - { - "type": "code", - "lines": [ - "browser = playwright.firefox.launch() # or \"chromium\" or \"webkit\".", - "# create a new incognito browser context.", - "context = browser.new_context()", - "# create a new page in a pristine context.", - "page = context.new_page()", - "page.goto(\"https://example.com\")" - ], - "codeLang": "python sync" + "text": "Performs a drag between `from` and `to` points." } ], "required": true, - "comment": "Creates a new browser context. It won't share cookies/cache with other browser contexts.\n\n```js\n(async () => {\n const browser = await playwright.firefox.launch(); // Or 'chromium' or 'webkit'.\n // Create a new incognito browser context.\n const context = await browser.newContext();\n // Create a new page in a pristine context.\n const page = await context.newPage();\n await page.goto('https://example.com');\n})();\n```\n\n```java\nBrowser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'.\n// Create a new incognito browser context.\nBrowserContext context = browser.newContext();\n// Create a new page in a pristine context.\nPage page = context.newPage();\npage.navigate('https://example.com');\n```\n\n```python async\nbrowser = await playwright.firefox.launch() # or \"chromium\" or \"webkit\".\n# create a new incognito browser context.\ncontext = await browser.new_context()\n# create a new page in a pristine context.\npage = await context.new_page()\nawait page.goto(\"https://example.com\")\n```\n\n```python sync\nbrowser = playwright.firefox.launch() # or \"chromium\" or \"webkit\".\n# create a new incognito browser context.\ncontext = browser.new_context()\n# create a new page in a pristine context.\npage = context.new_page()\npage.goto(\"https://example.com\")\n```\n", - "deprecated": false, + "comment": "Performs a drag between `from` and `to` points.", "async": true, - "alias": "newContext", + "alias": "drag", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "options", + "experimental": false, + "since": "v1.9", + "name": "from", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "acceptDownloads", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled." - } - ], - "required": false, - "comment": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "deprecated": false, - "async": false, - "alias": "acceptDownloads" - }, - { - "kind": "property", - "langs": {}, - "name": "bypassCSP", + "experimental": false, + "since": "v1.0", + "name": "x", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Toggles bypassing page's Content-Security-Policy." + "text": "" } ], - "required": false, - "comment": "Toggles bypassing page's Content-Security-Policy.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "bypassCSP" + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "colorScheme", + "experimental": false, + "since": "v1.0", + "name": "y", "type": { - "name": "ColorScheme", - "union": [ - { - "name": "\"light\"" - }, - { - "name": "\"dark\"" - }, - { - "name": "\"no-preference\"" - } - ], - "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Defaults to `'light'`." + "text": "" } ], - "required": false, - "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "colorScheme" - }, + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "The start point of the drag." + } + ], + "required": true, + "comment": "The start point of the drag.", + "async": false, + "alias": "from", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "to", + "type": { + "name": "Object", + "properties": [ { "kind": "property", "langs": {}, - "name": "deviceScaleFactor", + "experimental": false, + "since": "v1.0", + "name": "x", "type": { "name": "float", "expression": "[float]" @@ -5593,541 +6438,909 @@ "spec": [ { "type": "text", - "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`." + "text": "" } ], - "required": false, - "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "deviceScaleFactor" + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "extraHTTPHeaders", + "experimental": false, + "since": "v1.0", + "name": "y", "type": { - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } - ], - "expression": "[Object]<[string], [string]>" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "An object containing additional HTTP headers to be sent with every request. All header values must be strings." + "text": "" } ], - "required": false, - "comment": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "extraHTTPHeaders" - }, - { - "kind": "property", - "langs": {}, - "name": "geolocation", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "latitude", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Latitude between -90 and 90." - } - ], - "required": true, - "comment": "Latitude between -90 and 90.", - "deprecated": false, - "async": false, - "alias": "latitude" - }, - { - "kind": "property", - "langs": {}, - "name": "longitude", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Longitude between -180 and 180." - } - ], - "required": true, - "comment": "Longitude between -180 and 180.", - "deprecated": false, - "async": false, - "alias": "longitude" - }, - { - "kind": "property", - "langs": {}, - "name": "accuracy", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Non-negative accuracy value. Defaults to `0`." - } - ], - "required": false, - "comment": "Non-negative accuracy value. Defaults to `0`.", - "deprecated": false, - "async": false, - "alias": "accuracy" - } - ], - "expression": "[Object]" - }, - "spec": [], - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "geolocation" - }, - { - "kind": "property", - "langs": {}, - "name": "hasTouch", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Specifies if viewport supports touch events. Defaults to false." - } - ], - "required": false, - "comment": "Specifies if viewport supports touch events. Defaults to false.", - "deprecated": false, - "async": false, - "alias": "hasTouch" - }, - { - "kind": "property", - "langs": {}, - "name": "httpCredentials", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "username", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "username" - }, - { - "kind": "property", - "langs": {}, - "name": "password", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "password" - } - ], - "expression": "[Object]" - }, - "spec": [ - { - "type": "text", - "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)." - } - ], - "required": false, - "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "deprecated": false, - "async": false, - "alias": "httpCredentials" - }, - { - "kind": "property", - "langs": {}, - "name": "ignoreHTTPSErrors", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Whether to ignore HTTPS errors during navigation. Defaults to `false`." - } - ], - "required": false, - "comment": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "deprecated": false, - "async": false, - "alias": "ignoreHTTPSErrors" - }, - { - "kind": "property", - "langs": {}, - "name": "isMobile", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox." - } - ], - "required": false, - "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported\nin Firefox.", - "deprecated": false, - "async": false, - "alias": "isMobile" - }, + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "The end point of the drag." + } + ], + "required": true, + "comment": "The end point of the drag.", + "async": false, + "alias": "to", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "steps", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "The number of steps in the drag. Each step takes 5 milliseconds to complete." + } + ], + "required": true, + "comment": "The number of steps in the drag. Each step takes 5 milliseconds to complete.", + "async": false, + "alias": "steps", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "press", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Presses the `key`." + } + ], + "required": true, + "comment": "Presses the `key`.", + "async": true, + "alias": "press", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "key", + "type": { + "name": "AndroidKey", + "expression": "[AndroidKey]" + }, + "spec": [ + { + "type": "text", + "text": "Key to press." + } + ], + "required": true, + "comment": "Key to press.", + "async": false, + "alias": "key", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "swipe", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Swipes following the path defined by `segments`." + } + ], + "required": true, + "comment": "Swipes following the path defined by `segments`.", + "async": true, + "alias": "swipe", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "from", + "type": { + "name": "Object", + "properties": [ { "kind": "property", "langs": {}, - "name": "javaScriptEnabled", + "experimental": false, + "since": "v1.0", + "name": "x", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Whether or not to enable JavaScript in the context. Defaults to `true`." + "text": "" } ], - "required": false, - "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "javaScriptEnabled" + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "locale", + "experimental": false, + "since": "v1.0", + "name": "y", "type": { - "name": "string", - "expression": "[string]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules." + "text": "" } ], - "required": false, - "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`\nrequest header value as well as number and date formatting rules.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "locale" - }, + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "The point to start swiping from." + } + ], + "required": true, + "comment": "The point to start swiping from.", + "async": false, + "alias": "from", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "segments", + "type": { + "name": "Array", + "templates": [ { - "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "name": "logger", - "type": { - "name": "Logger", - "expression": "[Logger]" - }, - "spec": [ + "name": "Object", + "properties": [ { - "type": "text", - "text": "Logger sink for Playwright logging." - } - ], - "required": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, - "async": false, - "alias": "logger" - }, - { - "kind": "property", - "langs": { - "only": [ - "python" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "name": "noViewport", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "x", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null + }, { - "type": "text", - "text": "Does not enforce fixed viewport, allows resizing window in the headed mode." + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "y", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null } - ], - "required": false, - "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "deprecated": false, - "async": false, - "alias": "noViewport" - }, + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Points following the `from` point in the swipe gesture." + } + ], + "required": true, + "comment": "Points following the `from` point in the swipe gesture.", + "async": false, + "alias": "segments", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "steps", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "The number of steps for each segment. Each step takes 5 milliseconds to complete, so 100 steps means half a second per each segment." + } + ], + "required": true, + "comment": "The number of steps for each segment. Each step takes 5 milliseconds to complete, so 100 steps means half a second\nper each segment.", + "async": false, + "alias": "steps", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "tap", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Taps at the specified `point`." + } + ], + "required": true, + "comment": "Taps at the specified `point`.", + "async": true, + "alias": "tap", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "point", + "type": { + "name": "Object", + "properties": [ { "kind": "property", "langs": {}, - "name": "offline", + "experimental": false, + "since": "v1.0", + "name": "x", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Whether to emulate network being offline. Defaults to `false`." + "text": "" } ], - "required": false, - "comment": "Whether to emulate network being offline. Defaults to `false`.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "offline" + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "permissions", + "experimental": false, + "since": "v1.0", + "name": "y", "type": { - "name": "Array", - "templates": [ - { - "name": "string" - } - ], - "expression": "[Array]<[string]>" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more details." + "text": "" } ], - "required": false, - "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more\ndetails.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "permissions" - }, - { - "kind": "property", - "langs": {}, - "name": "proxy", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "server", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy." - } - ], - "required": true, - "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "deprecated": false, - "async": false, - "alias": "server" - }, - { - "kind": "property", - "langs": {}, - "name": "bypass", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`." - } - ], - "required": false, - "comment": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "deprecated": false, - "async": false, - "alias": "bypass" - }, - { - "kind": "property", - "langs": {}, - "name": "username", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional username to use if HTTP proxy requires authentication." - } - ], - "required": false, - "comment": "Optional username to use if HTTP proxy requires authentication.", - "deprecated": false, - "async": false, - "alias": "username" - }, - { - "kind": "property", - "langs": {}, - "name": "password", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional password to use if HTTP proxy requires authentication." - } - ], - "required": false, - "comment": "Optional password to use if HTTP proxy requires authentication.", - "deprecated": false, - "async": false, - "alias": "password" - } - ], - "expression": "[Object]" + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "The point to tap at." + } + ], + "required": true, + "comment": "The point to tap at.", + "async": false, + "alias": "point", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "type", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Types `text` into currently focused widget." + } + ], + "required": true, + "comment": "Types `text` into currently focused widget.", + "async": true, + "alias": "type", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "text", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Text to type." + } + ], + "required": true, + "comment": "Text to type.", + "async": false, + "alias": "text", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + }, + { + "name": "AndroidSocket", + "spec": [ + { + "type": "text", + "text": "`AndroidSocket` is a way to communicate with a process launched on the `AndroidDevice`. Use [`method: AndroidDevice.open`] to open a socket." + } + ], + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "comment": "`AndroidSocket` is a way to communicate with a process launched on the `AndroidDevice`. Use\n[`method: AndroidDevice.open`] to open a socket.", + "since": "v1.9", + "members": [ + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when the socket is closed." + } + ], + "required": true, + "comment": "Emitted when the socket is closed.", + "async": false, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "data", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when data is available to read from the socket." + } + ], + "required": true, + "comment": "Emitted when data is available to read from the socket.", + "async": false, + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Closes the socket." + } + ], + "required": true, + "comment": "Closes the socket.", + "async": true, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "write", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Writes some `data` to the socket." + } + ], + "required": true, + "comment": "Writes some `data` to the socket.", + "async": true, + "alias": "write", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "data", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "Data to write." + } + ], + "required": true, + "comment": "Data to write.", + "async": false, + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + }, + { + "name": "AndroidWebView", + "spec": [ + { + "type": "text", + "text": "`AndroidWebView` represents a WebView open on the `AndroidDevice`. WebView is usually obtained using [`method: AndroidDevice.webView`]." + } + ], + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "comment": "`AndroidWebView` represents a WebView open on the `AndroidDevice`. WebView is usually obtained using\n[`method: AndroidDevice.webView`].", + "since": "v1.9", + "members": [ + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when the WebView is closed." + } + ], + "required": true, + "comment": "Emitted when the WebView is closed.", + "async": false, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "page", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "Connects to the WebView and returns a regular Playwright `Page` to interact with." + } + ], + "required": true, + "comment": "Connects to the WebView and returns a regular Playwright `Page` to interact with.", + "async": true, + "alias": "page", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "pid", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "WebView process PID." + } + ], + "required": true, + "comment": "WebView process PID.", + "async": false, + "alias": "pid", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "pkg", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "WebView package identifier." + } + ], + "required": true, + "comment": "WebView package identifier.", + "async": false, + "alias": "pkg", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "APIRequest", + "spec": [ + { + "type": "text", + "text": "Exposes API that can be used for the Web API testing. This class is used for creating↵`APIRequestContext` instance which in turn can be used for sending web requests. An instance↵of this class can be obtained via [`property: Playwright.request`]. For more information↵see `APIRequestContext`." + } + ], + "langs": {}, + "comment": "Exposes API that can be used for the Web API testing. This class is used for creating `APIRequestContext` instance\nwhich in turn can be used for sending web requests. An instance of this class can be obtained via\n[`property: Playwright.request`]. For more information see `APIRequestContext`.", + "since": "v1.16", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "newContext", + "type": { + "name": "APIRequestContext", + "expression": "[APIRequestContext]" + }, + "spec": [ + { + "type": "text", + "text": "Creates new instances of `APIRequestContext`." + } + ], + "required": true, + "comment": "Creates new instances of `APIRequestContext`.", + "async": true, + "alias": "newContext", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "baseURL", + "type": { + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Network proxy settings to use with this context." + "text": "Methods like [`method: APIRequestContext.get`] take the base URL into consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Examples:" }, { - "type": "note", - "noteType": "note", - "text": "For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'http://per-context' } })`." + "type": "li", + "text": "baseURL: `http://localhost:3000` and sending request to `/bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo/` and sending request to `./bar.html` results in `http://localhost:3000/foo/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" } ], "required": false, - "comment": "Network proxy settings to use with this context.\n\n> NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all\ncontexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: {\nserver: 'http://per-context' } })`.", - "deprecated": false, + "comment": "Methods like [`method: APIRequestContext.get`] take the base URL into consideration by using the\n[`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL.\nExamples:\n- baseURL: `http://localhost:3000` and sending request to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and sending request to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`", "async": false, - "alias": "proxy" + "alias": "baseURL", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "js" + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "extraHTTPHeaders", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } ], - "aliases": {}, - "types": {}, - "overrides": {} + "expression": "[Object]<[string], [string]>" }, - "name": "recordHar", + "spec": [ + { + "type": "text", + "text": "An object containing additional HTTP headers to be sent with every request. Defaults to none." + } + ], + "required": false, + "comment": "An object containing additional HTTP headers to be sent with every request. Defaults to none.", + "async": false, + "alias": "extraHTTPHeaders", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "httpCredentials", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "omitContent", + "experimental": false, + "since": "v1.0", + "name": "username", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." + "text": "" } ], - "required": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "omitContent" + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "path", + "experimental": false, + "since": "v1.0", + "name": "password", "type": { - "name": "path", - "expression": "[path]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Path on the filesystem to write the HAR file to." + "text": "" } ], "required": true, - "comment": "Path on the filesystem to write the HAR file to.", - "deprecated": false, + "comment": "", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Restrain sending http credentials on specific origin (scheme://host:port)." + } + ], + "required": false, + "comment": "Restrain sending http credentials on specific origin (scheme://host:port).", "async": false, - "alias": "path" + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null } ], "expression": "[Object]" @@ -6135,30 +7348,22 @@ "spec": [ { "type": "text", - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved." + "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses." } ], "required": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not\nspecified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "deprecated": false, + "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.", "async": false, - "alias": "recordHar" + "alias": "httpCredentials", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "csharp", - "java", - "python" - ], - "aliases": { - "python": "record_har_omit_content" - }, - "types": {}, - "overrides": {} - }, - "name": "recordHarOmitContent", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "ignoreHTTPSErrors", "type": { "name": "boolean", "expression": "[boolean]" @@ -6166,314 +7371,116 @@ "spec": [ { "type": "text", - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." - } - ], - "required": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "async": false, - "alias": "recordHarOmitContent" - }, - { - "kind": "property", - "langs": { - "only": [ - "csharp", - "java", - "python" - ], - "aliases": { - "python": "record_har_path" - }, - "types": {}, - "overrides": {} - }, - "name": "recordHarPath", - "type": { - "name": "path", - "expression": "[path]" - }, - "spec": [ - { - "type": "text", - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to be saved." + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." } ], "required": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the\nfilesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to\nbe saved.", - "deprecated": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", "async": false, - "alias": "recordHarPath" + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": { - "only": [ - "js" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "name": "recordVideo", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "proxy", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "dir", + "experimental": false, + "since": "v1.0", + "name": "server", "type": { - "name": "path", - "expression": "[path]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Path to the directory to put videos into." + "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy." } ], "required": true, - "comment": "Path to the directory to put videos into.", - "deprecated": false, + "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", "async": false, - "alias": "dir" + "alias": "server", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "size", + "experimental": false, + "since": "v1.0", + "name": "bypass", "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame width." - } - ], - "required": true, - "comment": "Video frame width.", - "deprecated": false, - "async": false, - "alias": "width" - }, - { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame height." - } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" - } - ], - "expression": "[Object]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size." + "text": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`." } ], "required": false, - "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit\ninto 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", - "deprecated": false, - "async": false, - "alias": "size" - } - ], - "expression": "[Object]" - }, - "spec": [ - { - "type": "text", - "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [`method: BrowserContext.close`] for videos to be saved." - } - ], - "required": false, - "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make\nsure to await [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "async": false, - "alias": "recordVideo" - }, - { - "kind": "property", - "langs": { - "only": [ - "csharp", - "java", - "python" - ], - "aliases": { - "python": "record_video_dir" - }, - "types": {}, - "overrides": {} - }, - "name": "recordVideoDir", - "type": { - "name": "path", - "expression": "[path]" - }, - "spec": [ - { - "type": "text", - "text": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved." - } - ], - "required": false, - "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure\nto call [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, - "async": false, - "alias": "recordVideoDir" - }, - { - "kind": "property", - "langs": { - "only": [ - "csharp", - "java", - "python" - ], - "aliases": { - "python": "record_video_size" - }, - "types": {}, - "overrides": {} - }, - "name": "recordVideoSize", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame width." - } - ], - "required": true, - "comment": "Video frame width.", - "deprecated": false, + "comment": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", "async": false, - "alias": "width" + "alias": "bypass", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame height." - } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" - } - ], - "expression": "[Object]" - }, - "spec": [ - { - "type": "text", - "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size." - } - ], - "required": false, - "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will\nbe scaled down if necessary to fit the specified size.", - "deprecated": false, - "async": false, - "alias": "recordVideoSize" - }, - { - "kind": "property", - "langs": { - "aliases": { - "java": "screenSize", - "csharp": "screenSize" - }, - "types": {}, - "overrides": {} - }, - "name": "screen", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", + "experimental": false, + "since": "v1.0", + "name": "username", "type": { - "name": "int", - "expression": "[int]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "page width in pixels." + "text": "Optional username to use if HTTP proxy requires authentication." } ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, + "required": false, + "comment": "Optional username to use if HTTP proxy requires authentication.", "async": false, - "alias": "width" + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "height", + "experimental": false, + "since": "v1.0", + "name": "password", "type": { - "name": "int", - "expression": "[int]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "page height in pixels." + "text": "Optional password to use if HTTP proxy requires authentication." } ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, + "required": false, + "comment": "Optional password to use if HTTP proxy requires authentication.", "async": false, - "alias": "height" + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null } ], "expression": "[Object]" @@ -6481,14 +7488,15 @@ "spec": [ { "type": "text", - "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set." + "text": "Network proxy settings." } ], "required": false, - "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`\nis set.", - "deprecated": false, + "comment": "Network proxy settings.", "async": false, - "alias": "screen" + "alias": "proxy", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", @@ -6501,6 +7509,8 @@ "types": {}, "overrides": {} }, + "experimental": false, + "since": "v1.16", "name": "storageState", "type": { "name": "", @@ -6514,6 +7524,8 @@ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "cookies", "type": { "name": "Array", @@ -6524,6 +7536,8 @@ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "name", "type": { "name": "string", @@ -6537,13 +7551,16 @@ ], "required": true, "comment": "", - "deprecated": false, "async": false, - "alias": "name" + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "value", "type": { "name": "string", @@ -6557,33 +7574,16 @@ ], "required": true, "comment": "", - "deprecated": false, - "async": false, - "alias": "value" - }, - { - "kind": "property", - "langs": {}, - "name": "url", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional either url or domain / path are required" - } - ], - "required": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, "async": false, - "alias": "url" + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "domain", "type": { "name": "string", @@ -6592,18 +7592,21 @@ "spec": [ { "type": "text", - "text": "Optional either url or domain / path are required" + "text": "" } ], - "required": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "domain" + "alias": "domain", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "path", "type": { "name": "string", @@ -6612,18 +7615,21 @@ "spec": [ { "type": "text", - "text": "Optional either url or domain / path are required" + "text": "" } ], - "required": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "path" + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "expires", "type": { "name": "float", @@ -6632,18 +7638,21 @@ "spec": [ { "type": "text", - "text": "Optional Unix time in seconds." + "text": "Unix time in seconds." } ], - "required": false, - "comment": "Optional Unix time in seconds.", - "deprecated": false, + "required": true, + "comment": "Unix time in seconds.", "async": false, - "alias": "expires" + "alias": "expires", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "httpOnly", "type": { "name": "boolean", @@ -6652,18 +7661,21 @@ "spec": [ { "type": "text", - "text": "Optional httpOnly flag" + "text": "" } ], - "required": false, - "comment": "Optional httpOnly flag", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "httpOnly" + "alias": "httpOnly", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "secure", "type": { "name": "boolean", @@ -6672,18 +7684,21 @@ "spec": [ { "type": "text", - "text": "Optional secure flag" + "text": "" } ], - "required": false, - "comment": "Optional secure flag", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "secure" + "alias": "secure", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "sameSite", "type": { "name": "SameSiteAttribute", @@ -6703,14 +7718,15 @@ "spec": [ { "type": "text", - "text": "Optional sameSite flag" + "text": "" } ], - "required": false, - "comment": "Optional sameSite flag", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "sameSite" + "alias": "sameSite", + "overloadIndex": 0, + "paramOrOption": null } ] } @@ -6720,18 +7736,21 @@ "spec": [ { "type": "text", - "text": "Optional cookies to set for context" + "text": "" } ], - "required": false, - "comment": "Optional cookies to set for context", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "cookies" + "alias": "cookies", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "origins", "type": { "name": "Array", @@ -6742,6 +7761,8 @@ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "origin", "type": { "name": "string", @@ -6755,13 +7776,16 @@ ], "required": true, "comment": "", - "deprecated": false, "async": false, - "alias": "origin" + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "localStorage", "type": { "name": "Array", @@ -6772,6 +7796,8 @@ { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "name", "type": { "name": "string", @@ -6785,13 +7811,16 @@ ], "required": true, "comment": "", - "deprecated": false, "async": false, - "alias": "name" + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "value", "type": { "name": "string", @@ -6805,9 +7834,10 @@ ], "required": true, "comment": "", - "deprecated": false, "async": false, - "alias": "value" + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null } ] } @@ -6822,9 +7852,10 @@ ], "required": true, "comment": "", - "deprecated": false, "async": false, - "alias": "localStorage" + "alias": "localStorage", + "overloadIndex": 0, + "paramOrOption": null } ] } @@ -6834,14 +7865,15 @@ "spec": [ { "type": "text", - "text": "Optional localStorage to set for context" + "text": "" } ], - "required": false, - "comment": "Optional localStorage to set for context", - "deprecated": false, + "required": true, + "comment": "", "async": false, - "alias": "origins" + "alias": "origins", + "overloadIndex": 0, + "paramOrOption": null } ] } @@ -6851,26 +7883,29 @@ "spec": [ { "type": "text", - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with the following fields:" + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`]. Either a path to the↵file with saved storage, or the value returned by one of [`method: BrowserContext.storageState`] or↵[`method: APIRequestContext.storageState`] methods." } ], "required": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with\nthe following fields:", - "deprecated": false, + "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`].\nEither a path to the file with saved storage, or the value returned by one of\n[`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`] methods.", "async": false, - "alias": "storageState" + "alias": "storageState", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "csharp", - "java" + "java", + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, + "experimental": false, + "since": "v1.16", "name": "storageState", "type": { "name": "string", @@ -6879,14 +7914,15 @@ "spec": [ { "type": "text", - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]." + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`]. Either a path to the↵file with saved storage, or the value returned by one of [`method: BrowserContext.storageState`] or↵[`method: APIRequestContext.storageState`] methods." } ], "required": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`].", - "deprecated": false, + "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`].\nEither a path to the file with saved storage, or the value returned by one of\n[`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`] methods.", "async": false, - "alias": "storageState" + "alias": "storageState", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", @@ -6899,6 +7935,8 @@ "types": {}, "overrides": {} }, + "experimental": false, + "since": "v1.18", "name": "storageStatePath", "type": { "name": "path", @@ -6907,38 +7945,44 @@ "spec": [ { "type": "text", - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state." + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state." } ], "required": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", - "deprecated": false, + "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", "async": false, - "alias": "storageStatePath" + "alias": "storageStatePath", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "timezoneId", + "experimental": false, + "since": "v1.16", + "name": "timeout", "type": { - "name": "string", - "expression": "[string]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs." + "text": "Maximum time in milliseconds to wait for the response. Defaults to↵`30000` (30 seconds). Pass `0` to disable timeout." } ], "required": false, - "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs.", - "deprecated": false, + "comment": "Maximum time in milliseconds to wait for the response. Defaults to `30000` (30 seconds). Pass `0` to disable\ntimeout.", "async": false, - "alias": "timezoneId" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.16", "name": "userAgent", "type": { "name": "string", @@ -6952,185 +7996,398 @@ ], "required": false, "comment": "Specific user agent to use in this context.", - "deprecated": false, "async": false, - "alias": "userAgent" - }, + "alias": "userAgent", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + }, + { + "name": "APIRequestContext", + "spec": [ + { + "type": "text", + "text": "This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services, prepare↵environment or the service to your e2e test." + }, + { + "type": "text", + "text": "Each Playwright browser context has associated with it `APIRequestContext` instance which shares cookie storage with↵the browser context and can be accessed via [`property: BrowserContext.request`] or [`property: Page.request`].↵It is also possible to create a new APIRequestContext instance manually by calling [`method: APIRequest.newContext`]." + }, + { + "type": "text", + "text": "**Cookie management**" + }, + { + "type": "text", + "text": "`APIRequestContext` returned by [`property: BrowserContext.request`] and [`property: Page.request`] shares cookie↵storage with the corresponding `BrowserContext`. Each API request will have `Cookie` header populated with the↵values from the browser context. If the API response contains `Set-Cookie` header it will automatically update↵`BrowserContext` cookies and requests made from the page will pick them up. This means that if you log in using↵this API, your e2e test will be logged in and vice versa." + }, + { + "type": "text", + "text": "If you want API requests to not interfere with the browser cookies you should create a new `APIRequestContext` by↵calling [`method: APIRequest.newContext`]. Such `APIRequestContext` object will have its own isolated cookie↵storage." + }, + { + "type": "code", + "lines": [ + "import os", + "import asyncio", + "from playwright.async_api import async_playwright, Playwright", + "", + "REPO = \"test-repo-1\"", + "USER = \"github-username\"", + "API_TOKEN = os.getenv(\"GITHUB_API_TOKEN\")", + "", + "async def run(playwright: Playwright):", + " # This will launch a new browser, create a context and page. When making HTTP", + " # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)", + " # it will automatically set the cookies to the browser page and vice versa.", + " browser = await playwright.chromium.launch()", + " context = await browser.new_context(base_url=\"https://api.github.com\")", + " api_request_context = context.request", + " page = await context.new_page()", + "", + " # Alternatively you can create a APIRequestContext manually without having a browser context attached:", + " # api_request_context = await playwright.request.new_context(base_url=\"https://api.github.com\")", + "", + " # Create a repository.", + " response = await api_request_context.post(", + " \"/user/repos\",", + " headers={", + " \"Accept\": \"application/vnd.github.v3+json\",", + " # Add GitHub personal access token.", + " \"Authorization\": f\"token {API_TOKEN}\",", + " },", + " data={\"name\": REPO},", + " )", + " assert response.ok", + " assert response.json()[\"name\"] == REPO", + "", + " # Delete a repository.", + " response = await api_request_context.delete(", + " f\"/repos/{USER}/{REPO}\",", + " headers={", + " \"Accept\": \"application/vnd.github.v3+json\",", + " # Add GitHub personal access token.", + " \"Authorization\": f\"token {API_TOKEN}\",", + " },", + " )", + " assert response.ok", + " assert await response.body() == '{\"status\": \"ok\"}'", + "", + "async def main():", + " async with async_playwright() as playwright:", + " await run(playwright)", + "", + "asyncio.run(main())" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "import os", + "from playwright.sync_api import sync_playwright", + "", + "REPO = \"test-repo-1\"", + "USER = \"github-username\"", + "API_TOKEN = os.getenv(\"GITHUB_API_TOKEN\")", + "", + "with sync_playwright() as p:", + " # This will launch a new browser, create a context and page. When making HTTP", + " # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)", + " # it will automatically set the cookies to the browser page and vice versa.", + " browser = p.chromium.launch()", + " context = browser.new_context(base_url=\"https://api.github.com\")", + " api_request_context = context.request", + " page = context.new_page()", + "", + " # Alternatively you can create a APIRequestContext manually without having a browser context attached:", + " # api_request_context = p.request.new_context(base_url=\"https://api.github.com\")", + "", + "", + " # Create a repository.", + " response = api_request_context.post(", + " \"/user/repos\",", + " headers={", + " \"Accept\": \"application/vnd.github.v3+json\",", + " # Add GitHub personal access token.", + " \"Authorization\": f\"token {API_TOKEN}\",", + " },", + " data={\"name\": REPO},", + " )", + " assert response.ok", + " assert response.json()[\"name\"] == REPO", + "", + " # Delete a repository.", + " response = api_request_context.delete(", + " f\"/repos/{USER}/{REPO}\",", + " headers={", + " \"Accept\": \"application/vnd.github.v3+json\",", + " # Add GitHub personal access token.", + " \"Authorization\": f\"token {API_TOKEN}\",", + " },", + " )", + " assert response.ok", + " assert await response.body() == '{\"status\": \"ok\"}'" + ], + "codeLang": "python sync" + } + ], + "langs": {}, + "comment": "This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services,\nprepare environment or the service to your e2e test.\n\nEach Playwright browser context has associated with it `APIRequestContext` instance which shares cookie storage\nwith the browser context and can be accessed via [`property: BrowserContext.request`] or\n[`property: Page.request`]. It is also possible to create a new APIRequestContext instance manually by calling\n[`method: APIRequest.newContext`].\n\n**Cookie management**\n\n`APIRequestContext` returned by [`property: BrowserContext.request`] and [`property: Page.request`] shares cookie\nstorage with the corresponding `BrowserContext`. Each API request will have `Cookie` header populated with the\nvalues from the browser context. If the API response contains `Set-Cookie` header it will automatically update\n`BrowserContext` cookies and requests made from the page will pick them up. This means that if you log in using\nthis API, your e2e test will be logged in and vice versa.\n\nIf you want API requests to not interfere with the browser cookies you should create a new `APIRequestContext` by\ncalling [`method: APIRequest.newContext`]. Such `APIRequestContext` object will have its own isolated cookie\nstorage.\n\n```py\nimport os\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nREPO = \"test-repo-1\"\nUSER = \"github-username\"\nAPI_TOKEN = os.getenv(\"GITHUB_API_TOKEN\")\n\nasync def run(playwright: Playwright):\n # This will launch a new browser, create a context and page. When making HTTP\n # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)\n # it will automatically set the cookies to the browser page and vice versa.\n browser = await playwright.chromium.launch()\n context = await browser.new_context(base_url=\"https://api.github.com\")\n api_request_context = context.request\n page = await context.new_page()\n\n # Alternatively you can create a APIRequestContext manually without having a browser context attached:\n # api_request_context = await playwright.request.new_context(base_url=\"https://api.github.com\")\n\n # Create a repository.\n response = await api_request_context.post(\n \"/user/repos\",\n headers={\n \"Accept\": \"application/vnd.github.v3+json\",\n # Add GitHub personal access token.\n \"Authorization\": f\"token {API_TOKEN}\",\n },\n data={\"name\": REPO},\n )\n assert response.ok\n assert response.json()[\"name\"] == REPO\n\n # Delete a repository.\n response = await api_request_context.delete(\n f\"/repos/{USER}/{REPO}\",\n headers={\n \"Accept\": \"application/vnd.github.v3+json\",\n # Add GitHub personal access token.\n \"Authorization\": f\"token {API_TOKEN}\",\n },\n )\n assert response.ok\n assert await response.body() == '{\"status\": \"ok\"}'\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\n\nasyncio.run(main())\n```\n\n```py\nimport os\nfrom playwright.sync_api import sync_playwright\n\nREPO = \"test-repo-1\"\nUSER = \"github-username\"\nAPI_TOKEN = os.getenv(\"GITHUB_API_TOKEN\")\n\nwith sync_playwright() as p:\n # This will launch a new browser, create a context and page. When making HTTP\n # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)\n # it will automatically set the cookies to the browser page and vice versa.\n browser = p.chromium.launch()\n context = browser.new_context(base_url=\"https://api.github.com\")\n api_request_context = context.request\n page = context.new_page()\n\n # Alternatively you can create a APIRequestContext manually without having a browser context attached:\n # api_request_context = p.request.new_context(base_url=\"https://api.github.com\")\n\n\n # Create a repository.\n response = api_request_context.post(\n \"/user/repos\",\n headers={\n \"Accept\": \"application/vnd.github.v3+json\",\n # Add GitHub personal access token.\n \"Authorization\": f\"token {API_TOKEN}\",\n },\n data={\"name\": REPO},\n )\n assert response.ok\n assert response.json()[\"name\"] == REPO\n\n # Delete a repository.\n response = api_request_context.delete(\n f\"/repos/{USER}/{REPO}\",\n headers={\n \"Accept\": \"application/vnd.github.v3+json\",\n # Add GitHub personal access token.\n \"Authorization\": f\"token {API_TOKEN}\",\n },\n )\n assert response.ok\n assert await response.body() == '{\"status\": \"ok\"}'\n```\n", + "since": "v1.16", + "members": [ + { + "kind": "method", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.23", + "name": "createFormData", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Creates a new `FormData` instance which is used for providing form and multipart data when making HTTP requests." + } + ], + "required": true, + "comment": "Creates a new `FormData` instance which is used for providing form and multipart data when making HTTP requests.", + "async": false, + "alias": "createFormData", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "delete", + "type": { + "name": "APIResponse", + "expression": "[APIResponse]" + }, + "spec": [ + { + "type": "text", + "text": "Sends HTTP(S) [DELETE](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects." + } + ], + "required": true, + "comment": "Sends HTTP(S) [DELETE](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.", + "async": true, + "alias": "delete", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Target URL." + } + ], + "required": true, + "comment": "Target URL.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.18", + "name": "params", + "type": { + "name": "RequestOptions", + "expression": "[RequestOptions]" + }, + "spec": [ + { + "type": "text", + "text": "Optional request parameters." + } + ], + "required": false, + "comment": "Optional request parameters.", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ { "kind": "property", "langs": { "only": [ - "js" + "js", + "python", + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "videoSize", + "experimental": false, + "since": "v1.17", + "name": "data", "type": { - "name": "Object", - "properties": [ + "name": "", + "union": [ { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame width." - } - ], - "required": true, - "comment": "Video frame width.", - "deprecated": false, - "async": false, - "alias": "width" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame height." - } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" + "name": "Buffer" + }, + { + "name": "Serializable" } ], - "expression": "[Object]" + "expression": "[string]|[Buffer]|[Serializable]" }, "spec": [ { "type": "text", - "text": "**DEPRECATED** Use `recordVideo` instead." + "text": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set." } ], "required": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, + "comment": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.", "async": false, - "alias": "videoSize" + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js" + "js", + "python", + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "videosPath", + "experimental": false, + "since": "v1.16", + "name": "failOnStatusCode", "type": { - "name": "path", - "expression": "[path]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "**DEPRECATED** Use `recordVideo` instead." + "text": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes." } ], "required": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, + "comment": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.", "async": false, - "alias": "videosPath" + "alias": "failOnStatusCode", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ "js", - "java" + "python" ], - "aliases": { - "java": "viewportSize" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "viewport", + "experimental": false, + "since": "v1.17", + "name": "form", "type": { - "name": "", - "union": [ + "name": "Object", + "templates": [ { - "name": "null" + "name": "string" }, { - "name": "Object", - "properties": [ + "name": "", + "union": [ { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page height in pixels." - } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" + "name": "float" + }, + { + "name": "boolean" } ] } ], - "expression": "[null]|[Object]" + "expression": "[Object]<[string], [string]|[float]|[boolean]>" }, "spec": [ { "type": "text", - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport." + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." } ], "required": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "deprecated": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.", "async": false, - "alias": "viewport" + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", @@ -7138,221 +8395,89 @@ "only": [ "csharp" ], - "aliases": { - "csharp": "viewportSize" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "viewport", + "experimental": false, + "since": "v1.17", + "name": "form", "type": { - "name": "", - "union": [ - { - "name": "null" - }, - { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" - }, - { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page height in pixels." - } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" - } - ] - } - ], - "expression": "[null]|[Object]" + "name": "FormData", + "expression": "[FormData]" }, "spec": [ { "type": "text", - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the default viewport." + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." } ], "required": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable\nthe default viewport.", - "deprecated": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", "async": false, - "alias": "viewport" + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "python" + "js", + "python", + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "viewport", + "experimental": false, + "since": "v1.16", + "name": "headers", "type": { - "name": "", - "union": [ - { - "name": "null" + "name": "Object", + "templates": [ + { + "name": "string" }, { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" - }, - { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page height in pixels." - } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" - } - ] + "name": "string" } ], - "expression": "[null]|[Object]" - }, - "spec": [ - { - "type": "text", - "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport." - } - ], - "required": false, - "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "deprecated": false, - "async": false, - "alias": "viewport" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" - } - ] - }, - { - "kind": "method", - "langs": {}, - "name": "newPage", - "type": { - "name": "Page", - "expression": "[Page]" - }, - "spec": [ - { - "type": "text", - "text": "Creates a new page in a new browser context. Closing this page will close the context as well." - }, - { - "type": "text", - "text": "This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and testing frameworks should explicitly create [`method: Browser.newContext`] followed by the [`method: BrowserContext.newPage`] to control their exact life times." - } - ], - "required": true, - "comment": "Creates a new page in a new browser context. Closing this page will close the context as well.\n\nThis is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and\ntesting frameworks should explicitly create [`method: Browser.newContext`] followed by the\n[`method: BrowserContext.newPage`] to control their exact life times.", - "deprecated": false, - "async": true, - "alias": "newPage", - "args": [ - { - "kind": "property", - "langs": {}, - "name": "options", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "acceptDownloads", - "type": { - "name": "boolean", - "expression": "[boolean]" + "expression": "[Object]<[string], [string]>" }, "spec": [ { "type": "text", - "text": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled." + "text": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it." } ], "required": false, - "comment": "Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.", - "deprecated": false, + "comment": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.", "async": false, - "alias": "acceptDownloads" + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "bypassCSP", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "ignoreHTTPSErrors", "type": { "name": "boolean", "expression": "[boolean]" @@ -7360,953 +8485,1181 @@ "spec": [ { "type": "text", - "text": "Toggles bypassing page's Content-Security-Policy." + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." } ], "required": false, - "comment": "Toggles bypassing page's Content-Security-Policy.", - "deprecated": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", "async": false, - "alias": "bypassCSP" + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "colorScheme", - "type": { - "name": "ColorScheme", - "union": [ - { - "name": "\"light\"" - }, - { - "name": "\"dark\"" - }, - { - "name": "\"no-preference\"" - } + "langs": { + "only": [ + "js", + "python", + "csharp" ], - "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">" + "aliases": {}, + "types": {}, + "overrides": {} }, - "spec": [ - { - "type": "text", - "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Defaults to `'light'`." - } - ], - "required": false, - "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Defaults to `'light'`.", - "deprecated": false, - "async": false, - "alias": "colorScheme" - }, - { - "kind": "property", - "langs": {}, - "name": "deviceScaleFactor", + "experimental": false, + "since": "v1.26", + "name": "maxRedirects", "type": { - "name": "float", - "expression": "[float]" + "name": "int", + "expression": "[int]" }, "spec": [ { "type": "text", - "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`." + "text": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects." } ], "required": false, - "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`.", - "deprecated": false, + "comment": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.", "async": false, - "alias": "deviceScaleFactor" + "alias": "maxRedirects", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "extraHTTPHeaders", - "type": { - "name": "Object", - "templates": [ - { - "name": "string" - }, - { - "name": "string" - } + "langs": { + "only": [ + "js", + "python" ], - "expression": "[Object]<[string], [string]>" + "aliases": {}, + "types": {}, + "overrides": {} }, - "spec": [ - { - "type": "text", - "text": "An object containing additional HTTP headers to be sent with every request. All header values must be strings." - } - ], - "required": false, - "comment": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", - "deprecated": false, - "async": false, - "alias": "extraHTTPHeaders" - }, - { - "kind": "property", - "langs": {}, - "name": "geolocation", + "experimental": false, + "since": "v1.17", + "name": "multipart", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "latitude", + "experimental": false, + "since": "v1.0", + "name": "name", "type": { - "name": "float", - "expression": "[float]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Latitude between -90 and 90." + "text": "File name" } ], "required": true, - "comment": "Latitude between -90 and 90.", - "deprecated": false, + "comment": "File name", "async": false, - "alias": "latitude" + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "longitude", + "experimental": false, + "since": "v1.0", + "name": "mimeType", "type": { - "name": "float", - "expression": "[float]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Longitude between -180 and 180." + "text": "File type" } ], "required": true, - "comment": "Longitude between -180 and 180.", - "deprecated": false, + "comment": "File type", "async": false, - "alias": "longitude" + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "accuracy", + "experimental": false, + "since": "v1.0", + "name": "buffer", "type": { - "name": "float", - "expression": "[float]" + "name": "Buffer", + "expression": "[Buffer]" }, "spec": [ { "type": "text", - "text": "Non-negative accuracy value. Defaults to `0`." + "text": "File content" } ], - "required": false, - "comment": "Non-negative accuracy value. Defaults to `0`.", - "deprecated": false, + "required": true, + "comment": "File content", "async": false, - "alias": "accuracy" + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null } ], - "expression": "[Object]" - }, - "spec": [], - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "geolocation" - }, - { - "kind": "property", - "langs": {}, - "name": "hasTouch", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Specifies if viewport supports touch events. Defaults to false." - } - ], - "required": false, - "comment": "Specifies if viewport supports touch events. Defaults to false.", - "deprecated": false, - "async": false, - "alias": "hasTouch" - }, - { - "kind": "property", - "langs": {}, - "name": "httpCredentials", - "type": { - "name": "Object", - "properties": [ + "templates": [ { - "kind": "property", - "langs": {}, - "name": "username", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "username" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "password", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ + "name": "", + "union": [ { - "type": "text", - "text": "" + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + }, + { + "name": "ReadStream" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ] } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "password" + ] } ], - "expression": "[Object]" - }, - "spec": [ - { - "type": "text", - "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)." - } - ], - "required": false, - "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).", - "deprecated": false, - "async": false, - "alias": "httpCredentials" - }, - { - "kind": "property", - "langs": {}, - "name": "ignoreHTTPSErrors", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Whether to ignore HTTPS errors during navigation. Defaults to `false`." - } - ], - "required": false, - "comment": "Whether to ignore HTTPS errors during navigation. Defaults to `false`.", - "deprecated": false, - "async": false, - "alias": "ignoreHTTPSErrors" - }, - { - "kind": "property", - "langs": {}, - "name": "isMobile", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox." - } - ], - "required": false, - "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported\nin Firefox.", - "deprecated": false, - "async": false, - "alias": "isMobile" - }, - { - "kind": "property", - "langs": {}, - "name": "javaScriptEnabled", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Whether or not to enable JavaScript in the context. Defaults to `true`." - } - ], - "required": false, - "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`.", - "deprecated": false, - "async": false, - "alias": "javaScriptEnabled" - }, - { - "kind": "property", - "langs": {}, - "name": "locale", - "type": { - "name": "string", - "expression": "[string]" + "expression": "[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>" }, "spec": [ { "type": "text", - "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules." + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." } ], "required": false, - "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`\nrequest header value as well as number and date formatting rules.", - "deprecated": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.", "async": false, - "alias": "locale" + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js" + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "logger", + "experimental": false, + "since": "v1.17", + "name": "multipart", "type": { - "name": "Logger", - "expression": "[Logger]" + "name": "FormData", + "expression": "[FormData]" }, "spec": [ { "type": "text", - "text": "Logger sink for Playwright logging." + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." } ], "required": false, - "comment": "Logger sink for Playwright logging.", - "deprecated": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", "async": false, - "alias": "logger" + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ + "js", "python" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "noViewport", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Does not enforce fixed viewport, allows resizing window in the headed mode." - } - ], - "required": false, - "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", - "deprecated": false, - "async": false, - "alias": "noViewport" - }, - { - "kind": "property", - "langs": {}, - "name": "offline", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Whether to emulate network being offline. Defaults to `false`." - } - ], - "required": false, - "comment": "Whether to emulate network being offline. Defaults to `false`.", - "deprecated": false, - "async": false, - "alias": "offline" - }, - { - "kind": "property", - "langs": {}, - "name": "permissions", + "experimental": false, + "since": "v1.16", + "name": "params", "type": { - "name": "Array", + "name": "Object", "templates": [ { "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] } ], - "expression": "[Array]<[string]>" + "expression": "[Object]<[string], [string]|[float]|[boolean]>" }, "spec": [ { "type": "text", - "text": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more details." + "text": "Query parameters to be sent with the URL." } ], "required": false, - "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more\ndetails.", - "deprecated": false, + "comment": "Query parameters to be sent with the URL.", "async": false, - "alias": "permissions" + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "proxy", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", "type": { "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "server", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy." - } - ], - "required": true, - "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", - "deprecated": false, - "async": false, - "alias": "server" - }, - { - "kind": "property", - "langs": {}, - "name": "bypass", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`." - } - ], - "required": false, - "comment": "Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", - "deprecated": false, - "async": false, - "alias": "bypass" - }, + "templates": [ { - "kind": "property", - "langs": {}, - "name": "username", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional username to use if HTTP proxy requires authentication." - } - ], - "required": false, - "comment": "Optional username to use if HTTP proxy requires authentication.", - "deprecated": false, - "async": false, - "alias": "username" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "password", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional password to use if HTTP proxy requires authentication." - } - ], - "required": false, - "comment": "Optional password to use if HTTP proxy requires authentication.", - "deprecated": false, - "async": false, - "alias": "password" + "name": "Serializable" } ], - "expression": "[Object]" + "expression": "[Object]<[string], [Serializable]>" }, "spec": [ { "type": "text", - "text": "Network proxy settings to use with this context." - }, - { - "type": "note", - "noteType": "note", - "text": "For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: { server: 'http://per-context' } })`." + "text": "Query parameters to be sent with the URL." } ], "required": false, - "comment": "Network proxy settings to use with this context.\n\n> NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all\ncontexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: {\nserver: 'http://per-context' } })`.", - "deprecated": false, + "comment": "Query parameters to be sent with the URL.", "async": false, - "alias": "proxy" + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js" + "js", + "python", + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "recordHar", + "experimental": false, + "since": "v1.16", + "name": "timeout", "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "omitContent", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." - } - ], - "required": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, - "async": false, - "alias": "omitContent" - }, - { - "kind": "property", - "langs": {}, - "name": "path", - "type": { - "name": "path", - "expression": "[path]" - }, - "spec": [ - { - "type": "text", - "text": "Path on the filesystem to write the HAR file to." - } - ], - "required": true, - "comment": "Path on the filesystem to write the HAR file to.", - "deprecated": false, - "async": false, - "alias": "path" - } - ], - "expression": "[Object]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved." + "text": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout." } ], "required": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not\nspecified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.", - "deprecated": false, + "comment": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", "async": false, - "alias": "recordHar" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "dispose", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "All responses returned by [`method: APIRequestContext.get`] and similar methods are stored in the memory, so that you can later call [`method: APIResponse.body`]. This method↵discards all stored responses, and makes [`method: APIResponse.body`] throw \"Response disposed\" error." + } + ], + "required": true, + "comment": "All responses returned by [`method: APIRequestContext.get`] and similar methods are stored in the memory, so that\nyou can later call [`method: APIResponse.body`]. This method discards all stored responses, and makes\n[`method: APIResponse.body`] throw \"Response disposed\" error.", + "async": true, + "alias": "dispose", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "fetch", + "type": { + "name": "APIResponse", + "expression": "[APIResponse]" + }, + "spec": [ + { + "type": "text", + "text": "Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects. JSON objects can be passed directly to the request." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "await request.fetch('https://example.com/api/createBook', {", + " method: 'post',", + " data: {", + " title: 'Book Title',", + " author: 'John Doe',", + " }", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "Map data = new HashMap();", + "data.put(\"title\", \"Book Title\");", + "data.put(\"body\", \"John Doe\");", + "request.fetch(\"https://example.com/api/createBook\", RequestOptions.create().setMethod(\"post\").setData(data));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "data = {", + " \"title\": \"Book Title\",", + " \"body\": \"John Doe\",", + "}", + "api_request_context.fetch(\"https://example.com/api/createBook\", method=\"post\", data=data)" + ], + "codeLang": "python" + }, + { + "type": "code", + "lines": [ + "var data = new Dictionary() {", + " { \"title\", \"Book Title\" },", + " { \"body\", \"John Doe\" }", + "};", + "await Request.FetchAsync(\"https://example.com/api/createBook\", new() { Method = \"post\", DataObject = data });" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "The common way to send file(s) in the body of a request is to encode it as form fields with `multipart/form-data` encoding. You can achieve that with Playwright API like this:" + }, + { + "type": "code", + "lines": [ + "// Open file as a stream and pass it to the request:", + "const stream = fs.createReadStream('team.csv');", + "await request.fetch('https://example.com/api/uploadTeamList', {", + " method: 'post',", + " multipart: {", + " fileField: stream", + " }", + "});", + "", + "// Or you can pass the file content directly as an object:", + "await request.fetch('https://example.com/api/uploadScript', {", + " method: 'post',", + " multipart: {", + " fileField: {", + " name: 'f.js',", + " mimeType: 'text/javascript',", + " buffer: Buffer.from('console.log(2022);')", + " }", + " }", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "// Pass file path to the form data constructor:", + "Path file = Paths.get(\"team.csv\");", + "APIResponse response = request.fetch(\"https://example.com/api/uploadTeamList\",", + " RequestOptions.create().setMethod(\"post\").setMultipart(", + " FormData.create().set(\"fileField\", file)));", + "", + "// Or you can pass the file content directly as FilePayload object:", + "FilePayload filePayload = new FilePayload(\"f.js\", \"text/javascript\",", + " \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));", + "APIResponse response = request.fetch(\"https://example.com/api/uploadTeamList\",", + " RequestOptions.create().setMethod(\"post\").setMultipart(", + " FormData.create().set(\"fileField\", filePayload)));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "api_request_context.fetch(", + " \"https://example.com/api/uploadScrip'\",", + " method=\"post\",", + " multipart={", + " \"fileField\": {", + " \"name\": \"f.js\",", + " \"mimeType\": \"text/javascript\",", + " \"buffer\": b\"console.log(2022);\",", + " },", + " })" + ], + "codeLang": "python" + }, + { + "type": "code", + "lines": [ + "var file = new FilePayload()", + "{", + " Name = \"f.js\",", + " MimeType = \"text/javascript\",", + " Buffer = System.Text.Encoding.UTF8.GetBytes(\"console.log(2022);\")", + "};", + "var multipart = Context.APIRequest.CreateFormData();", + "multipart.Set(\"fileField\", file);", + "await Request.FetchAsync(\"https://example.com/api/uploadScript\", new() { Method = \"post\", Multipart = multipart });" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and\nupdate context cookies from the response. The method will automatically follow redirects. JSON objects can be\npassed directly to the request.\n\n**Usage**\n\n```js\nawait request.fetch('https://example.com/api/createBook', {\n method: 'post',\n data: {\n title: 'Book Title',\n author: 'John Doe',\n }\n});\n```\n\n```java\nMap data = new HashMap();\ndata.put(\"title\", \"Book Title\");\ndata.put(\"body\", \"John Doe\");\nrequest.fetch(\"https://example.com/api/createBook\", RequestOptions.create().setMethod(\"post\").setData(data));\n```\n\n```python\ndata = {\n \"title\": \"Book Title\",\n \"body\": \"John Doe\",\n}\napi_request_context.fetch(\"https://example.com/api/createBook\", method=\"post\", data=data)\n```\n\n```csharp\nvar data = new Dictionary() {\n { \"title\", \"Book Title\" },\n { \"body\", \"John Doe\" }\n};\nawait Request.FetchAsync(\"https://example.com/api/createBook\", new() { Method = \"post\", DataObject = data });\n```\n\nThe common way to send file(s) in the body of a request is to encode it as form fields with `multipart/form-data`\nencoding. You can achieve that with Playwright API like this:\n\n```js\n// Open file as a stream and pass it to the request:\nconst stream = fs.createReadStream('team.csv');\nawait request.fetch('https://example.com/api/uploadTeamList', {\n method: 'post',\n multipart: {\n fileField: stream\n }\n});\n\n// Or you can pass the file content directly as an object:\nawait request.fetch('https://example.com/api/uploadScript', {\n method: 'post',\n multipart: {\n fileField: {\n name: 'f.js',\n mimeType: 'text/javascript',\n buffer: Buffer.from('console.log(2022);')\n }\n }\n});\n```\n\n```java\n// Pass file path to the form data constructor:\nPath file = Paths.get(\"team.csv\");\nAPIResponse response = request.fetch(\"https://example.com/api/uploadTeamList\",\n RequestOptions.create().setMethod(\"post\").setMultipart(\n FormData.create().set(\"fileField\", file)));\n\n// Or you can pass the file content directly as FilePayload object:\nFilePayload filePayload = new FilePayload(\"f.js\", \"text/javascript\",\n \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));\nAPIResponse response = request.fetch(\"https://example.com/api/uploadTeamList\",\n RequestOptions.create().setMethod(\"post\").setMultipart(\n FormData.create().set(\"fileField\", filePayload)));\n```\n\n```python\napi_request_context.fetch(\n \"https://example.com/api/uploadScrip'\",\n method=\"post\",\n multipart={\n \"fileField\": {\n \"name\": \"f.js\",\n \"mimeType\": \"text/javascript\",\n \"buffer\": b\"console.log(2022);\",\n },\n })\n```\n\n```csharp\nvar file = new FilePayload()\n{\n Name = \"f.js\",\n MimeType = \"text/javascript\",\n Buffer = System.Text.Encoding.UTF8.GetBytes(\"console.log(2022);\")\n};\nvar multipart = Context.APIRequest.CreateFormData();\nmultipart.Set(\"fileField\", file);\nawait Request.FetchAsync(\"https://example.com/api/uploadScript\", new() { Method = \"post\", Multipart = multipart });\n```\n", + "async": true, + "alias": "fetch", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "urlOrRequest", + "type": { + "name": "", + "union": [ + { + "name": "string" }, + { + "name": "Request" + } + ], + "expression": "[string]|[Request]" + }, + "spec": [ + { + "type": "text", + "text": "Target URL or Request to get all parameters from." + } + ], + "required": true, + "comment": "Target URL or Request to get all parameters from.", + "async": false, + "alias": "urlOrRequest", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.18", + "name": "params", + "type": { + "name": "RequestOptions", + "expression": "[RequestOptions]" + }, + "spec": [ + { + "type": "text", + "text": "Optional request parameters." + } + ], + "required": false, + "comment": "Optional request parameters.", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ { "kind": "property", "langs": { "only": [ - "csharp", - "java", - "python" + "js", + "python", + "csharp" ], - "aliases": { - "python": "record_har_omit_content" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "recordHarOmitContent", + "experimental": false, + "since": "v1.16", + "name": "data", "type": { - "name": "boolean", - "expression": "[boolean]" + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "Buffer" + }, + { + "name": "Serializable" + } + ], + "expression": "[string]|[Buffer]|[Serializable]" }, "spec": [ { "type": "text", - "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." + "text": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set." } ], "required": false, - "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", - "deprecated": false, + "comment": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.", "async": false, - "alias": "recordHarOmitContent" + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "csharp", - "java", - "python" + "js", + "python", + "csharp" ], - "aliases": { - "python": "record_har_path" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "recordHarPath", + "experimental": false, + "since": "v1.16", + "name": "failOnStatusCode", "type": { - "name": "path", - "expression": "[path]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to be saved." + "text": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes." } ], "required": false, - "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the\nfilesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`] for the HAR to\nbe saved.", - "deprecated": false, + "comment": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.", "async": false, - "alias": "recordHarPath" + "alias": "failOnStatusCode", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js" + "js", + "python" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "recordVideo", + "experimental": false, + "since": "v1.16", + "name": "form", "type": { "name": "Object", - "properties": [ + "templates": [ { - "kind": "property", - "langs": {}, - "name": "dir", - "type": { - "name": "path", - "expression": "[path]" - }, - "spec": [ - { - "type": "text", - "text": "Path to the directory to put videos into." - } - ], - "required": true, - "comment": "Path to the directory to put videos into.", - "deprecated": false, - "async": false, - "alias": "dir" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "size", - "type": { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame width." - } - ], - "required": true, - "comment": "Video frame width.", - "deprecated": false, - "async": false, - "alias": "width" - }, - { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame height." - } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" - } - ], - "expression": "[Object]" - }, - "spec": [ + "name": "", + "union": [ { - "type": "text", - "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size." + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" } - ], - "required": false, - "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit\ninto 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", - "deprecated": false, - "async": false, - "alias": "size" + ] } ], - "expression": "[Object]" + "expression": "[Object]<[string], [string]|[float]|[boolean]>" }, "spec": [ { "type": "text", - "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [`method: BrowserContext.close`] for videos to be saved." + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." } ], "required": false, - "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make\nsure to await [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.", "async": false, - "alias": "recordVideo" + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "csharp", - "java", - "python" + "csharp" ], - "aliases": { - "python": "record_video_dir" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "recordVideoDir", + "experimental": false, + "since": "v1.16", + "name": "form", "type": { - "name": "path", - "expression": "[path]" + "name": "FormData", + "expression": "[FormData]" }, "spec": [ { "type": "text", - "text": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved." + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." } ], "required": false, - "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure\nto call [`method: BrowserContext.close`] for videos to be saved.", - "deprecated": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", "async": false, - "alias": "recordVideoDir" + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "csharp", - "java", - "python" + "js", + "python", + "csharp" ], - "aliases": { - "python": "record_video_size" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "recordVideoSize", + "experimental": false, + "since": "v1.16", + "name": "headers", "type": { "name": "Object", - "properties": [ + "templates": [ { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame width." - } - ], - "required": true, - "comment": "Video frame width.", - "deprecated": false, - "async": false, - "alias": "width" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame height." - } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" + "name": "string" } ], - "expression": "[Object]" + "expression": "[Object]<[string], [string]>" }, "spec": [ { "type": "text", - "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size." + "text": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it." } ], "required": false, - "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will\nbe scaled down if necessary to fit the specified size.", - "deprecated": false, + "comment": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.", "async": false, - "alias": "recordVideoSize" + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { - "aliases": { - "java": "screenSize", - "csharp": "screenSize" - }, + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, "types": {}, "overrides": {} }, - "name": "screen", + "experimental": false, + "since": "v1.16", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "maxRedirects", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects." + } + ], + "required": false, + "comment": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.", + "async": false, + "alias": "maxRedirects", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "method", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) or↵[POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)). If not specified, GET method is used." + } + ], + "required": false, + "comment": "If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) or\n[POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)). If not specified, GET method is used.", + "async": false, + "alias": "method", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "multipart", "type": { "name": "Object", "properties": [ { "kind": "property", "langs": {}, - "name": "width", + "experimental": false, + "since": "v1.0", + "name": "name", "type": { - "name": "int", - "expression": "[int]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "page width in pixels." + "text": "File name" } ], "required": true, - "comment": "page width in pixels.", - "deprecated": false, + "comment": "File name", "async": false, - "alias": "width" + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, - "name": "height", + "experimental": false, + "since": "v1.0", + "name": "mimeType", "type": { - "name": "int", - "expression": "[int]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "page height in pixels." + "text": "File type" } ], "required": true, - "comment": "page height in pixels.", - "deprecated": false, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", "async": false, - "alias": "height" + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null } ], - "expression": "[Object]" + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + }, + { + "name": "ReadStream" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>" }, "spec": [ { "type": "text", - "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set." + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." } ], "required": false, - "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`\nis set.", - "deprecated": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.", "async": false, - "alias": "screen" + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "multipart", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", @@ -8319,2124 +9672,52145 @@ "types": {}, "overrides": {} }, - "name": "storageState", + "experimental": false, + "since": "v1.16", + "name": "params", "type": { - "name": "", - "union": [ + "name": "Object", + "templates": [ { - "name": "path" + "name": "string" }, { - "name": "Object", - "properties": [ + "name": "", + "union": [ { - "kind": "property", - "langs": {}, - "name": "cookies", - "type": { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "name", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "name" - }, - { - "kind": "property", - "langs": {}, - "name": "value", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "value" - }, - { - "kind": "property", - "langs": {}, - "name": "url", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional either url or domain / path are required" - } - ], - "required": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "async": false, - "alias": "url" - }, - { - "kind": "property", - "langs": {}, - "name": "domain", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional either url or domain / path are required" - } - ], - "required": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "async": false, - "alias": "domain" - }, - { - "kind": "property", - "langs": {}, - "name": "path", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "Optional either url or domain / path are required" - } - ], - "required": false, - "comment": "Optional either url or domain / path are required", - "deprecated": false, - "async": false, - "alias": "path" - }, - { - "kind": "property", - "langs": {}, - "name": "expires", - "type": { - "name": "float", - "expression": "[float]" - }, - "spec": [ - { - "type": "text", - "text": "Optional Unix time in seconds." - } - ], - "required": false, - "comment": "Optional Unix time in seconds.", - "deprecated": false, - "async": false, - "alias": "expires" - }, - { - "kind": "property", - "langs": {}, - "name": "httpOnly", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Optional httpOnly flag" - } - ], - "required": false, - "comment": "Optional httpOnly flag", - "deprecated": false, - "async": false, - "alias": "httpOnly" - }, - { - "kind": "property", - "langs": {}, - "name": "secure", - "type": { - "name": "boolean", - "expression": "[boolean]" - }, - "spec": [ - { - "type": "text", - "text": "Optional secure flag" - } - ], - "required": false, - "comment": "Optional secure flag", - "deprecated": false, - "async": false, - "alias": "secure" - }, - { - "kind": "property", - "langs": {}, - "name": "sameSite", - "type": { - "name": "SameSiteAttribute", - "union": [ - { - "name": "\"Strict\"" - }, - { - "name": "\"Lax\"" - }, - { - "name": "\"None\"" - } - ], - "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">" - }, - "spec": [ - { - "type": "text", - "text": "Optional sameSite flag" - } - ], - "required": false, - "comment": "Optional sameSite flag", - "deprecated": false, - "async": false, - "alias": "sameSite" - } - ] - } - ], - "expression": "[Array]<[Object]>" - }, - "spec": [ - { - "type": "text", - "text": "Optional cookies to set for context" - } - ], - "required": false, - "comment": "Optional cookies to set for context", - "deprecated": false, - "async": false, - "alias": "cookies" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "origins", - "type": { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "origin", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "origin" - }, - { - "kind": "property", - "langs": {}, - "name": "localStorage", - "type": { - "name": "Array", - "templates": [ - { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "name", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "name" - }, - { - "kind": "property", - "langs": {}, - "name": "value", - "type": { - "name": "string", - "expression": "[string]" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "value" - } - ] - } - ], - "expression": "[Array]<[Object]>" - }, - "spec": [ - { - "type": "text", - "text": "" - } - ], - "required": true, - "comment": "", - "deprecated": false, - "async": false, - "alias": "localStorage" - } - ] - } - ], - "expression": "[Array]<[Object]>" - }, - "spec": [ - { - "type": "text", - "text": "Optional localStorage to set for context" - } - ], - "required": false, - "comment": "Optional localStorage to set for context", - "deprecated": false, - "async": false, - "alias": "origins" + "name": "float" + }, + { + "name": "boolean" } ] } ], - "expression": "[path]|[Object]" + "expression": "[Object]<[string], [string]|[float]|[boolean]>" }, "spec": [ { "type": "text", - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with the following fields:" + "text": "Query parameters to be sent with the URL." } ], "required": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with\nthe following fields:", - "deprecated": false, + "comment": "Query parameters to be sent with the URL.", "async": false, - "alias": "storageState" + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "csharp", - "java" + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "storageState", + "experimental": false, + "since": "v1.16", + "name": "params", "type": { - "name": "string", - "expression": "[string]" + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "Serializable" + } + ], + "expression": "[Object]<[string], [Serializable]>" }, "spec": [ { "type": "text", - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]." + "text": "Query parameters to be sent with the URL." } ], "required": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`].", - "deprecated": false, + "comment": "Query parameters to be sent with the URL.", "async": false, - "alias": "storageState" + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "csharp", - "java" + "js", + "python", + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "storageStatePath", + "experimental": false, + "since": "v1.16", + "name": "timeout", "type": { - "name": "path", - "expression": "[path]" + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state." + "text": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout." } ], "required": false, - "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in information\nobtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", - "deprecated": false, + "comment": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", "async": false, - "alias": "storageStatePath" - }, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "get", + "type": { + "name": "APIResponse", + "expression": "[APIResponse]" + }, + "spec": [ + { + "type": "text", + "text": "Sends HTTP(S) [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "Request parameters can be configured with `params` option, they will be serialized into the URL search parameters:" + }, + { + "type": "code", + "lines": [ + "await request.get('https://example.com/api/getText', {", + " params: {", + " 'isbn': '1234',", + " 'page': 23,", + " }", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "request.get(\"https://example.com/api/getText\", RequestOptions.create()", + " .setQueryParam(\"isbn\", \"1234\")", + " .setQueryParam(\"page\", 23));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "query_params = {", + " \"isbn\": \"1234\",", + " \"page\": \"23\"", + "}", + "api_request_context.get(\"https://example.com/api/getText\", params=query_params)" + ], + "codeLang": "python" + }, + { + "type": "code", + "lines": [ + "var queryParams = new Dictionary()", + "{", + " { \"isbn\", \"1234\" },", + " { \"page\", 23 },", + "};", + "await request.GetAsync(\"https://example.com/api/getText\", new() { Params = queryParams });" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Sends HTTP(S) [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.\n\n**Usage**\n\nRequest parameters can be configured with `params` option, they will be serialized into the URL search parameters:\n\n```js\nawait request.get('https://example.com/api/getText', {\n params: {\n 'isbn': '1234',\n 'page': 23,\n }\n});\n```\n\n```java\nrequest.get(\"https://example.com/api/getText\", RequestOptions.create()\n .setQueryParam(\"isbn\", \"1234\")\n .setQueryParam(\"page\", 23));\n```\n\n```python\nquery_params = {\n \"isbn\": \"1234\",\n \"page\": \"23\"\n}\napi_request_context.get(\"https://example.com/api/getText\", params=query_params)\n```\n\n```csharp\nvar queryParams = new Dictionary()\n{\n { \"isbn\", \"1234\" },\n { \"page\", 23 },\n};\nawait request.GetAsync(\"https://example.com/api/getText\", new() { Params = queryParams });\n```\n", + "async": true, + "alias": "get", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Target URL." + } + ], + "required": true, + "comment": "Target URL.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.18", + "name": "params", + "type": { + "name": "RequestOptions", + "expression": "[RequestOptions]" + }, + "spec": [ + { + "type": "text", + "text": "Optional request parameters." + } + ], + "required": false, + "comment": "Optional request parameters.", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ { "kind": "property", - "langs": {}, - "name": "timezoneId", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "data", "type": { - "name": "string", - "expression": "[string]" + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "Buffer" + }, + { + "name": "Serializable" + } + ], + "expression": "[string]|[Buffer]|[Serializable]" }, "spec": [ { "type": "text", - "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs." + "text": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set." } ], "required": false, - "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs.", - "deprecated": false, + "comment": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.", "async": false, - "alias": "timezoneId" + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "userAgent", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "failOnStatusCode", "type": { - "name": "string", - "expression": "[string]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "Specific user agent to use in this context." + "text": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes." } ], "required": false, - "comment": "Specific user agent to use in this context.", - "deprecated": false, + "comment": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.", "async": false, - "alias": "userAgent" + "alias": "failOnStatusCode", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js" + "js", + "python" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "videoSize", + "experimental": false, + "since": "v1.26", + "name": "form", "type": { "name": "Object", - "properties": [ + "templates": [ { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "Video frame width." - } - ], - "required": true, - "comment": "Video frame width.", - "deprecated": false, - "async": false, - "alias": "width" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ + "name": "", + "union": [ { - "type": "text", - "text": "Video frame height." + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" } - ], - "required": true, - "comment": "Video frame height.", - "deprecated": false, - "async": false, - "alias": "height" + ] } ], - "expression": "[Object]" + "expression": "[Object]<[string], [string]|[float]|[boolean]>" }, "spec": [ { "type": "text", - "text": "**DEPRECATED** Use `recordVideo` instead." + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." } ], "required": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.", "async": false, - "alias": "videoSize" + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ - "js" + "csharp" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "videosPath", + "experimental": false, + "since": "v1.26", + "name": "form", "type": { - "name": "path", - "expression": "[path]" + "name": "FormData", + "expression": "[FormData]" }, "spec": [ { "type": "text", - "text": "**DEPRECATED** Use `recordVideo` instead." + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." } ], "required": false, - "comment": "**DEPRECATED** Use `recordVideo` instead.", - "deprecated": true, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", "async": false, - "alias": "videosPath" + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ "js", - "java" + "python", + "csharp" ], - "aliases": { - "java": "viewportSize" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "viewport", + "experimental": false, + "since": "v1.16", + "name": "headers", "type": { - "name": "", - "union": [ + "name": "Object", + "templates": [ { - "name": "null" + "name": "string" }, { - "name": "Object", - "properties": [ - { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" - }, - { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page height in pixels." - } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" - } - ] + "name": "string" } ], - "expression": "[null]|[Object]" + "expression": "[Object]<[string], [string]>" }, "spec": [ { "type": "text", - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport." + "text": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it." } ], "required": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.", - "deprecated": false, + "comment": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.", "async": false, - "alias": "viewport" + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ + "js", + "python", "csharp" ], - "aliases": { - "csharp": "viewportSize" - }, + "aliases": {}, "types": {}, "overrides": {} }, - "name": "viewport", + "experimental": false, + "since": "v1.16", + "name": "ignoreHTTPSErrors", "type": { - "name": "", - "union": [ + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "maxRedirects", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects." + } + ], + "required": false, + "comment": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.", + "async": false, + "alias": "maxRedirects", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "multipart", + "type": { + "name": "Object", + "properties": [ { - "name": "null" + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null }, { - "name": "Object", - "properties": [ + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ + "name": "float" + }, + { + "name": "boolean" + }, + { + "name": "ReadStream" + }, + { + "name": "Object", + "properties": [ { - "type": "text", - "text": "page height in pixels." + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" + ] } ] } ], - "expression": "[null]|[Object]" + "expression": "[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "multipart", + "type": { + "name": "FormData", + "expression": "[FormData]" }, "spec": [ { "type": "text", - "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the default viewport." + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." } ], "required": false, - "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable\nthe default viewport.", - "deprecated": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", "async": false, - "alias": "viewport" + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": { "only": [ + "js", "python" ], "aliases": {}, "types": {}, "overrides": {} }, - "name": "viewport", + "experimental": false, + "since": "v1.16", + "name": "params", "type": { - "name": "", - "union": [ + "name": "Object", + "templates": [ { - "name": "null" + "name": "string" }, { - "name": "Object", - "properties": [ + "name": "", + "union": [ { - "kind": "property", - "langs": {}, - "name": "width", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page width in pixels." - } - ], - "required": true, - "comment": "page width in pixels.", - "deprecated": false, - "async": false, - "alias": "width" + "name": "string" }, { - "kind": "property", - "langs": {}, - "name": "height", - "type": { - "name": "int", - "expression": "[int]" - }, - "spec": [ - { - "type": "text", - "text": "page height in pixels." - } - ], - "required": true, - "comment": "page height in pixels.", - "deprecated": false, - "async": false, - "alias": "height" + "name": "float" + }, + { + "name": "boolean" } ] } ], - "expression": "[null]|[Object]" + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "Serializable" + } + ], + "expression": "[Object]<[string], [Serializable]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" }, "spec": [ { "type": "text", - "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport." + "text": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout." } ], "required": false, - "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport.", - "deprecated": false, + "comment": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", "async": false, - "alias": "viewport" + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null } ] }, "required": false, "comment": "", - "deprecated": false, "async": false, - "alias": "options" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null } ] }, { "kind": "method", - "langs": { - "only": [ - "java", - "js", - "python" - ], - "aliases": {}, - "types": {}, - "overrides": {} - }, - "name": "startTracing", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "head", "type": { - "name": "void" + "name": "APIResponse", + "expression": "[APIResponse]" }, "spec": [ - { - "type": "note", - "noteType": "note", - "text": "Tracing is only supported on Chromium-based browsers." - }, { "type": "text", - "text": "You can use [`method: Browser.startTracing`] and [`method: Browser.stopTracing`] to create a trace file that can be opened in Chrome DevTools performance panel." - }, - { - "type": "code", - "lines": [ - "await browser.startTracing(page, {path: 'trace.json'});", - "await page.goto('https://www.google.com');", - "await browser.stopTracing();" - ], - "codeLang": "js" - }, - { - "type": "code", - "lines": [ - "browser.startTracing(page, new Browser.StartTracingOptions()", - " .setPath(Paths.get(\"trace.json\")));", - "page.goto('https://www.google.com');", - "browser.stopTracing();" - ], - "codeLang": "java" - }, - { - "type": "code", - "lines": [ - "await browser.start_tracing(page, path=\"trace.json\")", - "await page.goto(\"https://www.google.com\")", - "await browser.stop_tracing()" - ], - "codeLang": "python async" - }, - { - "type": "code", - "lines": [ - "browser.start_tracing(page, path=\"trace.json\")", - "page.goto(\"https://www.google.com\")", - "browser.stop_tracing()" - ], - "codeLang": "python sync" + "text": "Sends HTTP(S) [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects." } ], "required": true, - "comment": "> NOTE: Tracing is only supported on Chromium-based browsers.\n\nYou can use [`method: Browser.startTracing`] and [`method: Browser.stopTracing`] to create a trace file that can be\nopened in Chrome DevTools performance panel.\n\n```js\nawait browser.startTracing(page, {path: 'trace.json'});\nawait page.goto('https://www.google.com');\nawait browser.stopTracing();\n```\n\n```java\nbrowser.startTracing(page, new Browser.StartTracingOptions()\n .setPath(Paths.get(\"trace.json\")));\npage.goto('https://www.google.com');\nbrowser.stopTracing();\n```\n\n```python async\nawait browser.start_tracing(page, path=\"trace.json\")\nawait page.goto(\"https://www.google.com\")\nawait browser.stop_tracing()\n```\n\n```python sync\nbrowser.start_tracing(page, path=\"trace.json\")\npage.goto(\"https://www.google.com\")\nbrowser.stop_tracing()\n```\n", - "deprecated": false, + "comment": "Sends HTTP(S) [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.", "async": true, - "alias": "startTracing", + "alias": "head", + "overloadIndex": 0, + "paramOrOption": null, "args": [ { "kind": "property", "langs": {}, - "name": "page", + "experimental": false, + "since": "v1.16", + "name": "url", "type": { - "name": "Page", - "expression": "[Page]" + "name": "string", + "expression": "[string]" }, "spec": [ { "type": "text", - "text": "Optional, if specified, tracing includes screenshots of the given page." + "text": "Target URL." + } + ], + "required": true, + "comment": "Target URL.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.18", + "name": "params", + "type": { + "name": "RequestOptions", + "expression": "[RequestOptions]" + }, + "spec": [ + { + "type": "text", + "text": "Optional request parameters." } ], "required": false, - "comment": "Optional, if specified, tracing includes screenshots of the given page.", - "deprecated": false, + "comment": "Optional request parameters.", "async": false, - "alias": "page" + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", "langs": {}, + "experimental": false, + "since": "v1.0", "name": "options", "type": { "name": "Object", "properties": [ { "kind": "property", - "langs": {}, - "name": "categories", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "data", "type": { - "name": "Array", - "templates": [ + "name": "", + "union": [ { "name": "string" + }, + { + "name": "Buffer" + }, + { + "name": "Serializable" } ], - "expression": "[Array]<[string]>" + "expression": "[string]|[Buffer]|[Serializable]" }, "spec": [ { "type": "text", - "text": "specify custom categories to use instead of default." + "text": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set." } ], "required": false, - "comment": "specify custom categories to use instead of default.", - "deprecated": false, + "comment": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.", "async": false, - "alias": "categories" + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "path", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "failOnStatusCode", "type": { - "name": "path", - "expression": "[path]" + "name": "boolean", + "expression": "[boolean]" }, "spec": [ { "type": "text", - "text": "A path to write the trace file to." + "text": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes." } ], "required": false, - "comment": "A path to write the trace file to.", - "deprecated": false, + "comment": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.", "async": false, - "alias": "path" + "alias": "failOnStatusCode", + "overloadIndex": 0, + "paramOrOption": null }, { "kind": "property", - "langs": {}, - "name": "screenshots", - "type": { - "name": "boolean", - "expression": "[boolean]" + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} }, - "spec": [ - { - "type": "text", - "text": "captures screenshots in the trace." - } - ], - "required": false, - "comment": "captures screenshots in the trace.", - "deprecated": false, - "async": false, - "alias": "screenshots" - } - ] - }, - "required": false, - "comment": "", - "deprecated": false, - "async": false, - "alias": "options" + "experimental": false, + "since": "v1.26", + "name": "form", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.", + "async": false, + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "form", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "headers", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it." + } + ], + "required": false, + "comment": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.", + "async": false, + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "maxRedirects", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects." + } + ], + "required": false, + "comment": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.", + "async": false, + "alias": "maxRedirects", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "multipart", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + }, + { + "name": "ReadStream" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "multipart", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "Serializable" + } + ], + "expression": "[Object]<[string], [Serializable]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout." + } + ], + "required": false, + "comment": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "patch", + "type": { + "name": "APIResponse", + "expression": "[APIResponse]" + }, + "spec": [ + { + "type": "text", + "text": "Sends HTTP(S) [PATCH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects." + } + ], + "required": true, + "comment": "Sends HTTP(S) [PATCH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.", + "async": true, + "alias": "patch", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Target URL." + } + ], + "required": true, + "comment": "Target URL.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.18", + "name": "params", + "type": { + "name": "RequestOptions", + "expression": "[RequestOptions]" + }, + "spec": [ + { + "type": "text", + "text": "Optional request parameters." + } + ], + "required": false, + "comment": "Optional request parameters.", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "data", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "Buffer" + }, + { + "name": "Serializable" + } + ], + "expression": "[string]|[Buffer]|[Serializable]" + }, + "spec": [ + { + "type": "text", + "text": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set." + } + ], + "required": false, + "comment": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.", + "async": false, + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "failOnStatusCode", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes." + } + ], + "required": false, + "comment": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.", + "async": false, + "alias": "failOnStatusCode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "form", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.", + "async": false, + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "form", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "headers", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it." + } + ], + "required": false, + "comment": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.", + "async": false, + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "maxRedirects", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects." + } + ], + "required": false, + "comment": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.", + "async": false, + "alias": "maxRedirects", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "multipart", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + }, + { + "name": "ReadStream" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "multipart", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "Serializable" + } + ], + "expression": "[Object]<[string], [Serializable]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout." + } + ], + "required": false, + "comment": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "post", + "type": { + "name": "APIResponse", + "expression": "[APIResponse]" + }, + "spec": [ + { + "type": "text", + "text": "Sends HTTP(S) [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "JSON objects can be passed directly to the request:" + }, + { + "type": "code", + "lines": [ + "await request.post('https://example.com/api/createBook', {", + " data: {", + " title: 'Book Title',", + " author: 'John Doe',", + " }", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "Map data = new HashMap();", + "data.put(\"title\", \"Book Title\");", + "data.put(\"body\", \"John Doe\");", + "request.post(\"https://example.com/api/createBook\", RequestOptions.create().setData(data));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "data = {", + " \"title\": \"Book Title\",", + " \"body\": \"John Doe\",", + "}", + "api_request_context.post(\"https://example.com/api/createBook\", data=data)" + ], + "codeLang": "python" + }, + { + "type": "code", + "lines": [ + "var data = new Dictionary() {", + " { \"firstNam\", \"John\" },", + " { \"lastName\", \"Doe\" }", + "};", + "await request.PostAsync(\"https://example.com/api/createBook\", new() { DataObject = data });" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "To send form data to the server use `form` option. Its value will be encoded into the request body with `application/x-www-form-urlencoded` encoding (see below how to use `multipart/form-data` form encoding to send files):" + }, + { + "type": "code", + "lines": [ + "await request.post('https://example.com/api/findBook', {", + " form: {", + " title: 'Book Title',", + " author: 'John Doe',", + " }", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "request.post(\"https://example.com/api/findBook\", RequestOptions.create().setForm(", + " FormData.create().set(\"title\", \"Book Title\").set(\"body\", \"John Doe\")", + "));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "formData = {", + " \"title\": \"Book Title\",", + " \"body\": \"John Doe\",", + "}", + "api_request_context.post(\"https://example.com/api/findBook\", form=formData)" + ], + "codeLang": "python" + }, + { + "type": "code", + "lines": [ + "var formData = Context.APIRequest.CreateFormData();", + "formData.Set(\"title\", \"Book Title\");", + "formData.Set(\"body\", \"John Doe\");", + "await request.PostAsync(\"https://example.com/api/findBook\", new() { Form = formData });" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding. You can achieve that with Playwright API like this:" + }, + { + "type": "code", + "lines": [ + "// Open file as a stream and pass it to the request:", + "const stream = fs.createReadStream('team.csv');", + "await request.post('https://example.com/api/uploadTeamList', {", + " multipart: {", + " fileField: stream", + " }", + "});", + "", + "// Or you can pass the file content directly as an object:", + "await request.post('https://example.com/api/uploadScript', {", + " multipart: {", + " fileField: {", + " name: 'f.js',", + " mimeType: 'text/javascript',", + " buffer: Buffer.from('console.log(2022);')", + " }", + " }", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "// Pass file path to the form data constructor:", + "Path file = Paths.get(\"team.csv\");", + "APIResponse response = request.post(\"https://example.com/api/uploadTeamList\",", + " RequestOptions.create().setMultipart(", + " FormData.create().set(\"fileField\", file)));", + "", + "// Or you can pass the file content directly as FilePayload object:", + "FilePayload filePayload = new FilePayload(\"f.js\", \"text/javascript\",", + " \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));", + "APIResponse response = request.post(\"https://example.com/api/uploadTeamList\",", + " RequestOptions.create().setMultipart(", + " FormData.create().set(\"fileField\", filePayload)));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "api_request_context.post(", + " \"https://example.com/api/uploadScrip'\",", + " multipart={", + " \"fileField\": {", + " \"name\": \"f.js\",", + " \"mimeType\": \"text/javascript\",", + " \"buffer\": b\"console.log(2022);\",", + " },", + " })" + ], + "codeLang": "python" + }, + { + "type": "code", + "lines": [ + "var file = new FilePayload()", + "{", + " Name = \"f.js\",", + " MimeType = \"text/javascript\",", + " Buffer = System.Text.Encoding.UTF8.GetBytes(\"console.log(2022);\")", + "};", + "var multipart = Context.APIRequest.CreateFormData();", + "multipart.Set(\"fileField\", file);", + "await request.PostAsync(\"https://example.com/api/uploadScript\", new() { Multipart = multipart });" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Sends HTTP(S) [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.\n\n**Usage**\n\nJSON objects can be passed directly to the request:\n\n```js\nawait request.post('https://example.com/api/createBook', {\n data: {\n title: 'Book Title',\n author: 'John Doe',\n }\n});\n```\n\n```java\nMap data = new HashMap();\ndata.put(\"title\", \"Book Title\");\ndata.put(\"body\", \"John Doe\");\nrequest.post(\"https://example.com/api/createBook\", RequestOptions.create().setData(data));\n```\n\n```python\ndata = {\n \"title\": \"Book Title\",\n \"body\": \"John Doe\",\n}\napi_request_context.post(\"https://example.com/api/createBook\", data=data)\n```\n\n```csharp\nvar data = new Dictionary() {\n { \"firstNam\", \"John\" },\n { \"lastName\", \"Doe\" }\n};\nawait request.PostAsync(\"https://example.com/api/createBook\", new() { DataObject = data });\n```\n\nTo send form data to the server use `form` option. Its value will be encoded into the request body with\n`application/x-www-form-urlencoded` encoding (see below how to use `multipart/form-data` form encoding to send\nfiles):\n\n```js\nawait request.post('https://example.com/api/findBook', {\n form: {\n title: 'Book Title',\n author: 'John Doe',\n }\n});\n```\n\n```java\nrequest.post(\"https://example.com/api/findBook\", RequestOptions.create().setForm(\n FormData.create().set(\"title\", \"Book Title\").set(\"body\", \"John Doe\")\n));\n```\n\n```python\nformData = {\n \"title\": \"Book Title\",\n \"body\": \"John Doe\",\n}\napi_request_context.post(\"https://example.com/api/findBook\", form=formData)\n```\n\n```csharp\nvar formData = Context.APIRequest.CreateFormData();\nformData.Set(\"title\", \"Book Title\");\nformData.Set(\"body\", \"John Doe\");\nawait request.PostAsync(\"https://example.com/api/findBook\", new() { Form = formData });\n```\n\nThe common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data`\nencoding. You can achieve that with Playwright API like this:\n\n```js\n// Open file as a stream and pass it to the request:\nconst stream = fs.createReadStream('team.csv');\nawait request.post('https://example.com/api/uploadTeamList', {\n multipart: {\n fileField: stream\n }\n});\n\n// Or you can pass the file content directly as an object:\nawait request.post('https://example.com/api/uploadScript', {\n multipart: {\n fileField: {\n name: 'f.js',\n mimeType: 'text/javascript',\n buffer: Buffer.from('console.log(2022);')\n }\n }\n});\n```\n\n```java\n// Pass file path to the form data constructor:\nPath file = Paths.get(\"team.csv\");\nAPIResponse response = request.post(\"https://example.com/api/uploadTeamList\",\n RequestOptions.create().setMultipart(\n FormData.create().set(\"fileField\", file)));\n\n// Or you can pass the file content directly as FilePayload object:\nFilePayload filePayload = new FilePayload(\"f.js\", \"text/javascript\",\n \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));\nAPIResponse response = request.post(\"https://example.com/api/uploadTeamList\",\n RequestOptions.create().setMultipart(\n FormData.create().set(\"fileField\", filePayload)));\n```\n\n```python\napi_request_context.post(\n \"https://example.com/api/uploadScrip'\",\n multipart={\n \"fileField\": {\n \"name\": \"f.js\",\n \"mimeType\": \"text/javascript\",\n \"buffer\": b\"console.log(2022);\",\n },\n })\n```\n\n```csharp\nvar file = new FilePayload()\n{\n Name = \"f.js\",\n MimeType = \"text/javascript\",\n Buffer = System.Text.Encoding.UTF8.GetBytes(\"console.log(2022);\")\n};\nvar multipart = Context.APIRequest.CreateFormData();\nmultipart.Set(\"fileField\", file);\nawait request.PostAsync(\"https://example.com/api/uploadScript\", new() { Multipart = multipart });\n```\n", + "async": true, + "alias": "post", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Target URL." + } + ], + "required": true, + "comment": "Target URL.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.18", + "name": "params", + "type": { + "name": "RequestOptions", + "expression": "[RequestOptions]" + }, + "spec": [ + { + "type": "text", + "text": "Optional request parameters." + } + ], + "required": false, + "comment": "Optional request parameters.", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "data", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "Buffer" + }, + { + "name": "Serializable" + } + ], + "expression": "[string]|[Buffer]|[Serializable]" + }, + "spec": [ + { + "type": "text", + "text": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set." + } + ], + "required": false, + "comment": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.", + "async": false, + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "failOnStatusCode", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes." + } + ], + "required": false, + "comment": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.", + "async": false, + "alias": "failOnStatusCode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "form", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.", + "async": false, + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "form", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "headers", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it." + } + ], + "required": false, + "comment": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.", + "async": false, + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "maxRedirects", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects." + } + ], + "required": false, + "comment": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.", + "async": false, + "alias": "maxRedirects", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "multipart", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + }, + { + "name": "ReadStream" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "multipart", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "Serializable" + } + ], + "expression": "[Object]<[string], [Serializable]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout." + } + ], + "required": false, + "comment": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "put", + "type": { + "name": "APIResponse", + "expression": "[APIResponse]" + }, + "spec": [ + { + "type": "text", + "text": "Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects." + } + ], + "required": true, + "comment": "Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.", + "async": true, + "alias": "put", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Target URL." + } + ], + "required": true, + "comment": "Target URL.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.18", + "name": "params", + "type": { + "name": "RequestOptions", + "expression": "[RequestOptions]" + }, + "spec": [ + { + "type": "text", + "text": "Optional request parameters." + } + ], + "required": false, + "comment": "Optional request parameters.", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "data", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "Buffer" + }, + { + "name": "Serializable" + } + ], + "expression": "[string]|[Buffer]|[Serializable]" + }, + "spec": [ + { + "type": "text", + "text": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set." + } + ], + "required": false, + "comment": "Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.", + "async": false, + "alias": "data", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "failOnStatusCode", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes." + } + ], + "required": false, + "comment": "Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.", + "async": false, + "alias": "failOnStatusCode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "form", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.", + "async": false, + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "form", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "form", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "headers", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it." + } + ], + "required": false, + "comment": "Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.", + "async": false, + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.26", + "name": "maxRedirects", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects." + } + ], + "required": false, + "comment": "Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.", + "async": false, + "alias": "maxRedirects", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "multipart", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + }, + { + "name": "ReadStream" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File name" + } + ], + "required": true, + "comment": "File name", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mimeType", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "File type" + } + ], + "required": true, + "comment": "File type", + "async": false, + "alias": "mimeType", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "buffer", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "File content" + } + ], + "required": true, + "comment": "File content", + "async": false, + "alias": "buffer", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "multipart", + "type": { + "name": "FormData", + "expression": "[FormData]" + }, + "spec": [ + { + "type": "text", + "text": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content." + }, + { + "type": "text", + "text": "An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]." + } + ], + "required": false, + "comment": "Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].", + "async": false, + "alias": "multipart", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "params", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "Serializable" + } + ], + "expression": "[Object]<[string], [Serializable]>" + }, + "spec": [ + { + "type": "text", + "text": "Query parameters to be sent with the URL." + } + ], + "required": false, + "comment": "Query parameters to be sent with the URL.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout." + } + ], + "required": false, + "comment": "Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "types": { + "java": { + "name": "string", + "expression": "[string]" + }, + "csharp": { + "name": "string", + "expression": "[string]" + } + } + }, + "experimental": false, + "since": "v1.16", + "name": "storageState", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "cookies", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "domain", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "domain", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "expires", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Unix time in seconds." + } + ], + "required": true, + "comment": "Unix time in seconds.", + "async": false, + "alias": "expires", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "httpOnly", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "httpOnly", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "secure", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "secure", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "sameSite", + "type": { + "name": "SameSiteAttribute", + "union": [ + { + "name": "\"Strict\"" + }, + { + "name": "\"Lax\"" + }, + { + "name": "\"None\"" + } + ], + "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "sameSite", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "cookies", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origins", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "localStorage", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "localStorage", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "origins", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to the constructor." + } + ], + "required": true, + "comment": "Returns storage state for this request context, contains current cookies and local storage snapshot if it was\npassed to the constructor.", + "async": true, + "alias": "storageState", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to↵current working directory. If no path is provided, storage↵state is still returned, but won't be saved to the disk." + } + ], + "required": false, + "comment": "The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current\nworking directory. If no path is provided, storage state is still returned, but won't be saved to the disk.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + }, + { + "name": "APIResponse", + "spec": [ + { + "type": "text", + "text": "`APIResponse` class represents responses returned by [`method: APIRequestContext.get`] and similar methods." + }, + { + "type": "code", + "lines": [ + "import asyncio", + "from playwright.async_api import async_playwright, Playwright", + "", + "async def run(playwright: Playwright):", + " context = await playwright.request.new_context()", + " response = await context.get(\"https://example.com/user/repos\")", + " assert response.ok", + " assert response.status == 200", + " assert response.headers[\"content-type\"] == \"application/json; charset=utf-8\"", + " assert response.json()[\"name\"] == \"foobar\"", + " assert await response.body() == '{\"status\": \"ok\"}'", + "", + "", + "async def main():", + " async with async_playwright() as playwright:", + " await run(playwright)", + "", + "asyncio.run(main())" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "from playwright.sync_api import sync_playwright", + "", + "with sync_playwright() as p:", + " context = playwright.request.new_context()", + " response = context.get(\"https://example.com/user/repos\")", + " assert response.ok", + " assert response.status == 200", + " assert response.headers[\"content-type\"] == \"application/json; charset=utf-8\"", + " assert response.json()[\"name\"] == \"foobar\"", + " assert response.body() == '{\"status\": \"ok\"}'" + ], + "codeLang": "python sync" + } + ], + "langs": {}, + "comment": "`APIResponse` class represents responses returned by [`method: APIRequestContext.get`] and similar methods.\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n context = await playwright.request.new_context()\n response = await context.get(\"https://example.com/user/repos\")\n assert response.ok\n assert response.status == 200\n assert response.headers[\"content-type\"] == \"application/json; charset=utf-8\"\n assert response.json()[\"name\"] == \"foobar\"\n assert await response.body() == '{\"status\": \"ok\"}'\n\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\n\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright\n\nwith sync_playwright() as p:\n context = playwright.request.new_context()\n response = context.get(\"https://example.com/user/repos\")\n assert response.ok\n assert response.status == 200\n assert response.headers[\"content-type\"] == \"application/json; charset=utf-8\"\n assert response.json()[\"name\"] == \"foobar\"\n assert response.body() == '{\"status\": \"ok\"}'\n```\n", + "since": "v1.16", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "body", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the buffer with response body." + } + ], + "required": true, + "comment": "Returns the buffer with response body.", + "async": true, + "alias": "body", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "dispose", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Disposes the body of this response. If not called then the body will stay in memory until the context closes." + } + ], + "required": true, + "comment": "Disposes the body of this response. If not called then the body will stay in memory until the context closes.", + "async": true, + "alias": "dispose", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "headers", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "An object with all the response HTTP headers associated with this response." + } + ], + "required": true, + "comment": "An object with all the response HTTP headers associated with this response.", + "async": false, + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "headersArray", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Name of the header." + } + ], + "required": true, + "comment": "Name of the header.", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Value of the header." + } + ], + "required": true, + "comment": "Value of the header.", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "An array with all the request HTTP headers associated with this response. Header names are not lower-cased.↵Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times." + } + ], + "required": true, + "comment": "An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers\nwith multiple entries, such as `Set-Cookie`, appear in the array multiple times.", + "async": false, + "alias": "headersArray", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "json", + "type": { + "name": "Serializable", + "expression": "[Serializable]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the JSON representation of response body." + }, + { + "type": "text", + "text": "This method will throw if the response body is not parsable via `JSON.parse`." + } + ], + "required": true, + "comment": "Returns the JSON representation of response body.\n\nThis method will throw if the response body is not parsable via `JSON.parse`.", + "async": true, + "alias": "json", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "json", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "JsonElement" + } + ], + "expression": "[null]|[JsonElement]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the JSON representation of response body." + }, + { + "type": "text", + "text": "This method will throw if the response body is not parsable via `JSON.parse`." + } + ], + "required": true, + "comment": "Returns the JSON representation of response body.\n\nThis method will throw if the response body is not parsable via `JSON.parse`.", + "async": true, + "alias": "json", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "ok", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Contains a boolean stating whether the response was successful (status in the range 200-299) or not." + } + ], + "required": true, + "comment": "Contains a boolean stating whether the response was successful (status in the range 200-299) or not.", + "async": false, + "alias": "ok", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "status", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Contains the status code of the response (e.g., 200 for a success)." + } + ], + "required": true, + "comment": "Contains the status code of the response (e.g., 200 for a success).", + "async": false, + "alias": "status", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "statusText", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Contains the status text of the response (e.g. usually an \"OK\" for a success)." + } + ], + "required": true, + "comment": "Contains the status text of the response (e.g. usually an \"OK\" for a success).", + "async": false, + "alias": "statusText", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "text", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the text representation of response body." + } + ], + "required": true, + "comment": "Returns the text representation of response body.", + "async": true, + "alias": "text", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.16", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Contains the URL of the response." + } + ], + "required": true, + "comment": "Contains the URL of the response.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "APIResponseAssertions", + "spec": [ + { + "type": "text", + "text": "The `APIResponseAssertions` class provides assertion methods that can be used to make assertions about the `APIResponse` in the tests." + }, + { + "type": "code", + "lines": [ + "import { test, expect } from '@playwright/test';", + "", + "test('navigates to login', async ({ page }) => {", + " // ...", + " const response = await page.request.get('https://playwright.dev');", + " await expect(response).toBeOK();", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "...", + "import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;", + "", + "public class TestPage {", + " ...", + " @Test", + " void navigatesToLoginPage() {", + " ...", + " APIResponse response = page.request().get('https://playwright.dev');", + " assertThat(response).isOK();", + " }", + "}" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "from playwright.async_api import Page, expect", + "", + "async def test_navigates_to_login_page(page: Page) -> None:", + " # ..", + " response = await page.request.get('https://playwright.dev')", + " await expect(response).to_be_ok()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "from playwright.sync_api import Page, expect", + "", + "def test_navigates_to_login_page(page: Page) -> None:", + " # ..", + " response = page.request.get('https://playwright.dev')", + " expect(response).to_be_ok()" + ], + "codeLang": "python sync" + } + ], + "langs": {}, + "comment": "The `APIResponseAssertions` class provides assertion methods that can be used to make assertions about the\n`APIResponse` in the tests.\n\n```js\nimport { test, expect } from '@playwright/test';\n\ntest('navigates to login', async ({ page }) => {\n // ...\n const response = await page.request.get('https://playwright.dev');\n await expect(response).toBeOK();\n});\n```\n\n```java\n...\nimport static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;\n\npublic class TestPage {\n ...\n @Test\n void navigatesToLoginPage() {\n ...\n APIResponse response = page.request().get('https://playwright.dev');\n assertThat(response).isOK();\n }\n}\n```\n\n```py\nfrom playwright.async_api import Page, expect\n\nasync def test_navigates_to_login_page(page: Page) -> None:\n # ..\n response = await page.request.get('https://playwright.dev')\n await expect(response).to_be_ok()\n```\n\n```py\nfrom playwright.sync_api import Page, expect\n\ndef test_navigates_to_login_page(page: Page) -> None:\n # ..\n response = page.request.get('https://playwright.dev')\n expect(response).to_be_ok()\n```\n", + "since": "v1.18", + "members": [ + { + "kind": "property", + "langs": { + "only": [ + "java", + "js", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.20", + "name": "not", + "type": { + "name": "APIResponseAssertions", + "expression": "[APIResponseAssertions]" + }, + "spec": [ + { + "type": "text", + "text": "Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful:" + }, + { + "type": "code", + "lines": [ + "await expect(response).not.toBeOK();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "assertThat(response).not().isOK();" + ], + "codeLang": "java" + } + ], + "required": true, + "comment": "Makes the assertion check for the opposite condition. For example, this code tests that the response status is not\nsuccessful:\n\n```js\nawait expect(response).not.toBeOK();\n```\n\n```java\nassertThat(response).not().isOK();\n```\n", + "async": false, + "alias": "not", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.19", + "name": "NotToBeOK", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "The opposite of [`method: APIResponseAssertions.toBeOK`]." + } + ], + "required": true, + "comment": "The opposite of [`method: APIResponseAssertions.toBeOK`].", + "async": true, + "alias": "NotToBeOK", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "aliases": { + "java": "isOK" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.18", + "name": "toBeOK", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Ensures the response status code is within `200..299` range." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "await expect(response).toBeOK();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "assertThat(response).isOK();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "from playwright.async_api import expect", + "", + "# ...", + "await expect(response).to_be_ok()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "import re", + "from playwright.sync_api import expect", + "", + "# ...", + "expect(response).to_be_ok()" + ], + "codeLang": "python sync" + } + ], + "required": true, + "comment": "Ensures the response status code is within `200..299` range.\n\n**Usage**\n\n```js\nawait expect(response).toBeOK();\n```\n\n```java\nassertThat(response).isOK();\n```\n\n```py\nfrom playwright.async_api import expect\n\n# ...\nawait expect(response).to_be_ok()\n```\n\n```py\nimport re\nfrom playwright.sync_api import expect\n\n# ...\nexpect(response).to_be_ok()\n```\n", + "async": true, + "alias": "toBeOK", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "Browser", + "spec": [ + { + "type": "li", + "text": "extends: [EventEmitter]", + "liType": "bullet" + }, + { + "type": "text", + "text": "A Browser is created via [`method: BrowserType.launch`]. An example of using a `Browser` to create a `Page`:" + }, + { + "type": "code", + "lines": [ + "const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.", + "", + "(async () => {", + " const browser = await firefox.launch();", + " const page = await browser.newPage();", + " await page.goto('https://example.com');", + " await browser.close();", + "})();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "import com.microsoft.playwright.*;", + "", + "public class Example {", + " public static void main(String[] args) {", + " try (Playwright playwright = Playwright.create()) {", + " BrowserType firefox = playwright.firefox()", + " Browser browser = firefox.launch();", + " Page page = browser.newPage();", + " page.navigate('https://example.com');", + " browser.close();", + " }", + " }", + "}" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "import asyncio", + "from playwright.async_api import async_playwright, Playwright", + "", + "async def run(playwright: Playwright):", + " firefox = playwright.firefox", + " browser = await firefox.launch()", + " page = await browser.new_page()", + " await page.goto(\"https://example.com\")", + " await browser.close()", + "", + "async def main():", + " async with async_playwright() as playwright:", + " await run(playwright)", + "asyncio.run(main())" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "from playwright.sync_api import sync_playwright, Playwright", + "", + "def run(playwright: Playwright):", + " firefox = playwright.firefox", + " browser = firefox.launch()", + " page = browser.new_page()", + " page.goto(\"https://example.com\")", + " browser.close()", + "", + "with sync_playwright() as playwright:", + " run(playwright)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "using Microsoft.Playwright;", + "", + "using var playwright = await Playwright.CreateAsync();", + "var firefox = playwright.Firefox;", + "var browser = await firefox.LaunchAsync(new() { Headless = false });", + "var page = await browser.NewPageAsync();", + "await page.GotoAsync(\"https://www.bing.com\");", + "await browser.CloseAsync();" + ], + "codeLang": "csharp" + } + ], + "extends": "EventEmitter", + "langs": {}, + "comment": "- extends: [EventEmitter]\n\nA Browser is created via [`method: BrowserType.launch`]. An example of using a `Browser` to create a `Page`:\n\n```js\nconst { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n const browser = await firefox.launch();\n const page = await browser.newPage();\n await page.goto('https://example.com');\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType firefox = playwright.firefox()\n Browser browser = firefox.launch();\n Page page = browser.newPage();\n page.navigate('https://example.com');\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n firefox = playwright.firefox\n browser = await firefox.launch()\n page = await browser.new_page()\n await page.goto(\"https://example.com\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n firefox = playwright.firefox\n browser = firefox.launch()\n page = browser.new_page()\n page.goto(\"https://example.com\")\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\n\nusing var playwright = await Playwright.CreateAsync();\nvar firefox = playwright.Firefox;\nvar browser = await firefox.LaunchAsync(new() { Headless = false });\nvar page = await browser.NewPageAsync();\nawait page.GotoAsync(\"https://www.bing.com\");\nawait browser.CloseAsync();\n```\n", + "since": "v1.8", + "members": [ + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "disconnected", + "type": { + "name": "Browser", + "expression": "[Browser]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when Browser gets disconnected from the browser application. This might happen because of one of the following:" + }, + { + "type": "li", + "text": "Browser application is closed or crashed.", + "liType": "bullet" + }, + { + "type": "li", + "text": "The [`method: Browser.close`] method was called.", + "liType": "bullet" + } + ], + "required": true, + "comment": "Emitted when Browser gets disconnected from the browser application. This might happen because of one of the\nfollowing:\n- Browser application is closed or crashed.\n- The [`method: Browser.close`] method was called.", + "async": false, + "alias": "disconnected", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.23", + "name": "browserType", + "type": { + "name": "BrowserType", + "expression": "[BrowserType]" + }, + "spec": [ + { + "type": "text", + "text": "Get the browser type (chromium, firefox or webkit) that the browser belongs to." + } + ], + "required": true, + "comment": "Get the browser type (chromium, firefox or webkit) that the browser belongs to.", + "async": false, + "alias": "browserType", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "In case this browser is obtained using [`method: BrowserType.launch`], closes the browser and all of its pages (if any↵were opened)." + }, + { + "type": "text", + "text": "In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the↵browser server." + }, + { + "type": "note", + "noteType": "note", + "text": "This is similar to force quitting the browser. Therefore, you should call [`method: BrowserContext.close`] on any `BrowserContext`'s you explicitly created earlier with [`method: Browser.newContext`] **before** calling [`method: Browser.close`]." + }, + { + "type": "text", + "text": "The `Browser` object itself is considered to be disposed and cannot be used anymore." + } + ], + "required": true, + "comment": "In case this browser is obtained using [`method: BrowserType.launch`], closes the browser and all of its pages (if\nany were opened).\n\nIn case this browser is connected to, clears all created contexts belonging to this browser and disconnects from\nthe browser server.\n\n**NOTE** This is similar to force quitting the browser. Therefore, you should call [`method: BrowserContext.close`]\non any `BrowserContext`'s you explicitly created earlier with [`method: Browser.newContext`] **before** calling\n[`method: Browser.close`].\n\nThe `Browser` object itself is considered to be disposed and cannot be used anymore.", + "async": true, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "contexts", + "type": { + "name": "Array", + "templates": [ + { + "name": "BrowserContext" + } + ], + "expression": "[Array]<[BrowserContext]>" + }, + "spec": [ + { + "type": "text", + "text": "Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "const browser = await pw.webkit.launch();", + "console.log(browser.contexts().length); // prints `0`", + "", + "const context = await browser.newContext();", + "console.log(browser.contexts().length); // prints `1`" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "Browser browser = pw.webkit().launch();", + "System.out.println(browser.contexts().size()); // prints \"0\"", + "BrowserContext context = browser.newContext();", + "System.out.println(browser.contexts().size()); // prints \"1\"" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "browser = await pw.webkit.launch()", + "print(len(browser.contexts())) # prints `0`", + "context = await browser.new_context()", + "print(len(browser.contexts())) # prints `1`" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "browser = pw.webkit.launch()", + "print(len(browser.contexts())) # prints `0`", + "context = browser.new_context()", + "print(len(browser.contexts())) # prints `1`" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "using var playwright = await Playwright.CreateAsync();", + "var browser = await playwright.Webkit.LaunchAsync();", + "System.Console.WriteLine(browser.Contexts.Count); // prints \"0\"", + "var context = await browser.NewContextAsync();", + "System.Console.WriteLine(browser.Contexts.Count); // prints \"1\"" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts.\n\n**Usage**\n\n```js\nconst browser = await pw.webkit.launch();\nconsole.log(browser.contexts().length); // prints `0`\n\nconst context = await browser.newContext();\nconsole.log(browser.contexts().length); // prints `1`\n```\n\n```java\nBrowser browser = pw.webkit().launch();\nSystem.out.println(browser.contexts().size()); // prints \"0\"\nBrowserContext context = browser.newContext();\nSystem.out.println(browser.contexts().size()); // prints \"1\"\n```\n\n```py\nbrowser = await pw.webkit.launch()\nprint(len(browser.contexts())) # prints `0`\ncontext = await browser.new_context()\nprint(len(browser.contexts())) # prints `1`\n```\n\n```py\nbrowser = pw.webkit.launch()\nprint(len(browser.contexts())) # prints `0`\ncontext = browser.new_context()\nprint(len(browser.contexts())) # prints `1`\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Webkit.LaunchAsync();\nSystem.Console.WriteLine(browser.Contexts.Count); // prints \"0\"\nvar context = await browser.NewContextAsync();\nSystem.Console.WriteLine(browser.Contexts.Count); // prints \"1\"\n```\n", + "async": false, + "alias": "contexts", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "isConnected", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Indicates that the browser is connected." + } + ], + "required": true, + "comment": "Indicates that the browser is connected.", + "async": false, + "alias": "isConnected", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "newBrowserCDPSession", + "type": { + "name": "CDPSession", + "expression": "[CDPSession]" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "CDP Sessions are only supported on Chromium-based browsers." + }, + { + "type": "text", + "text": "Returns the newly created browser session." + } + ], + "required": true, + "comment": "**NOTE** CDP Sessions are only supported on Chromium-based browsers.\n\nReturns the newly created browser session.", + "async": true, + "alias": "newBrowserCDPSession", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "newContext", + "type": { + "name": "BrowserContext", + "expression": "[BrowserContext]" + }, + "spec": [ + { + "type": "text", + "text": "Creates a new browser context. It won't share cookies/cache with other browser contexts." + }, + { + "type": "note", + "noteType": "note", + "text": "If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the returned context via [`method: BrowserContext.close`] when your code is done with the `BrowserContext`,↵and before calling [`method: Browser.close`]. This will ensure the `context` is closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "(async () => {", + " const browser = await playwright.firefox.launch(); // Or 'chromium' or 'webkit'.", + " // Create a new incognito browser context.", + " const context = await browser.newContext();", + " // Create a new page in a pristine context.", + " const page = await context.newPage();", + " await page.goto('https://example.com');", + "", + " // Gracefully close up everything", + " await context.close();", + " await browser.close();", + "})();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "Browser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'.", + "// Create a new incognito browser context.", + "BrowserContext context = browser.newContext();", + "// Create a new page in a pristine context.", + "Page page = context.newPage();", + "page.navigate('https://example.com');", + "", + "// Graceful close up everything", + "context.close();", + "browser.close();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "browser = await playwright.firefox.launch() # or \"chromium\" or \"webkit\".", + "# create a new incognito browser context.", + "context = await browser.new_context()", + "# create a new page in a pristine context.", + "page = await context.new_page()", + "await page.goto(\"https://example.com\")", + "", + "# gracefully close up everything", + "await context.close()", + "await browser.close()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "browser = playwright.firefox.launch() # or \"chromium\" or \"webkit\".", + "# create a new incognito browser context.", + "context = browser.new_context()", + "# create a new page in a pristine context.", + "page = context.new_page()", + "page.goto(\"https://example.com\")", + "", + "# gracefully close up everything", + "context.close()", + "browser.close()" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "using var playwright = await Playwright.CreateAsync();", + "var browser = await playwright.Firefox.LaunchAsync();", + "// Create a new incognito browser context.", + "var context = await browser.NewContextAsync();", + "// Create a new page in a pristine context.", + "var page = await context.NewPageAsync(); ;", + "await page.GotoAsync(\"https://www.bing.com\");", + "", + "// Gracefully close up everything", + "await context.CloseAsync();", + "await browser.CloseAsync();" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Creates a new browser context. It won't share cookies/cache with other browser contexts.\n\n**NOTE** If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the\nreturned context via [`method: BrowserContext.close`] when your code is done with the `BrowserContext`, and before\ncalling [`method: Browser.close`]. This will ensure the `context` is closed gracefully and any artifacts—like HARs\nand videos—are fully flushed and saved.\n\n**Usage**\n\n```js\n(async () => {\n const browser = await playwright.firefox.launch(); // Or 'chromium' or 'webkit'.\n // Create a new incognito browser context.\n const context = await browser.newContext();\n // Create a new page in a pristine context.\n const page = await context.newPage();\n await page.goto('https://example.com');\n\n // Gracefully close up everything\n await context.close();\n await browser.close();\n})();\n```\n\n```java\nBrowser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'.\n// Create a new incognito browser context.\nBrowserContext context = browser.newContext();\n// Create a new page in a pristine context.\nPage page = context.newPage();\npage.navigate('https://example.com');\n\n// Graceful close up everything\ncontext.close();\nbrowser.close();\n```\n\n```py\nbrowser = await playwright.firefox.launch() # or \"chromium\" or \"webkit\".\n# create a new incognito browser context.\ncontext = await browser.new_context()\n# create a new page in a pristine context.\npage = await context.new_page()\nawait page.goto(\"https://example.com\")\n\n# gracefully close up everything\nawait context.close()\nawait browser.close()\n```\n\n```py\nbrowser = playwright.firefox.launch() # or \"chromium\" or \"webkit\".\n# create a new incognito browser context.\ncontext = browser.new_context()\n# create a new page in a pristine context.\npage = context.new_page()\npage.goto(\"https://example.com\")\n\n# gracefully close up everything\ncontext.close()\nbrowser.close()\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Firefox.LaunchAsync();\n// Create a new incognito browser context.\nvar context = await browser.NewContextAsync();\n// Create a new page in a pristine context.\nvar page = await context.NewPageAsync(); ;\nawait page.GotoAsync(\"https://www.bing.com\");\n\n// Gracefully close up everything\nawait context.CloseAsync();\nawait browser.CloseAsync();\n```\n", + "async": true, + "alias": "newContext", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "acceptDownloads", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted." + } + ], + "required": false, + "comment": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.", + "async": false, + "alias": "acceptDownloads", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "baseURL", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`], [`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" + } + ], + "required": false, + "comment": "When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`],\n[`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by\nusing the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the\ncorresponding URL. Unset by default. Examples:\n- baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`", + "async": false, + "alias": "baseURL", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "bypassCSP", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`." + } + ], + "required": false, + "comment": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`.", + "async": false, + "alias": "bypassCSP", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "colorScheme", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.", + "async": false, + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "colorScheme", + "type": { + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'light'`.", + "async": false, + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "deviceScaleFactor", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about [emulating devices with device scale factor](../emulation.md#devices)." + } + ], + "required": false, + "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](../emulation.md#devices).", + "async": false, + "alias": "deviceScaleFactor", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "extraHTTPHeaders", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "An object containing additional HTTP headers to be sent with every request. Defaults to none." + } + ], + "required": false, + "comment": "An object containing additional HTTP headers to be sent with every request. Defaults to none.", + "async": false, + "alias": "extraHTTPHeaders", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "forcedColors", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ForcedColors", + "union": [ + { + "name": "\"active\"" + }, + { + "name": "\"none\"" + } + ] + } + ], + "expression": "null|[ForcedColors]<\"active\"|\"none\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`." + } + ], + "required": false, + "comment": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'none'`.", + "async": false, + "alias": "forcedColors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "forcedColors", + "type": { + "name": "ForcedColors", + "union": [ + { + "name": "\"active\"" + }, + { + "name": "\"none\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ForcedColors]<\"active\"|\"none\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`." + } + ], + "required": false, + "comment": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'none'`.", + "async": false, + "alias": "forcedColors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "geolocation", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "latitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Latitude between -90 and 90." + } + ], + "required": true, + "comment": "Latitude between -90 and 90.", + "async": false, + "alias": "latitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "longitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Longitude between -180 and 180." + } + ], + "required": true, + "comment": "Longitude between -180 and 180.", + "async": false, + "alias": "longitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "accuracy", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Non-negative accuracy value. Defaults to `0`." + } + ], + "required": false, + "comment": "Non-negative accuracy value. Defaults to `0`.", + "async": false, + "alias": "accuracy", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "geolocation", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "hasTouch", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.md#devices)." + } + ], + "required": false, + "comment": "Specifies if viewport supports touch events. Defaults to false. Learn more about\n[mobile emulation](../emulation.md#devices).", + "async": false, + "alias": "hasTouch", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "httpCredentials", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Restrain sending http credentials on specific origin (scheme://host:port)." + } + ], + "required": false, + "comment": "Restrain sending http credentials on specific origin (scheme://host:port).", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses." + } + ], + "required": false, + "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.", + "async": false, + "alias": "httpCredentials", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "isMobile", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile)." + } + ], + "required": false, + "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,\nso you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more\nabout [mobile emulation](../emulation.md#ismobile).", + "async": false, + "alias": "isMobile", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "javaScriptEnabled", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about [disabling JavaScript](../emulation.md#javascript-enabled)." + } + ], + "required": false, + "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about\n[disabling JavaScript](../emulation.md#javascript-enabled).", + "async": false, + "alias": "javaScriptEnabled", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "locale", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)." + } + ], + "required": false, + "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).", + "async": false, + "alias": "locale", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "logger", + "type": { + "name": "Logger", + "expression": "[Logger]" + }, + "spec": [ + { + "type": "text", + "text": "Logger sink for Playwright logging." + } + ], + "required": false, + "comment": "Logger sink for Playwright logging.", + "async": false, + "alias": "logger", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "noViewport", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Does not enforce fixed viewport, allows resizing window in the headed mode." + } + ], + "required": false, + "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", + "async": false, + "alias": "noViewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "offline", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)." + } + ], + "required": false, + "comment": "Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).", + "async": false, + "alias": "offline", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "permissions", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "A list of permissions to grant to all pages in this context. See↵[`method: BrowserContext.grantPermissions`] for more details. Defaults to none." + } + ], + "required": false, + "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for\nmore details. Defaults to none.", + "async": false, + "alias": "permissions", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "proxy", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "server", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy." + } + ], + "required": true, + "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", + "async": false, + "alias": "server", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "bypass", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`." + } + ], + "required": false, + "comment": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", + "async": false, + "alias": "bypass", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional username to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional username to use if HTTP proxy requires authentication.", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional password to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional password to use if HTTP proxy requires authentication.", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Network proxy settings to use with this context. Defaults to none." + }, + { + "type": "note", + "noteType": "note", + "text": "For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all↵contexts override the proxy, global proxy will be never used and can be any string, for example↵`launch({ proxy: { server: 'http://per-context' } })`." + } + ], + "required": false, + "comment": "Network proxy settings to use with this context. Defaults to none.\n\n**NOTE** For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If\nall contexts override the proxy, global proxy will be never used and can be any string, for example `launch({\nproxy: { server: 'http://per-context' } })`.", + "async": false, + "alias": "proxy", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHar", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "omitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.", + "async": false, + "alias": "omitContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "content", + "type": { + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.", + "async": false, + "alias": "content", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default." + } + ], + "required": true, + "comment": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ + { + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", + "async": false, + "alias": "mode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "urlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [ + { + "type": "text", + "text": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none." + } + ], + "required": false, + "comment": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.", + "async": false, + "alias": "urlFilter", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved." + } + ], + "required": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.", + "async": false, + "alias": "recordHar", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_content" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarContent", + "type": { + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files and all of these files are archived along with the\nHAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.", + "async": false, + "alias": "recordHarContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_mode" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarMode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ + { + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", + "async": false, + "alias": "recordHarMode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_omit_content" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarOmitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", + "async": false, + "alias": "recordHarOmitContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_path" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved." + } + ], + "required": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.", + "async": false, + "alias": "recordHarPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_url_filter" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarUrlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "recordHarUrlFilter", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideo", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "dir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to the directory to put videos into." + } + ], + "required": true, + "comment": "Path to the directory to put videos into.", + "async": false, + "alias": "dir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "size", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "size", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved." + } + ], + "required": false, + "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.", + "async": false, + "alias": "recordVideo", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_dir" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideoDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved." + } + ], + "required": false, + "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.", + "async": false, + "alias": "recordVideoDir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_size" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideoSize", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "recordVideoSize", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "reducedMotion", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ReducedMotion", + "union": [ + { + "name": "\"reduce\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ReducedMotion]<\"reduce\"|\"no-preference\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'no-preference'`.", + "async": false, + "alias": "reducedMotion", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "reducedMotion", + "type": { + "name": "ReducedMotion", + "union": [ + { + "name": "\"reduce\"" + }, + { + "name": "\"no-preference\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'no-preference'`.", + "async": false, + "alias": "reducedMotion", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "aliases": { + "java": "screenSize", + "csharp": "screenSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "screen", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the↵`viewport` is set." + } + ], + "required": false, + "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the\n`viewport` is set.", + "async": false, + "alias": "screen", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "serviceWorkers", + "type": { + "name": "ServiceWorkerPolicy", + "union": [ + { + "name": "\"allow\"" + }, + { + "name": "\"block\"" + } + ], + "expression": "[ServiceWorkerPolicy]<\"allow\"|\"block\">" + }, + "spec": [ + { + "type": "text", + "text": "Whether to allow sites to register Service workers. Defaults to `'allow'`." + }, + { + "type": "li", + "text": "`'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'block'`: Playwright will block all registration of Service Workers.", + "liType": "bullet" + } + ], + "required": false, + "comment": "Whether to allow sites to register Service workers. Defaults to `'allow'`.\n- `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be\n registered.\n- `'block'`: Playwright will block all registration of Service Workers.", + "async": false, + "alias": "serviceWorkers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "storageState", + "type": { + "name": "", + "union": [ + { + "name": "path" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "cookies", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "domain", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\"" + } + ], + "required": true, + "comment": "Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like\nthis: \".example.com\"", + "async": false, + "alias": "domain", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Domain and path are required" + } + ], + "required": true, + "comment": "Domain and path are required", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "expires", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Unix time in seconds." + } + ], + "required": true, + "comment": "Unix time in seconds.", + "async": false, + "alias": "expires", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "httpOnly", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "httpOnly", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "secure", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "secure", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "sameSite", + "type": { + "name": "SameSiteAttribute", + "union": [ + { + "name": "\"Strict\"" + }, + { + "name": "\"Lax\"" + }, + { + "name": "\"None\"" + } + ], + "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">" + }, + "spec": [ + { + "type": "text", + "text": "sameSite flag" + } + ], + "required": true, + "comment": "sameSite flag", + "async": false, + "alias": "sameSite", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Cookies to set for context" + } + ], + "required": true, + "comment": "Cookies to set for context", + "async": false, + "alias": "cookies", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origins", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "localStorage", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "localStorage", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "localStorage to set for context" + } + ], + "required": true, + "comment": "localStorage to set for context", + "async": false, + "alias": "origins", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[path]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Learn more about [storage state and auth](../auth.md)." + }, + { + "type": "text", + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]." + } + ], + "required": false, + "comment": "Learn more about [storage state and auth](../auth.md).\n\nPopulates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`].", + "async": false, + "alias": "storageState", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "storageState", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]." + } + ], + "required": false, + "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`].", + "async": false, + "alias": "storageState", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "storageStatePath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state." + } + ], + "required": false, + "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", + "async": false, + "alias": "storageStatePath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "strictSelectors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations↵on selectors that imply single target DOM element will throw when more than one element matches the selector.↵This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.↵See `Locator` to learn more about the strict mode." + } + ], + "required": false, + "comment": "If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on\nselectors that imply single target DOM element will throw when more than one element matches the selector. This\noption does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See `Locator` to learn\nmore about the strict mode.", + "async": false, + "alias": "strictSelectors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "timezoneId", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone." + } + ], + "required": false, + "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.", + "async": false, + "alias": "timezoneId", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "userAgent", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Specific user agent to use in this context." + } + ], + "required": false, + "comment": "Specific user agent to use in this context.", + "async": false, + "alias": "userAgent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "deprecated": "Use `recordVideo` instead.", + "name": "videoSize", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "videoSize", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "deprecated": "Use `recordVideo` instead.", + "name": "videosPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "videosPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": { + "java": "viewportSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport)." + }, + { + "type": "note", + "noteType": "note", + "text": "The `null` value opts out from the default presets, makes viewport depend on the↵host window size defined by the operating system. It makes the execution of the↵tests non-deterministic." + } + ], + "required": false, + "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent\nviewport emulation. Learn more about [viewport emulation](../emulation#viewport).\n\n**NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined\nby the operating system. It makes the execution of the tests non-deterministic.", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": { + "csharp": "viewportSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport)." + }, + { + "type": "note", + "noteType": "note", + "text": "The `ViewportSize.NoViewport` value opts out from the default presets,↵makes viewport depend on the host window size defined by the operating system.↵It makes the execution of the tests non-deterministic." + } + ], + "required": false, + "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to\ndisable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport).\n\n**NOTE** The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host\nwindow size defined by the operating system. It makes the execution of the tests non-deterministic.", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport. Learn more about [viewport emulation](../emulation.md#viewport)." + } + ], + "required": false, + "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed\nviewport. Learn more about [viewport emulation](../emulation.md#viewport).", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "newPage", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "Creates a new page in a new browser context. Closing this page will close the context as well." + }, + { + "type": "text", + "text": "This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and↵testing frameworks should explicitly create [`method: Browser.newContext`] followed by the↵[`method: BrowserContext.newPage`] to control their exact life times." + } + ], + "required": true, + "comment": "Creates a new page in a new browser context. Closing this page will close the context as well.\n\nThis is a convenience API that should only be used for the single-page scenarios and short snippets. Production\ncode and testing frameworks should explicitly create [`method: Browser.newContext`] followed by the\n[`method: BrowserContext.newPage`] to control their exact life times.", + "async": true, + "alias": "newPage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "acceptDownloads", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted." + } + ], + "required": false, + "comment": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.", + "async": false, + "alias": "acceptDownloads", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "baseURL", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`], [`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" + } + ], + "required": false, + "comment": "When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`],\n[`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by\nusing the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the\ncorresponding URL. Unset by default. Examples:\n- baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`", + "async": false, + "alias": "baseURL", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "bypassCSP", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`." + } + ], + "required": false, + "comment": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`.", + "async": false, + "alias": "bypassCSP", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "colorScheme", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.", + "async": false, + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "colorScheme", + "type": { + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'light'`.", + "async": false, + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "deviceScaleFactor", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about [emulating devices with device scale factor](../emulation.md#devices)." + } + ], + "required": false, + "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](../emulation.md#devices).", + "async": false, + "alias": "deviceScaleFactor", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "extraHTTPHeaders", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "An object containing additional HTTP headers to be sent with every request. Defaults to none." + } + ], + "required": false, + "comment": "An object containing additional HTTP headers to be sent with every request. Defaults to none.", + "async": false, + "alias": "extraHTTPHeaders", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "forcedColors", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ForcedColors", + "union": [ + { + "name": "\"active\"" + }, + { + "name": "\"none\"" + } + ] + } + ], + "expression": "null|[ForcedColors]<\"active\"|\"none\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`." + } + ], + "required": false, + "comment": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'none'`.", + "async": false, + "alias": "forcedColors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "forcedColors", + "type": { + "name": "ForcedColors", + "union": [ + { + "name": "\"active\"" + }, + { + "name": "\"none\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ForcedColors]<\"active\"|\"none\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`." + } + ], + "required": false, + "comment": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'none'`.", + "async": false, + "alias": "forcedColors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "geolocation", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "latitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Latitude between -90 and 90." + } + ], + "required": true, + "comment": "Latitude between -90 and 90.", + "async": false, + "alias": "latitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "longitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Longitude between -180 and 180." + } + ], + "required": true, + "comment": "Longitude between -180 and 180.", + "async": false, + "alias": "longitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "accuracy", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Non-negative accuracy value. Defaults to `0`." + } + ], + "required": false, + "comment": "Non-negative accuracy value. Defaults to `0`.", + "async": false, + "alias": "accuracy", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "geolocation", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "hasTouch", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.md#devices)." + } + ], + "required": false, + "comment": "Specifies if viewport supports touch events. Defaults to false. Learn more about\n[mobile emulation](../emulation.md#devices).", + "async": false, + "alias": "hasTouch", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "httpCredentials", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Restrain sending http credentials on specific origin (scheme://host:port)." + } + ], + "required": false, + "comment": "Restrain sending http credentials on specific origin (scheme://host:port).", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses." + } + ], + "required": false, + "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.", + "async": false, + "alias": "httpCredentials", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "isMobile", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile)." + } + ], + "required": false, + "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,\nso you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more\nabout [mobile emulation](../emulation.md#ismobile).", + "async": false, + "alias": "isMobile", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "javaScriptEnabled", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about [disabling JavaScript](../emulation.md#javascript-enabled)." + } + ], + "required": false, + "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about\n[disabling JavaScript](../emulation.md#javascript-enabled).", + "async": false, + "alias": "javaScriptEnabled", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "locale", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)." + } + ], + "required": false, + "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).", + "async": false, + "alias": "locale", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "logger", + "type": { + "name": "Logger", + "expression": "[Logger]" + }, + "spec": [ + { + "type": "text", + "text": "Logger sink for Playwright logging." + } + ], + "required": false, + "comment": "Logger sink for Playwright logging.", + "async": false, + "alias": "logger", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "noViewport", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Does not enforce fixed viewport, allows resizing window in the headed mode." + } + ], + "required": false, + "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", + "async": false, + "alias": "noViewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "offline", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)." + } + ], + "required": false, + "comment": "Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).", + "async": false, + "alias": "offline", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "permissions", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "A list of permissions to grant to all pages in this context. See↵[`method: BrowserContext.grantPermissions`] for more details. Defaults to none." + } + ], + "required": false, + "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for\nmore details. Defaults to none.", + "async": false, + "alias": "permissions", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "proxy", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "server", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy." + } + ], + "required": true, + "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", + "async": false, + "alias": "server", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "bypass", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`." + } + ], + "required": false, + "comment": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", + "async": false, + "alias": "bypass", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional username to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional username to use if HTTP proxy requires authentication.", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional password to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional password to use if HTTP proxy requires authentication.", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Network proxy settings to use with this context. Defaults to none." + }, + { + "type": "note", + "noteType": "note", + "text": "For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all↵contexts override the proxy, global proxy will be never used and can be any string, for example↵`launch({ proxy: { server: 'http://per-context' } })`." + } + ], + "required": false, + "comment": "Network proxy settings to use with this context. Defaults to none.\n\n**NOTE** For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If\nall contexts override the proxy, global proxy will be never used and can be any string, for example `launch({\nproxy: { server: 'http://per-context' } })`.", + "async": false, + "alias": "proxy", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHar", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "omitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.", + "async": false, + "alias": "omitContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "content", + "type": { + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.", + "async": false, + "alias": "content", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default." + } + ], + "required": true, + "comment": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ + { + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", + "async": false, + "alias": "mode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "urlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [ + { + "type": "text", + "text": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none." + } + ], + "required": false, + "comment": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.", + "async": false, + "alias": "urlFilter", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved." + } + ], + "required": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.", + "async": false, + "alias": "recordHar", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_content" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarContent", + "type": { + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files and all of these files are archived along with the\nHAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.", + "async": false, + "alias": "recordHarContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_mode" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarMode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ + { + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", + "async": false, + "alias": "recordHarMode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_omit_content" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarOmitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", + "async": false, + "alias": "recordHarOmitContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_path" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved." + } + ], + "required": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.", + "async": false, + "alias": "recordHarPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_url_filter" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarUrlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "recordHarUrlFilter", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideo", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "dir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to the directory to put videos into." + } + ], + "required": true, + "comment": "Path to the directory to put videos into.", + "async": false, + "alias": "dir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "size", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "size", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved." + } + ], + "required": false, + "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.", + "async": false, + "alias": "recordVideo", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_dir" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideoDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved." + } + ], + "required": false, + "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.", + "async": false, + "alias": "recordVideoDir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_size" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideoSize", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "recordVideoSize", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "reducedMotion", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ReducedMotion", + "union": [ + { + "name": "\"reduce\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ReducedMotion]<\"reduce\"|\"no-preference\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'no-preference'`.", + "async": false, + "alias": "reducedMotion", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "reducedMotion", + "type": { + "name": "ReducedMotion", + "union": [ + { + "name": "\"reduce\"" + }, + { + "name": "\"no-preference\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'no-preference'`.", + "async": false, + "alias": "reducedMotion", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "aliases": { + "java": "screenSize", + "csharp": "screenSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "screen", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the↵`viewport` is set." + } + ], + "required": false, + "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the\n`viewport` is set.", + "async": false, + "alias": "screen", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "serviceWorkers", + "type": { + "name": "ServiceWorkerPolicy", + "union": [ + { + "name": "\"allow\"" + }, + { + "name": "\"block\"" + } + ], + "expression": "[ServiceWorkerPolicy]<\"allow\"|\"block\">" + }, + "spec": [ + { + "type": "text", + "text": "Whether to allow sites to register Service workers. Defaults to `'allow'`." + }, + { + "type": "li", + "text": "`'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'block'`: Playwright will block all registration of Service Workers.", + "liType": "bullet" + } + ], + "required": false, + "comment": "Whether to allow sites to register Service workers. Defaults to `'allow'`.\n- `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be\n registered.\n- `'block'`: Playwright will block all registration of Service Workers.", + "async": false, + "alias": "serviceWorkers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "storageState", + "type": { + "name": "", + "union": [ + { + "name": "path" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "cookies", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "domain", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\"" + } + ], + "required": true, + "comment": "Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like\nthis: \".example.com\"", + "async": false, + "alias": "domain", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Domain and path are required" + } + ], + "required": true, + "comment": "Domain and path are required", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "expires", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Unix time in seconds." + } + ], + "required": true, + "comment": "Unix time in seconds.", + "async": false, + "alias": "expires", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "httpOnly", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "httpOnly", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "secure", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "secure", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "sameSite", + "type": { + "name": "SameSiteAttribute", + "union": [ + { + "name": "\"Strict\"" + }, + { + "name": "\"Lax\"" + }, + { + "name": "\"None\"" + } + ], + "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">" + }, + "spec": [ + { + "type": "text", + "text": "sameSite flag" + } + ], + "required": true, + "comment": "sameSite flag", + "async": false, + "alias": "sameSite", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Cookies to set for context" + } + ], + "required": true, + "comment": "Cookies to set for context", + "async": false, + "alias": "cookies", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origins", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "localStorage", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "localStorage", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "localStorage to set for context" + } + ], + "required": true, + "comment": "localStorage to set for context", + "async": false, + "alias": "origins", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[path]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Learn more about [storage state and auth](../auth.md)." + }, + { + "type": "text", + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]." + } + ], + "required": false, + "comment": "Learn more about [storage state and auth](../auth.md).\n\nPopulates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`].", + "async": false, + "alias": "storageState", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "storageState", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]." + } + ], + "required": false, + "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`].", + "async": false, + "alias": "storageState", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "storageStatePath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state." + } + ], + "required": false, + "comment": "Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.", + "async": false, + "alias": "storageStatePath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "strictSelectors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations↵on selectors that imply single target DOM element will throw when more than one element matches the selector.↵This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.↵See `Locator` to learn more about the strict mode." + } + ], + "required": false, + "comment": "If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on\nselectors that imply single target DOM element will throw when more than one element matches the selector. This\noption does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See `Locator` to learn\nmore about the strict mode.", + "async": false, + "alias": "strictSelectors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "timezoneId", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone." + } + ], + "required": false, + "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.", + "async": false, + "alias": "timezoneId", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "userAgent", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Specific user agent to use in this context." + } + ], + "required": false, + "comment": "Specific user agent to use in this context.", + "async": false, + "alias": "userAgent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "deprecated": "Use `recordVideo` instead.", + "name": "videoSize", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "videoSize", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "deprecated": "Use `recordVideo` instead.", + "name": "videosPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "videosPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": { + "java": "viewportSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport)." + }, + { + "type": "note", + "noteType": "note", + "text": "The `null` value opts out from the default presets, makes viewport depend on the↵host window size defined by the operating system. It makes the execution of the↵tests non-deterministic." + } + ], + "required": false, + "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent\nviewport emulation. Learn more about [viewport emulation](../emulation#viewport).\n\n**NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined\nby the operating system. It makes the execution of the tests non-deterministic.", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": { + "csharp": "viewportSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport)." + }, + { + "type": "note", + "noteType": "note", + "text": "The `ViewportSize.NoViewport` value opts out from the default presets,↵makes viewport depend on the host window size defined by the operating system.↵It makes the execution of the tests non-deterministic." + } + ], + "required": false, + "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to\ndisable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport).\n\n**NOTE** The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host\nwindow size defined by the operating system. It makes the execution of the tests non-deterministic.", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport. Learn more about [viewport emulation](../emulation.md#viewport)." + } + ], + "required": false, + "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed\nviewport. Learn more about [viewport emulation](../emulation.md#viewport).", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "java", + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.11", + "name": "startTracing", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "This API controls [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level chromium-specific debugging tool. API to control [Playwright Tracing](../trace-viewer) could be found [here](./class-tracing)." + }, + { + "type": "text", + "text": "You can use [`method: Browser.startTracing`] and [`method: Browser.stopTracing`] to create a trace file that can↵be opened in Chrome DevTools performance panel." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "await browser.startTracing(page, { path: 'trace.json' });", + "await page.goto('https://www.google.com');", + "await browser.stopTracing();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "browser.startTracing(page, new Browser.StartTracingOptions()", + " .setPath(Paths.get(\"trace.json\")));", + "page.goto('https://www.google.com');", + "browser.stopTracing();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "await browser.start_tracing(page, path=\"trace.json\")", + "await page.goto(\"https://www.google.com\")", + "await browser.stop_tracing()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "browser.start_tracing(page, path=\"trace.json\")", + "page.goto(\"https://www.google.com\")", + "browser.stop_tracing()" + ], + "codeLang": "python sync" + } + ], + "required": true, + "comment": "**NOTE** This API controls\n[Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level\nchromium-specific debugging tool. API to control [Playwright Tracing](../trace-viewer) could be found\n[here](./class-tracing).\n\nYou can use [`method: Browser.startTracing`] and [`method: Browser.stopTracing`] to create a trace file that can be\nopened in Chrome DevTools performance panel.\n\n**Usage**\n\n```js\nawait browser.startTracing(page, { path: 'trace.json' });\nawait page.goto('https://www.google.com');\nawait browser.stopTracing();\n```\n\n```java\nbrowser.startTracing(page, new Browser.StartTracingOptions()\n .setPath(Paths.get(\"trace.json\")));\npage.goto('https://www.google.com');\nbrowser.stopTracing();\n```\n\n```py\nawait browser.start_tracing(page, path=\"trace.json\")\nawait page.goto(\"https://www.google.com\")\nawait browser.stop_tracing()\n```\n\n```py\nbrowser.start_tracing(page, path=\"trace.json\")\npage.goto(\"https://www.google.com\")\nbrowser.stop_tracing()\n```\n", + "async": true, + "alias": "startTracing", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "page", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "Optional, if specified, tracing includes screenshots of the given page." + } + ], + "required": false, + "comment": "Optional, if specified, tracing includes screenshots of the given page.", + "async": false, + "alias": "page", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "categories", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "specify custom categories to use instead of default." + } + ], + "required": false, + "comment": "specify custom categories to use instead of default.", + "async": false, + "alias": "categories", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "A path to write the trace file to." + } + ], + "required": false, + "comment": "A path to write the trace file to.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "screenshots", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "captures screenshots in the trace." + } + ], + "required": false, + "comment": "captures screenshots in the trace.", + "async": false, + "alias": "screenshots", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "java", + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.11", + "name": "stopTracing", + "type": { + "name": "Buffer", + "expression": "[Buffer]" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "This API controls [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level chromium-specific debugging tool. API to control [Playwright Tracing](../trace-viewer) could be found [here](./class-tracing)." + }, + { + "type": "text", + "text": "Returns the buffer with trace data." + } + ], + "required": true, + "comment": "**NOTE** This API controls\n[Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level\nchromium-specific debugging tool. API to control [Playwright Tracing](../trace-viewer) could be found\n[here](./class-tracing).\n\nReturns the buffer with trace data.", + "async": true, + "alias": "stopTracing", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "version", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the browser version." + } + ], + "required": true, + "comment": "Returns the browser version.", + "async": false, + "alias": "version", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "BrowserContext", + "spec": [ + { + "type": "li", + "text": "extends: [EventEmitter]", + "liType": "bullet" + }, + { + "type": "text", + "text": "BrowserContexts provide a way to operate multiple independent browser sessions." + }, + { + "type": "text", + "text": "If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser↵context." + }, + { + "type": "text", + "text": "Playwright allows creating \"incognito\" browser contexts with [`method: Browser.newContext`] method. \"Incognito\" browser↵contexts don't write any browsing data to disk." + }, + { + "type": "code", + "lines": [ + "// Create a new incognito browser context", + "const context = await browser.newContext();", + "// Create a new page inside context.", + "const page = await context.newPage();", + "await page.goto('https://example.com');", + "// Dispose context once it's no longer needed.", + "await context.close();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "// Create a new incognito browser context", + "BrowserContext context = browser.newContext();", + "// Create a new page inside context.", + "Page page = context.newPage();", + "page.navigate(\"https://example.com\");", + "// Dispose context once it is no longer needed.", + "context.close();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "# create a new incognito browser context", + "context = await browser.new_context()", + "# create a new page inside context.", + "page = await context.new_page()", + "await page.goto(\"https://example.com\")", + "# dispose context once it is no longer needed.", + "await context.close()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "# create a new incognito browser context", + "context = browser.new_context()", + "# create a new page inside context.", + "page = context.new_page()", + "page.goto(\"https://example.com\")", + "# dispose context once it is no longer needed.", + "context.close()" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "using var playwright = await Playwright.CreateAsync();", + "var browser = await playwright.Firefox.LaunchAsync(new() { Headless = false });", + "// Create a new incognito browser context", + "var context = await browser.NewContextAsync();", + "// Create a new page inside context.", + "var page = await context.NewPageAsync();", + "await page.GotoAsync(\"https://bing.com\");", + "// Dispose context once it is no longer needed.", + "await context.CloseAsync();" + ], + "codeLang": "csharp" + } + ], + "extends": "EventEmitter", + "langs": {}, + "comment": "- extends: [EventEmitter]\n\nBrowserContexts provide a way to operate multiple independent browser sessions.\n\nIf a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser\ncontext.\n\nPlaywright allows creating \"incognito\" browser contexts with [`method: Browser.newContext`] method. \"Incognito\"\nbrowser contexts don't write any browsing data to disk.\n\n```js\n// Create a new incognito browser context\nconst context = await browser.newContext();\n// Create a new page inside context.\nconst page = await context.newPage();\nawait page.goto('https://example.com');\n// Dispose context once it's no longer needed.\nawait context.close();\n```\n\n```java\n// Create a new incognito browser context\nBrowserContext context = browser.newContext();\n// Create a new page inside context.\nPage page = context.newPage();\npage.navigate(\"https://example.com\");\n// Dispose context once it is no longer needed.\ncontext.close();\n```\n\n```py\n# create a new incognito browser context\ncontext = await browser.new_context()\n# create a new page inside context.\npage = await context.new_page()\nawait page.goto(\"https://example.com\")\n# dispose context once it is no longer needed.\nawait context.close()\n```\n\n```py\n# create a new incognito browser context\ncontext = browser.new_context()\n# create a new page inside context.\npage = context.new_page()\npage.goto(\"https://example.com\")\n# dispose context once it is no longer needed.\ncontext.close()\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Firefox.LaunchAsync(new() { Headless = false });\n// Create a new incognito browser context\nvar context = await browser.NewContextAsync();\n// Create a new page inside context.\nvar page = await context.NewPageAsync();\nawait page.GotoAsync(\"https://bing.com\");\n// Dispose context once it is no longer needed.\nawait context.CloseAsync();\n```\n", + "since": "v1.8", + "members": [ + { + "kind": "event", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.11", + "name": "backgroundPage", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "Only works with Chromium browser's persistent context." + }, + { + "type": "text", + "text": "Emitted when new background page is created in the context." + }, + { + "type": "code", + "lines": [ + "const backgroundPage = await context.waitForEvent('backgroundpage');" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "background_page = await context.wait_for_event(\"backgroundpage\")" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "background_page = context.wait_for_event(\"backgroundpage\")" + ], + "codeLang": "python sync" + } + ], + "required": true, + "comment": "**NOTE** Only works with Chromium browser's persistent context.\n\nEmitted when new background page is created in the context.\n\n```js\nconst backgroundPage = await context.waitForEvent('backgroundpage');\n```\n\n```py\nbackground_page = await context.wait_for_event(\"backgroundpage\")\n```\n\n```py\nbackground_page = context.wait_for_event(\"backgroundpage\")\n```\n", + "async": false, + "alias": "backgroundPage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "close", + "type": { + "name": "BrowserContext", + "expression": "[BrowserContext]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when Browser context gets closed. This might happen because of one of the following:" + }, + { + "type": "li", + "text": "Browser context is closed.", + "liType": "bullet" + }, + { + "type": "li", + "text": "Browser application is closed or crashed.", + "liType": "bullet" + }, + { + "type": "li", + "text": "The [`method: Browser.close`] method was called.", + "liType": "bullet" + } + ], + "required": true, + "comment": "Emitted when Browser context gets closed. This might happen because of one of the following:\n- Browser context is closed.\n- Browser application is closed or crashed.\n- The [`method: Browser.close`] method was called.", + "async": false, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": { + "aliases": { + "java": "consoleMessage" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.34", + "name": "console", + "type": { + "name": "ConsoleMessage", + "expression": "[ConsoleMessage]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also emitted if the page throws an error or a warning." + }, + { + "type": "text", + "text": "The arguments passed into `console.log` and the page are available on the `ConsoleMessage` event handler argument." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "context.on('console', async msg => {", + " const values = [];", + " for (const arg of msg.args())", + " values.push(await arg.jsonValue());", + " console.log(...values);", + "});", + "await page.evaluate(() => console.log('hello', 5, { foo: 'bar' }));" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "context.onConsoleMessage(msg -> {", + " for (int i = 0; i < msg.args().size(); ++i)", + " System.out.println(i + \": \" + msg.args().get(i).jsonValue());", + "});", + "page.evaluate(\"() => console.log('hello', 5, { foo: 'bar' })\");" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "async def print_args(msg):", + " values = []", + " for arg in msg.args:", + " values.append(await arg.json_value())", + " print(values)", + "", + "context.on(\"console\", print_args)", + "await page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "def print_args(msg):", + " for arg in msg.args:", + " print(arg.json_value())", + "", + "context.on(\"console\", print_args)", + "page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "context.Console += async (_, msg) =>", + "{", + " foreach (var arg in msg.Args)", + " Console.WriteLine(await arg.JsonValueAsync());", + "};", + "", + "await page.EvaluateAsync(\"console.log('hello', 5, { foo: 'bar' })\");" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also\nemitted if the page throws an error or a warning.\n\nThe arguments passed into `console.log` and the page are available on the `ConsoleMessage` event handler argument.\n\n**Usage**\n\n```js\ncontext.on('console', async msg => {\n const values = [];\n for (const arg of msg.args())\n values.push(await arg.jsonValue());\n console.log(...values);\n});\nawait page.evaluate(() => console.log('hello', 5, { foo: 'bar' }));\n```\n\n```java\ncontext.onConsoleMessage(msg -> {\n for (int i = 0; i < msg.args().size(); ++i)\n System.out.println(i + \": \" + msg.args().get(i).jsonValue());\n});\npage.evaluate(\"() => console.log('hello', 5, { foo: 'bar' })\");\n```\n\n```py\nasync def print_args(msg):\n values = []\n for arg in msg.args:\n values.append(await arg.json_value())\n print(values)\n\ncontext.on(\"console\", print_args)\nawait page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")\n```\n\n```py\ndef print_args(msg):\n for arg in msg.args:\n print(arg.json_value())\n\ncontext.on(\"console\", print_args)\npage.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")\n```\n\n```csharp\ncontext.Console += async (_, msg) =>\n{\n foreach (var arg in msg.Args)\n Console.WriteLine(await arg.JsonValueAsync());\n};\n\nawait page.EvaluateAsync(\"console.log('hello', 5, { foo: 'bar' })\");\n```\n", + "async": false, + "alias": "console", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.34", + "name": "dialog", + "type": { + "name": "Dialog", + "expression": "[Dialog]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and actions like click will never finish." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "context.on('dialog', dialog => {", + " dialog.accept();", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "context.onDialog(dialog -> {", + " dialog.accept();", + "});" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "context.on(\"dialog\", lambda dialog: dialog.accept())" + ], + "codeLang": "python" + }, + { + "type": "code", + "lines": [ + "context.Dialog += (_, dialog) => dialog.AcceptAsync();" + ], + "codeLang": "csharp" + }, + { + "type": "note", + "noteType": "note", + "text": "When no [`event: Page.dialog`] or [`event: BrowserContext.dialog`] listeners are present, all dialogs are automatically dismissed." + } + ], + "required": true, + "comment": "Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**\neither [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page will\n[freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog,\nand actions like click will never finish.\n\n**Usage**\n\n```js\ncontext.on('dialog', dialog => {\n dialog.accept();\n});\n```\n\n```java\ncontext.onDialog(dialog -> {\n dialog.accept();\n});\n```\n\n```python\ncontext.on(\"dialog\", lambda dialog: dialog.accept())\n```\n\n```csharp\ncontext.Dialog += (_, dialog) => dialog.AcceptAsync();\n```\n\n**NOTE** When no [`event: Page.dialog`] or [`event: BrowserContext.dialog`] listeners are present, all dialogs are\nautomatically dismissed.", + "async": false, + "alias": "dialog", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "page", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will↵also fire for popup pages. See also [`event: Page.popup`] to receive events about popups relevant to a specific page." + }, + { + "type": "text", + "text": "The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a↵popup with `window.open('http://example.com')`, this event will fire when the network request to \"http://example.com\" is↵done and its response has started loading in the popup." + }, + { + "type": "code", + "lines": [ + "const newPagePromise = context.waitForEvent('page');", + "await page.getByText('open new page').click();", + "const newPage = await newPagePromise;", + "console.log(await newPage.evaluate('location.href'));" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "Page newPage = context.waitForPage(() -> {", + " page.getByText(\"open new page\").click();", + "});", + "System.out.println(newPage.evaluate(\"location.href\"));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "async with context.expect_page() as page_info:", + " await page.get_by_text(\"open new page\").click(),", + "page = await page_info.value", + "print(await page.evaluate(\"location.href\"))" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "with context.expect_page() as page_info:", + " page.get_by_text(\"open new page\").click(),", + "page = page_info.value", + "print(page.evaluate(\"location.href\"))" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var popup = await context.RunAndWaitForPageAsync(async =>", + "{", + " await page.GetByText(\"open new page\").ClickAsync();", + "});", + "Console.WriteLine(await popup.EvaluateAsync(\"location.href\"));" + ], + "codeLang": "csharp" + }, + { + "type": "note", + "noteType": "note", + "text": "Use [`method: Page.waitForLoadState`] to wait until the page gets to a particular state (you should not need it in most↵cases)." + } + ], + "required": true, + "comment": "The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event\nwill also fire for popup pages. See also [`event: Page.popup`] to receive events about popups relevant to a\nspecific page.\n\nThe earliest moment that page is available is when it has navigated to the initial url. For example, when opening a\npopup with `window.open('http://example.com')`, this event will fire when the network request to\n\"http://example.com\" is done and its response has started loading in the popup.\n\n```js\nconst newPagePromise = context.waitForEvent('page');\nawait page.getByText('open new page').click();\nconst newPage = await newPagePromise;\nconsole.log(await newPage.evaluate('location.href'));\n```\n\n```java\nPage newPage = context.waitForPage(() -> {\n page.getByText(\"open new page\").click();\n});\nSystem.out.println(newPage.evaluate(\"location.href\"));\n```\n\n```py\nasync with context.expect_page() as page_info:\n await page.get_by_text(\"open new page\").click(),\npage = await page_info.value\nprint(await page.evaluate(\"location.href\"))\n```\n\n```py\nwith context.expect_page() as page_info:\n page.get_by_text(\"open new page\").click(),\npage = page_info.value\nprint(page.evaluate(\"location.href\"))\n```\n\n```csharp\nvar popup = await context.RunAndWaitForPageAsync(async =>\n{\n await page.GetByText(\"open new page\").ClickAsync();\n});\nConsole.WriteLine(await popup.EvaluateAsync(\"location.href\"));\n```\n\n**NOTE** Use [`method: Page.waitForLoadState`] to wait until the page gets to a particular state (you should not\nneed it in most cases).", + "async": false, + "alias": "page", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.38", + "name": "webError", + "type": { + "name": "WebError", + "expression": "[WebError]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when exception is unhandled in any of the pages in this↵context. To listen for errors from a particular page, use [`event: Page.pageError`] instead." + } + ], + "required": true, + "comment": "Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular\npage, use [`event: Page.pageError`] instead.", + "async": false, + "alias": "webError", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "request", + "type": { + "name": "Request", + "expression": "[Request]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when a request is issued from any pages created through this context.↵The [request] object is read-only. To only listen for requests from a particular↵page, use [`event: Page.request`]." + }, + { + "type": "text", + "text": "In order to intercept and mutate requests, see [`method: BrowserContext.route`]↵or [`method: Page.route`]." + } + ], + "required": true, + "comment": "Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To\nonly listen for requests from a particular page, use [`event: Page.request`].\n\nIn order to intercept and mutate requests, see [`method: BrowserContext.route`] or [`method: Page.route`].", + "async": false, + "alias": "request", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "requestFailed", + "type": { + "name": "Request", + "expression": "[Request]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when a request fails, for example by timing out. To only listen for↵failed requests from a particular page, use [`event: Page.requestFailed`]." + }, + { + "type": "note", + "noteType": "note", + "text": "HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete↵with [`event: BrowserContext.requestFinished`] event and not with [`event: BrowserContext.requestFailed`]." + } + ], + "required": true, + "comment": "Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page,\nuse [`event: Page.requestFailed`].\n\n**NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request\nwill complete with [`event: BrowserContext.requestFinished`] event and not with\n[`event: BrowserContext.requestFailed`].", + "async": false, + "alias": "requestFailed", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "requestFinished", + "type": { + "name": "Request", + "expression": "[Request]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when a request finishes successfully after downloading the response body. For a successful response, the↵sequence of events is `request`, `response` and `requestfinished`. To listen for↵successful requests from a particular page, use [`event: Page.requestFinished`]." + } + ], + "required": true, + "comment": "Emitted when a request finishes successfully after downloading the response body. For a successful response, the\nsequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a\nparticular page, use [`event: Page.requestFinished`].", + "async": false, + "alias": "requestFinished", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "response", + "type": { + "name": "Response", + "expression": "[Response]" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events↵is `request`, `response` and `requestfinished`. To listen for response events↵from a particular page, use [`event: Page.response`]." + } + ], + "required": true, + "comment": "Emitted when [response] status and headers are received for a request. For a successful response, the sequence of\nevents is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use\n[`event: Page.response`].", + "async": false, + "alias": "response", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.11", + "name": "serviceWorker", + "type": { + "name": "Worker", + "expression": "[Worker]" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "Service workers are only supported on Chromium-based browsers." + }, + { + "type": "text", + "text": "Emitted when new service worker is created in the context." + } + ], + "required": true, + "comment": "**NOTE** Service workers are only supported on Chromium-based browsers.\n\nEmitted when new service worker is created in the context.", + "async": false, + "alias": "serviceWorker", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "addCookies", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can be↵obtained via [`method: BrowserContext.cookies`]." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "await browserContext.addCookies([cookieObject1, cookieObject2]);" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "browserContext.addCookies(Arrays.asList(cookieObject1, cookieObject2));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "await browser_context.add_cookies([cookie_object1, cookie_object2])" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "browser_context.add_cookies([cookie_object1, cookie_object2])" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "await context.AddCookiesAsync(new[] { cookie1, cookie2 });" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies\ncan be obtained via [`method: BrowserContext.cookies`].\n\n**Usage**\n\n```js\nawait browserContext.addCookies([cookieObject1, cookieObject2]);\n```\n\n```java\nbrowserContext.addCookies(Arrays.asList(cookieObject1, cookieObject2));\n```\n\n```py\nawait browser_context.add_cookies([cookie_object1, cookie_object2])\n```\n\n```py\nbrowser_context.add_cookies([cookie_object1, cookie_object2])\n```\n\n```csharp\nawait context.AddCookiesAsync(new[] { cookie1, cookie2 });\n```\n", + "async": true, + "alias": "addCookies", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "cookies", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "either url or domain / path are required. Optional." + } + ], + "required": false, + "comment": "either url or domain / path are required. Optional.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "domain", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "either url or domain / path are required Optional." + } + ], + "required": false, + "comment": "either url or domain / path are required Optional.", + "async": false, + "alias": "domain", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "either url or domain / path are required Optional." + } + ], + "required": false, + "comment": "either url or domain / path are required Optional.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "expires", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Unix time in seconds. Optional." + } + ], + "required": false, + "comment": "Unix time in seconds. Optional.", + "async": false, + "alias": "expires", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "httpOnly", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional." + } + ], + "required": false, + "comment": "Optional.", + "async": false, + "alias": "httpOnly", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "secure", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional." + } + ], + "required": false, + "comment": "Optional.", + "async": false, + "alias": "secure", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "sameSite", + "type": { + "name": "SameSiteAttribute", + "union": [ + { + "name": "\"Strict\"" + }, + { + "name": "\"Lax\"" + }, + { + "name": "\"None\"" + } + ], + "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional." + } + ], + "required": false, + "comment": "Optional.", + "async": false, + "alias": "sameSite", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Adds cookies to the browser context." + }, + { + "type": "text", + "text": "For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\"." + } + ], + "required": true, + "comment": "Adds cookies to the browser context.\n\nFor the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\".", + "async": false, + "alias": "cookies", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "addInitScript", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Adds a script which would be evaluated in one of the following scenarios:" + }, + { + "type": "li", + "text": "Whenever a page is created in the browser context or is navigated.", + "liType": "bullet" + }, + { + "type": "li", + "text": "Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script is↵evaluated in the context of the newly attached frame.", + "liType": "bullet" + }, + { + "type": "text", + "text": "The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend↵the JavaScript environment, e.g. to seed `Math.random`." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "An example of overriding `Math.random` before the page loads:" + }, + { + "type": "code", + "lines": [ + "// preload.js", + "Math.random = () => 42;" + ], + "codeLang": "js browser" + }, + { + "type": "code", + "lines": [ + "// In your playwright script, assuming the preload.js file is in same directory.", + "await browserContext.addInitScript({", + " path: 'preload.js'", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "// In your playwright script, assuming the preload.js file is in same directory.", + "browserContext.addInitScript(Paths.get(\"preload.js\"));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "# in your playwright script, assuming the preload.js file is in same directory.", + "await browser_context.add_init_script(path=\"preload.js\")" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "# in your playwright script, assuming the preload.js file is in same directory.", + "browser_context.add_init_script(path=\"preload.js\")" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "await context.AddInitScriptAsync(scriptPath: \"preload.js\");" + ], + "codeLang": "csharp" + }, + { + "type": "note", + "noteType": "note", + "text": "The order of evaluation of multiple scripts installed via [`method: BrowserContext.addInitScript`] and↵[`method: Page.addInitScript`] is not defined." + } + ], + "required": true, + "comment": "Adds a script which would be evaluated in one of the following scenarios:\n- Whenever a page is created in the browser context or is navigated.\n- Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script is\n evaluated in the context of the newly attached frame.\n\nThe script is evaluated after the document was created but before any of its scripts were run. This is useful to\namend the JavaScript environment, e.g. to seed `Math.random`.\n\n**Usage**\n\nAn example of overriding `Math.random` before the page loads:\n\n```js\n// preload.js\nMath.random = () => 42;\n```\n\n```js\n// In your playwright script, assuming the preload.js file is in same directory.\nawait browserContext.addInitScript({\n path: 'preload.js'\n});\n```\n\n```java\n// In your playwright script, assuming the preload.js file is in same directory.\nbrowserContext.addInitScript(Paths.get(\"preload.js\"));\n```\n\n```py\n# in your playwright script, assuming the preload.js file is in same directory.\nawait browser_context.add_init_script(path=\"preload.js\")\n```\n\n```py\n# in your playwright script, assuming the preload.js file is in same directory.\nbrowser_context.add_init_script(path=\"preload.js\")\n```\n\n```csharp\nawait context.AddInitScriptAsync(scriptPath: \"preload.js\");\n```\n\n**NOTE** The order of evaluation of multiple scripts installed via [`method: BrowserContext.addInitScript`] and\n[`method: Page.addInitScript`] is not defined.", + "async": true, + "alias": "addInitScript", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "script", + "type": { + "name": "", + "union": [ + { + "name": "function" + }, + { + "name": "string" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the↵current working directory. Optional." + } + ], + "required": false, + "comment": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "content", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Raw script content. Optional." + } + ], + "required": false, + "comment": "Raw script content. Optional.", + "async": false, + "alias": "content", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[function]|[string]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Script to be evaluated in all pages in the browser context." + } + ], + "required": true, + "comment": "Script to be evaluated in all pages in the browser context.", + "async": false, + "alias": "script", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "script", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "path" + } + ], + "expression": "[string]|[path]" + }, + "spec": [ + { + "type": "text", + "text": "Script to be evaluated in all pages in the browser context." + } + ], + "required": true, + "comment": "Script to be evaluated in all pages in the browser context.", + "async": false, + "alias": "script", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "arg", + "type": { + "name": "Serializable", + "expression": "[Serializable]" + }, + "spec": [ + { + "type": "text", + "text": "Optional argument to pass to `script` (only supported when passing a function)." + } + ], + "required": false, + "comment": "Optional argument to pass to `script` (only supported when passing a function).", + "async": false, + "alias": "arg", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional." + } + ], + "required": false, + "comment": "Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "script", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Script to be evaluated in all pages in the browser context. Optional." + } + ], + "required": false, + "comment": "Script to be evaluated in all pages in the browser context. Optional.", + "async": false, + "alias": "script", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.11", + "name": "backgroundPages", + "type": { + "name": "Array", + "templates": [ + { + "name": "Page" + } + ], + "expression": "[Array]<[Page]>" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "Background pages are only supported on Chromium-based browsers." + }, + { + "type": "text", + "text": "All existing background pages in the context." + } + ], + "required": true, + "comment": "**NOTE** Background pages are only supported on Chromium-based browsers.\n\nAll existing background pages in the context.", + "async": false, + "alias": "backgroundPages", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "browser", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Browser" + } + ], + "expression": "[null]|[Browser]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the browser instance of the context. If it was launched as a persistent context null gets returned." + } + ], + "required": true, + "comment": "Returns the browser instance of the context. If it was launched as a persistent context null gets returned.", + "async": false, + "alias": "browser", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "clearCookies", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Clears context cookies." + } + ], + "required": true, + "comment": "Clears context cookies.", + "async": true, + "alias": "clearCookies", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "clearPermissions", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Clears all permission overrides for the browser context." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "const context = await browser.newContext();", + "await context.grantPermissions(['clipboard-read']);", + "// do stuff ..", + "context.clearPermissions();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "BrowserContext context = browser.newContext();", + "context.grantPermissions(Arrays.asList(\"clipboard-read\"));", + "// do stuff ..", + "context.clearPermissions();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "context = await browser.new_context()", + "await context.grant_permissions([\"clipboard-read\"])", + "# do stuff ..", + "context.clear_permissions()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "context = browser.new_context()", + "context.grant_permissions([\"clipboard-read\"])", + "# do stuff ..", + "context.clear_permissions()" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var context = await browser.NewContextAsync();", + "await context.GrantPermissionsAsync(new[] { \"clipboard-read\" });", + "// Alternatively, you can use the helper class ContextPermissions", + "// to specify the permissions...", + "// do stuff ...", + "await context.ClearPermissionsAsync();" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Clears all permission overrides for the browser context.\n\n**Usage**\n\n```js\nconst context = await browser.newContext();\nawait context.grantPermissions(['clipboard-read']);\n// do stuff ..\ncontext.clearPermissions();\n```\n\n```java\nBrowserContext context = browser.newContext();\ncontext.grantPermissions(Arrays.asList(\"clipboard-read\"));\n// do stuff ..\ncontext.clearPermissions();\n```\n\n```py\ncontext = await browser.new_context()\nawait context.grant_permissions([\"clipboard-read\"])\n# do stuff ..\ncontext.clear_permissions()\n```\n\n```py\ncontext = browser.new_context()\ncontext.grant_permissions([\"clipboard-read\"])\n# do stuff ..\ncontext.clear_permissions()\n```\n\n```csharp\nvar context = await browser.NewContextAsync();\nawait context.GrantPermissionsAsync(new[] { \"clipboard-read\" });\n// Alternatively, you can use the helper class ContextPermissions\n// to specify the permissions...\n// do stuff ...\nawait context.ClearPermissionsAsync();\n```\n", + "async": true, + "alias": "clearPermissions", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Closes the browser context. All the pages that belong to the browser context will be closed." + }, + { + "type": "note", + "noteType": "note", + "text": "The default browser context cannot be closed." + } + ], + "required": true, + "comment": "Closes the browser context. All the pages that belong to the browser context will be closed.\n\n**NOTE** The default browser context cannot be closed.", + "async": true, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "cookies", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "domain", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "domain", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "expires", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Unix time in seconds." + } + ], + "required": true, + "comment": "Unix time in seconds.", + "async": false, + "alias": "expires", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "httpOnly", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "httpOnly", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "secure", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "secure", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "sameSite", + "type": { + "name": "SameSiteAttribute", + "union": [ + { + "name": "\"Strict\"" + }, + { + "name": "\"Lax\"" + }, + { + "name": "\"None\"" + } + ], + "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "sameSite", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs↵are returned." + } + ], + "required": true, + "comment": "If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those\nURLs are returned.", + "async": true, + "alias": "cookies", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "urls", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "Array", + "templates": [ + { + "name": "string" + } + ] + } + ], + "expression": "[string]|[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "Optional list of URLs." + } + ], + "required": false, + "comment": "Optional list of URLs.", + "async": false, + "alias": "urls", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "exposeBinding", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "The method adds a function called `name` on the `window` object of every frame in every page in the context.↵When called, the function executes `callback` and returns a [Promise] which resolves to the return value of↵`callback`. If the `callback` returns a [Promise], it will be awaited." + }, + { + "type": "text", + "text": "The first argument of the `callback` function contains information about the caller: `{ browserContext:↵BrowserContext, page: Page, frame: Frame }`." + }, + { + "type": "text", + "text": "See [`method: Page.exposeBinding`] for page-only version." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "An example of exposing page URL to all frames in all pages in the context:" + }, + { + "type": "code", + "lines": [ + "const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.", + "", + "(async () => {", + " const browser = await webkit.launch({ headless: false });", + " const context = await browser.newContext();", + " await context.exposeBinding('pageURL', ({ page }) => page.url());", + " const page = await context.newPage();", + " await page.setContent(`", + " ", + " ", + "
", + " `);", + " await page.getByRole('button').click();", + "})();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "import com.microsoft.playwright.*;", + "", + "public class Example {", + " public static void main(String[] args) {", + " try (Playwright playwright = Playwright.create()) {", + " BrowserType webkit = playwright.webkit()", + " Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));", + " BrowserContext context = browser.newContext();", + " context.exposeBinding(\"pageURL\", (source, args) -> source.page().url());", + " Page page = context.newPage();", + " page.setContent(\"\\n\" +", + " \"\\n\" +", + " \"
\");", + " page.getByRole(AriaRole.BUTTON).click();", + " }", + " }", + "}" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "import asyncio", + "from playwright.async_api import async_playwright, Playwright", + "", + "async def run(playwright: Playwright):", + " webkit = playwright.webkit", + " browser = await webkit.launch(headless=false)", + " context = await browser.new_context()", + " await context.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)", + " page = await context.new_page()", + " await page.set_content(\"\"\"", + " ", + " ", + "
", + " \"\"\")", + " await page.get_by_role(\"button\").click()", + "", + "async def main():", + " async with async_playwright() as playwright:", + " await run(playwright)", + "asyncio.run(main())" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "from playwright.sync_api import sync_playwright, Playwright", + "", + "def run(playwright: Playwright):", + " webkit = playwright.webkit", + " browser = webkit.launch(headless=false)", + " context = browser.new_context()", + " context.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)", + " page = context.new_page()", + " page.set_content(\"\"\"", + " ", + " ", + "
", + " \"\"\")", + " page.get_by_role(\"button\").click()", + "", + "with sync_playwright() as playwright:", + " run(playwright)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "using Microsoft.Playwright;", + "", + "using var playwright = await Playwright.CreateAsync();", + "var browser = await playwright.Webkit.LaunchAsync(new() { Headless = false });", + "var context = await browser.NewContextAsync();", + "", + "await context.ExposeBindingAsync(\"pageURL\", source => source.Page.Url);", + "var page = await context.NewPageAsync();", + "await page.SetContentAsync(\"\\n\" +", + "\"\\n\" +", + "\"
\");", + "await page.GetByRole(AriaRole.Button).ClickAsync();" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "An example of passing an element handle:" + }, + { + "type": "code", + "lines": [ + "await context.exposeBinding('clicked', async (source, element) => {", + " console.log(await element.textContent());", + "}, { handle: true });", + "await page.setContent(`", + " ", + "
Click me
", + "
Or click me
", + "`);" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "context.exposeBinding(\"clicked\", (source, args) -> {", + " ElementHandle element = (ElementHandle) args[0];", + " System.out.println(element.textContent());", + " return null;", + "}, new BrowserContext.ExposeBindingOptions().setHandle(true));", + "page.setContent(\"\" +", + " \"\\n\" +", + " \"
Click me
\\n\" +", + " \"
Or click me
\\n\");" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "async def print(source, element):", + " print(await element.text_content())", + "", + "await context.expose_binding(\"clicked\", print, handle=true)", + "await page.set_content(\"\"\"", + " ", + "
Click me
", + "
Or click me
", + "\"\"\")" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "def print(source, element):", + " print(element.text_content())", + "", + "context.expose_binding(\"clicked\", print, handle=true)", + "page.set_content(\"\"\"", + " ", + "
Click me
", + "
Or click me
", + "\"\"\")" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var result = new TaskCompletionSource();", + "var page = await Context.NewPageAsync();", + "await Context.ExposeBindingAsync(\"clicked\", async (BindingSource _, IJSHandle t) =>", + "{", + " return result.TrySetResult(await t.AsElement().TextContentAsync());", + "});", + "", + "await page.SetContentAsync(\"\\n\" +", + " \"
Click me
\\n\" +", + " \"
Or click me
\\n\");", + "", + "await page.ClickAsync(\"div\");", + "// Note: it makes sense to await the result here, because otherwise, the context", + "// gets closed and the binding function will throw an exception.", + "Assert.AreEqual(\"Click me\", await result.Task);" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "The method adds a function called `name` on the `window` object of every frame in every page in the context. When\ncalled, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.\nIf the `callback` returns a [Promise], it will be awaited.\n\nThe first argument of the `callback` function contains information about the caller: `{ browserContext:\nBrowserContext, page: Page, frame: Frame }`.\n\nSee [`method: Page.exposeBinding`] for page-only version.\n\n**Usage**\n\nAn example of exposing page URL to all frames in all pages in the context:\n\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\n\n(async () => {\n const browser = await webkit.launch({ headless: false });\n const context = await browser.newContext();\n await context.exposeBinding('pageURL', ({ page }) => page.url());\n const page = await context.newPage();\n await page.setContent(`\n \n \n
\n `);\n await page.getByRole('button').click();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType webkit = playwright.webkit()\n Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));\n BrowserContext context = browser.newContext();\n context.exposeBinding(\"pageURL\", (source, args) -> source.page().url());\n Page page = context.newPage();\n page.setContent(\"\\n\" +\n \"\\n\" +\n \"
\");\n page.getByRole(AriaRole.BUTTON).click();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch(headless=false)\n context = await browser.new_context()\n await context.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)\n page = await context.new_page()\n await page.set_content(\"\"\"\n \n \n
\n \"\"\")\n await page.get_by_role(\"button\").click()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch(headless=false)\n context = browser.new_context()\n context.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)\n page = context.new_page()\n page.set_content(\"\"\"\n \n \n
\n \"\"\")\n page.get_by_role(\"button\").click()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\n\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Webkit.LaunchAsync(new() { Headless = false });\nvar context = await browser.NewContextAsync();\n\nawait context.ExposeBindingAsync(\"pageURL\", source => source.Page.Url);\nvar page = await context.NewPageAsync();\nawait page.SetContentAsync(\"\\n\" +\n\"\\n\" +\n\"
\");\nawait page.GetByRole(AriaRole.Button).ClickAsync();\n```\n\nAn example of passing an element handle:\n\n```js\nawait context.exposeBinding('clicked', async (source, element) => {\n console.log(await element.textContent());\n}, { handle: true });\nawait page.setContent(`\n \n
Click me
\n
Or click me
\n`);\n```\n\n```java\ncontext.exposeBinding(\"clicked\", (source, args) -> {\n ElementHandle element = (ElementHandle) args[0];\n System.out.println(element.textContent());\n return null;\n}, new BrowserContext.ExposeBindingOptions().setHandle(true));\npage.setContent(\"\" +\n \"\\n\" +\n \"
Click me
\\n\" +\n \"
Or click me
\\n\");\n```\n\n```py\nasync def print(source, element):\n print(await element.text_content())\n\nawait context.expose_binding(\"clicked\", print, handle=true)\nawait page.set_content(\"\"\"\n \n
Click me
\n
Or click me
\n\"\"\")\n```\n\n```py\ndef print(source, element):\n print(element.text_content())\n\ncontext.expose_binding(\"clicked\", print, handle=true)\npage.set_content(\"\"\"\n \n
Click me
\n
Or click me
\n\"\"\")\n```\n\n```csharp\nvar result = new TaskCompletionSource();\nvar page = await Context.NewPageAsync();\nawait Context.ExposeBindingAsync(\"clicked\", async (BindingSource _, IJSHandle t) =>\n{\n return result.TrySetResult(await t.AsElement().TextContentAsync());\n});\n\nawait page.SetContentAsync(\"\\n\" +\n \"
Click me
\\n\" +\n \"
Or click me
\\n\");\n\nawait page.ClickAsync(\"div\");\n// Note: it makes sense to await the result here, because otherwise, the context\n// gets closed and the binding function will throw an exception.\nAssert.AreEqual(\"Click me\", await result.Task);\n```\n", + "async": true, + "alias": "exposeBinding", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Name of the function on the window object." + } + ], + "required": true, + "comment": "Name of the function on the window object.", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "callback", + "type": { + "name": "function", + "expression": "[function]" + }, + "spec": [ + { + "type": "text", + "text": "Callback function that will be called in the Playwright's context." + } + ], + "required": true, + "comment": "Callback function that will be called in the Playwright's context.", + "async": false, + "alias": "callback", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handle", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is↵supported. When passing by value, multiple arguments are supported." + } + ], + "required": false, + "comment": "Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is\nsupported. When passing by value, multiple arguments are supported.", + "async": false, + "alias": "handle", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "exposeFunction", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "The method adds a function called `name` on the `window` object of every frame in every page in the context.↵When called, the function executes `callback` and returns a [Promise] which resolves to the return value of↵`callback`." + }, + { + "type": "text", + "text": "If the `callback` returns a [Promise], it will be awaited." + }, + { + "type": "text", + "text": "See [`method: Page.exposeFunction`] for page-only version." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "An example of adding a `sha256` function to all pages in the context:" + }, + { + "type": "code", + "lines": [ + "const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.", + "const crypto = require('crypto');", + "", + "(async () => {", + " const browser = await webkit.launch({ headless: false });", + " const context = await browser.newContext();", + " await context.exposeFunction('sha256', text =>", + " crypto.createHash('sha256').update(text).digest('hex'),", + " );", + " const page = await context.newPage();", + " await page.setContent(`", + " ", + " ", + "
", + " `);", + " await page.getByRole('button').click();", + "})();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "import com.microsoft.playwright.*;", + "", + "import java.nio.charset.StandardCharsets;", + "import java.security.MessageDigest;", + "import java.security.NoSuchAlgorithmException;", + "import java.util.Base64;", + "", + "public class Example {", + " public static void main(String[] args) {", + " try (Playwright playwright = Playwright.create()) {", + " BrowserType webkit = playwright.webkit()", + " Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));", + " context.exposeFunction(\"sha256\", args -> {", + " String text = (String) args[0];", + " MessageDigest crypto;", + " try {", + " crypto = MessageDigest.getInstance(\"SHA-256\");", + " } catch (NoSuchAlgorithmException e) {", + " return null;", + " }", + " byte[] token = crypto.digest(text.getBytes(StandardCharsets.UTF_8));", + " return Base64.getEncoder().encodeToString(token);", + " });", + " Page page = context.newPage();", + " page.setContent(\"\\n\" +", + " \"\\n\" +", + " \"
\\n\");", + " page.getByRole(AriaRole.BUTTON).click();", + " }", + " }", + "}" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "import asyncio", + "import hashlib", + "from playwright.async_api import async_playwright, Playwright", + "", + "def sha256(text: str) -> str:", + " m = hashlib.sha256()", + " m.update(bytes(text, \"utf8\"))", + " return m.hexdigest()", + "", + "", + "async def run(playwright: Playwright):", + " webkit = playwright.webkit", + " browser = await webkit.launch(headless=False)", + " context = await browser.new_context()", + " await context.expose_function(\"sha256\", sha256)", + " page = await context.new_page()", + " await page.set_content(\"\"\"", + " ", + " ", + "
", + " \"\"\")", + " await page.get_by_role(\"button\").click()", + "", + "async def main():", + " async with async_playwright() as playwright:", + " await run(playwright)", + "asyncio.run(main())" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "import hashlib", + "from playwright.sync_api import sync_playwright", + "", + "def sha256(text: str) -> str:", + " m = hashlib.sha256()", + " m.update(bytes(text, \"utf8\"))", + " return m.hexdigest()", + "", + "", + "def run(playwright: Playwright):", + " webkit = playwright.webkit", + " browser = webkit.launch(headless=False)", + " context = browser.new_context()", + " context.expose_function(\"sha256\", sha256)", + " page = context.new_page()", + " page.set_content(\"\"\"", + " ", + " ", + "
", + " \"\"\")", + " page.get_by_role(\"button\").click()", + "", + "with sync_playwright() as playwright:", + " run(playwright)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "using Microsoft.Playwright;", + "using System;", + "using System.Security.Cryptography;", + "using System.Threading.Tasks;", + "", + "class BrowserContextExamples", + "{", + " public static async Task Main()", + " {", + " using var playwright = await Playwright.CreateAsync();", + " var browser = await playwright.Webkit.LaunchAsync(new() { Headless = false });", + " var context = await browser.NewContextAsync();", + "", + " await context.ExposeFunctionAsync(\"sha256\", (string input) =>", + " {", + " return Convert.ToBase64String(", + " SHA256.Create().ComputeHash(System.Text.Encoding.UTF8.GetBytes(input)));", + " });", + "", + " var page = await context.NewPageAsync();", + " await page.SetContentAsync(\"\\n\" +", + " \"\\n\" +", + " \"
\");", + "", + " await page.GetByRole(AriaRole.Button).ClickAsync();", + " Console.WriteLine(await page.TextContentAsync(\"div\"));", + " }", + "}" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "The method adds a function called `name` on the `window` object of every frame in every page in the context. When\ncalled, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.\n\nIf the `callback` returns a [Promise], it will be awaited.\n\nSee [`method: Page.exposeFunction`] for page-only version.\n\n**Usage**\n\nAn example of adding a `sha256` function to all pages in the context:\n\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\nconst crypto = require('crypto');\n\n(async () => {\n const browser = await webkit.launch({ headless: false });\n const context = await browser.newContext();\n await context.exposeFunction('sha256', text =>\n crypto.createHash('sha256').update(text).digest('hex'),\n );\n const page = await context.newPage();\n await page.setContent(`\n \n \n
\n `);\n await page.getByRole('button').click();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Base64;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType webkit = playwright.webkit()\n Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));\n context.exposeFunction(\"sha256\", args -> {\n String text = (String) args[0];\n MessageDigest crypto;\n try {\n crypto = MessageDigest.getInstance(\"SHA-256\");\n } catch (NoSuchAlgorithmException e) {\n return null;\n }\n byte[] token = crypto.digest(text.getBytes(StandardCharsets.UTF_8));\n return Base64.getEncoder().encodeToString(token);\n });\n Page page = context.newPage();\n page.setContent(\"\\n\" +\n \"\\n\" +\n \"
\\n\");\n page.getByRole(AriaRole.BUTTON).click();\n }\n }\n}\n```\n\n```py\nimport asyncio\nimport hashlib\nfrom playwright.async_api import async_playwright, Playwright\n\ndef sha256(text: str) -> str:\n m = hashlib.sha256()\n m.update(bytes(text, \"utf8\"))\n return m.hexdigest()\n\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch(headless=False)\n context = await browser.new_context()\n await context.expose_function(\"sha256\", sha256)\n page = await context.new_page()\n await page.set_content(\"\"\"\n \n \n
\n \"\"\")\n await page.get_by_role(\"button\").click()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nimport hashlib\nfrom playwright.sync_api import sync_playwright\n\ndef sha256(text: str) -> str:\n m = hashlib.sha256()\n m.update(bytes(text, \"utf8\"))\n return m.hexdigest()\n\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch(headless=False)\n context = browser.new_context()\n context.expose_function(\"sha256\", sha256)\n page = context.new_page()\n page.set_content(\"\"\"\n \n \n
\n \"\"\")\n page.get_by_role(\"button\").click()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System;\nusing System.Security.Cryptography;\nusing System.Threading.Tasks;\n\nclass BrowserContextExamples\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n var browser = await playwright.Webkit.LaunchAsync(new() { Headless = false });\n var context = await browser.NewContextAsync();\n\n await context.ExposeFunctionAsync(\"sha256\", (string input) =>\n {\n return Convert.ToBase64String(\n SHA256.Create().ComputeHash(System.Text.Encoding.UTF8.GetBytes(input)));\n });\n\n var page = await context.NewPageAsync();\n await page.SetContentAsync(\"\\n\" +\n \"\\n\" +\n \"
\");\n\n await page.GetByRole(AriaRole.Button).ClickAsync();\n Console.WriteLine(await page.TextContentAsync(\"div\"));\n }\n}\n```\n", + "async": true, + "alias": "exposeFunction", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Name of the function on the window object." + } + ], + "required": true, + "comment": "Name of the function on the window object.", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "callback", + "type": { + "name": "function", + "expression": "[function]" + }, + "spec": [ + { + "type": "text", + "text": "Callback function that will be called in the Playwright's context." + } + ], + "required": true, + "comment": "Callback function that will be called in the Playwright's context.", + "async": false, + "alias": "callback", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "grantPermissions", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if↵specified." + } + ], + "required": true, + "comment": "Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if\nspecified.", + "async": true, + "alias": "grantPermissions", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "permissions", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "A permission or an array of permissions to grant. Permissions can be one of the following values:" + }, + { + "type": "li", + "text": "`'geolocation'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'midi'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'midi-sysex'` (system-exclusive midi)", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'notifications'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'camera'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'microphone'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'background-sync'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'ambient-light-sensor'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'accelerometer'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'gyroscope'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'magnetometer'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'accessibility-events'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'clipboard-read'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'clipboard-write'`", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'payment-handler'`", + "liType": "bullet" + } + ], + "required": true, + "comment": "A permission or an array of permissions to grant. Permissions can be one of the following values:\n- `'geolocation'`\n- `'midi'`\n- `'midi-sysex'` (system-exclusive midi)\n- `'notifications'`\n- `'camera'`\n- `'microphone'`\n- `'background-sync'`\n- `'ambient-light-sensor'`\n- `'accelerometer'`\n- `'gyroscope'`\n- `'magnetometer'`\n- `'accessibility-events'`\n- `'clipboard-read'`\n- `'clipboard-write'`\n- `'payment-handler'`", + "async": false, + "alias": "permissions", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "The [origin] to grant permissions to, e.g. \"https://example.com\"." + } + ], + "required": false, + "comment": "The [origin] to grant permissions to, e.g. \"https://example.com\".", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "newCDPSession", + "type": { + "name": "CDPSession", + "expression": "[CDPSession]" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "CDP sessions are only supported on Chromium-based browsers." + }, + { + "type": "text", + "text": "Returns the newly created session." + } + ], + "required": true, + "comment": "**NOTE** CDP sessions are only supported on Chromium-based browsers.\n\nReturns the newly created session.", + "async": true, + "alias": "newCDPSession", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "page", + "type": { + "name": "", + "union": [ + { + "name": "Page" + }, + { + "name": "Frame" + } + ], + "expression": "[Page]|[Frame]" + }, + "spec": [ + { + "type": "text", + "text": "Target to create new session for. For backwards-compatibility, this parameter is↵named `page`, but it can be a `Page` or `Frame` type." + } + ], + "required": true, + "comment": "Target to create new session for. For backwards-compatibility, this parameter is named `page`, but it can be a\n`Page` or `Frame` type.", + "async": false, + "alias": "page", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "newPage", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "Creates a new page in the browser context." + } + ], + "required": true, + "comment": "Creates a new page in the browser context.", + "async": true, + "alias": "newPage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "pages", + "type": { + "name": "Array", + "templates": [ + { + "name": "Page" + } + ], + "expression": "[Array]<[Page]>" + }, + "spec": [ + { + "type": "text", + "text": "Returns all open pages in the context." + } + ], + "required": true, + "comment": "Returns all open pages in the context.", + "async": false, + "alias": "pages", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "property", + "langs": { + "aliases": { + "csharp": "APIRequest" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.16", + "name": "request", + "type": { + "name": "APIRequestContext", + "expression": "[APIRequestContext]" + }, + "spec": [ + { + "type": "text", + "text": "API testing helper associated with this context. Requests made with this API will use context cookies." + } + ], + "required": true, + "comment": "API testing helper associated with this context. Requests made with this API will use context cookies.", + "async": false, + "alias": "request", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "route", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Routing provides the capability to modify network requests that are made by any page in the browser context. Once route↵is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted." + }, + { + "type": "note", + "noteType": "note", + "text": "[`method: BrowserContext.route`] will not intercept requests intercepted by Service Worker. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "An example of a naive handler that aborts all image requests:" + }, + { + "type": "code", + "lines": [ + "const context = await browser.newContext();", + "await context.route('**/*.{png,jpg,jpeg}', route => route.abort());", + "const page = await context.newPage();", + "await page.goto('https://example.com');", + "await browser.close();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "BrowserContext context = browser.newContext();", + "context.route(\"**/*.{png,jpg,jpeg}\", route -> route.abort());", + "Page page = context.newPage();", + "page.navigate(\"https://example.com\");", + "browser.close();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "context = await browser.new_context()", + "page = await context.new_page()", + "await context.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())", + "await page.goto(\"https://example.com\")", + "await browser.close()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "context = browser.new_context()", + "page = context.new_page()", + "context.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())", + "page.goto(\"https://example.com\")", + "browser.close()" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var context = await browser.NewContextAsync();", + "var page = await context.NewPageAsync();", + "await context.RouteAsync(\"**/*.{png,jpg,jpeg}\", r => r.AbortAsync());", + "await page.GotoAsync(\"https://theverge.com\");", + "await browser.CloseAsync();" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "or the same snippet using a regex pattern instead:" + }, + { + "type": "code", + "lines": [ + "const context = await browser.newContext();", + "await context.route(/(\\.png$)|(\\.jpg$)/, route => route.abort());", + "const page = await context.newPage();", + "await page.goto('https://example.com');", + "await browser.close();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "BrowserContext context = browser.newContext();", + "context.route(Pattern.compile(\"(\\\\.png$)|(\\\\.jpg$)\"), route -> route.abort());", + "Page page = context.newPage();", + "page.navigate(\"https://example.com\");", + "browser.close();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "context = await browser.new_context()", + "page = await context.new_page()", + "await context.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())", + "page = await context.new_page()", + "await page.goto(\"https://example.com\")", + "await browser.close()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "context = browser.new_context()", + "page = context.new_page()", + "context.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())", + "page = await context.new_page()", + "page = context.new_page()", + "page.goto(\"https://example.com\")", + "browser.close()" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var context = await browser.NewContextAsync();", + "var page = await context.NewPageAsync();", + "await context.RouteAsync(new Regex(\"(\\\\.png$)|(\\\\.jpg$)\"), r => r.AbortAsync());", + "await page.GotoAsync(\"https://theverge.com\");", + "await browser.CloseAsync();" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "It is possible to examine the request to decide the route action. For example, mocking all requests that contain some post data, and leaving all other requests as is:" + }, + { + "type": "code", + "lines": [ + "await context.route('/api/**', route => {", + " if (route.request().postData().includes('my-string'))", + " route.fulfill({ body: 'mocked-data' });", + " else", + " route.continue();", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "context.route(\"/api/**\", route -> {", + " if (route.request().postData().contains(\"my-string\"))", + " route.fulfill(new Route.FulfillOptions().setBody(\"mocked-data\"));", + " else", + " route.resume();", + "});" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "def handle_route(route):", + " if (\"my-string\" in route.request.post_data):", + " route.fulfill(body=\"mocked-data\")", + " else:", + " route.continue_()", + "await context.route(\"/api/**\", handle_route)" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "def handle_route(route):", + " if (\"my-string\" in route.request.post_data):", + " route.fulfill(body=\"mocked-data\")", + " else:", + " route.continue_()", + "context.route(\"/api/**\", handle_route)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "await page.RouteAsync(\"/api/**\", async r =>", + "{", + " if (r.Request.PostData.Contains(\"my-string\"))", + " await r.FulfillAsync(body: \"mocked-data\");", + " else", + " await r.ContinueAsync();", + "});" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "Page routes (set up with [`method: Page.route`]) take precedence over browser context routes when request matches both↵handlers." + }, + { + "type": "text", + "text": "To remove a route with its handler you can use [`method: BrowserContext.unroute`]." + }, + { + "type": "note", + "noteType": "note", + "text": "Enabling routing disables http cache." + } + ], + "required": true, + "comment": "Routing provides the capability to modify network requests that are made by any page in the browser context. Once\nroute is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted.\n\n**NOTE** [`method: BrowserContext.route`] will not intercept requests intercepted by Service Worker. See\n[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when\nusing request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.\n\n**Usage**\n\nAn example of a naive handler that aborts all image requests:\n\n```js\nconst context = await browser.newContext();\nawait context.route('**/*.{png,jpg,jpeg}', route => route.abort());\nconst page = await context.newPage();\nawait page.goto('https://example.com');\nawait browser.close();\n```\n\n```java\nBrowserContext context = browser.newContext();\ncontext.route(\"**/*.{png,jpg,jpeg}\", route -> route.abort());\nPage page = context.newPage();\npage.navigate(\"https://example.com\");\nbrowser.close();\n```\n\n```py\ncontext = await browser.new_context()\npage = await context.new_page()\nawait context.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())\nawait page.goto(\"https://example.com\")\nawait browser.close()\n```\n\n```py\ncontext = browser.new_context()\npage = context.new_page()\ncontext.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())\npage.goto(\"https://example.com\")\nbrowser.close()\n```\n\n```csharp\nvar context = await browser.NewContextAsync();\nvar page = await context.NewPageAsync();\nawait context.RouteAsync(\"**/*.{png,jpg,jpeg}\", r => r.AbortAsync());\nawait page.GotoAsync(\"https://theverge.com\");\nawait browser.CloseAsync();\n```\n\nor the same snippet using a regex pattern instead:\n\n```js\nconst context = await browser.newContext();\nawait context.route(/(\\.png$)|(\\.jpg$)/, route => route.abort());\nconst page = await context.newPage();\nawait page.goto('https://example.com');\nawait browser.close();\n```\n\n```java\nBrowserContext context = browser.newContext();\ncontext.route(Pattern.compile(\"(\\\\.png$)|(\\\\.jpg$)\"), route -> route.abort());\nPage page = context.newPage();\npage.navigate(\"https://example.com\");\nbrowser.close();\n```\n\n```py\ncontext = await browser.new_context()\npage = await context.new_page()\nawait context.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())\npage = await context.new_page()\nawait page.goto(\"https://example.com\")\nawait browser.close()\n```\n\n```py\ncontext = browser.new_context()\npage = context.new_page()\ncontext.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())\npage = await context.new_page()\npage = context.new_page()\npage.goto(\"https://example.com\")\nbrowser.close()\n```\n\n```csharp\nvar context = await browser.NewContextAsync();\nvar page = await context.NewPageAsync();\nawait context.RouteAsync(new Regex(\"(\\\\.png$)|(\\\\.jpg$)\"), r => r.AbortAsync());\nawait page.GotoAsync(\"https://theverge.com\");\nawait browser.CloseAsync();\n```\n\nIt is possible to examine the request to decide the route action. For example, mocking all requests that contain\nsome post data, and leaving all other requests as is:\n\n```js\nawait context.route('/api/**', route => {\n if (route.request().postData().includes('my-string'))\n route.fulfill({ body: 'mocked-data' });\n else\n route.continue();\n});\n```\n\n```java\ncontext.route(\"/api/**\", route -> {\n if (route.request().postData().contains(\"my-string\"))\n route.fulfill(new Route.FulfillOptions().setBody(\"mocked-data\"));\n else\n route.resume();\n});\n```\n\n```py\ndef handle_route(route):\n if (\"my-string\" in route.request.post_data):\n route.fulfill(body=\"mocked-data\")\n else:\n route.continue_()\nawait context.route(\"/api/**\", handle_route)\n```\n\n```py\ndef handle_route(route):\n if (\"my-string\" in route.request.post_data):\n route.fulfill(body=\"mocked-data\")\n else:\n route.continue_()\ncontext.route(\"/api/**\", handle_route)\n```\n\n```csharp\nawait page.RouteAsync(\"/api/**\", async r =>\n{\n if (r.Request.PostData.Contains(\"my-string\"))\n await r.FulfillAsync(body: \"mocked-data\");\n else\n await r.ContinueAsync();\n});\n```\n\nPage routes (set up with [`method: Page.route`]) take precedence over browser context routes when request matches\nboth handlers.\n\nTo remove a route with its handler you can use [`method: BrowserContext.unroute`].\n\n**NOTE** Enabling routing disables http cache.", + "async": true, + "alias": "route", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "url", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + }, + { + "name": "function", + "args": [ + { + "name": "URL" + } + ], + "returnType": { + "name": "boolean" + } + } + ], + "expression": "[string]|[RegExp]|[function]([URL]):[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "A glob pattern, regex pattern or predicate receiving [URL] to match while routing.↵When a `baseURL` via the context options was provided and the passed URL is a path,↵it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor." + } + ], + "required": true, + "comment": "A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a `baseURL` via the context\noptions was provided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "handler", + "type": { + "name": "function", + "args": [ + { + "name": "Route" + }, + { + "name": "Request" + } + ], + "returnType": { + "name": "", + "union": [ + { + "name": "Promise", + "templates": [ + { + "name": "any" + } + ] + }, + { + "name": "any" + } + ] + }, + "expression": "[function]([Route], [Request]): [Promise|any]" + }, + "spec": [ + { + "type": "text", + "text": "handler function to route the request." + } + ], + "required": true, + "comment": "handler function to route the request.", + "async": false, + "alias": "handler", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "handler", + "type": { + "name": "function", + "args": [ + { + "name": "Route" + } + ], + "expression": "[function]([Route])" + }, + "spec": [ + { + "type": "text", + "text": "handler function to route the request." + } + ], + "required": true, + "comment": "handler function to route the request.", + "async": false, + "alias": "handler", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.15", + "name": "times", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "How often a route should be used. By default it will be used every time." + } + ], + "required": false, + "comment": "How often a route should be used. By default it will be used every time.", + "async": false, + "alias": "times", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.23", + "name": "routeFromHAR", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](../mock.md#replaying-from-har)." + }, + { + "type": "text", + "text": "Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`." + } + ], + "required": true, + "comment": "If specified the network requests that are made in the context will be served from the HAR file. Read more about\n[Replaying from HAR](../mock.md#replaying-from-har).\n\nPlaywright will not serve requests intercepted by Service Worker from the HAR file. See\n[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when\nusing request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.", + "async": true, + "alias": "routeFromHAR", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.23", + "name": "har", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a relative path, then it is resolved relative to the current working directory." + } + ], + "required": true, + "comment": "Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a\nrelative path, then it is resolved relative to the current working directory.", + "async": false, + "alias": "har", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.23", + "name": "notFound", + "type": { + "name": "HarNotFound", + "union": [ + { + "name": "\"abort\"" + }, + { + "name": "\"fallback\"" + } + ], + "expression": "[HarNotFound]<\"abort\"|\"fallback\">" + }, + "spec": [ + { + "type": "li", + "text": "If set to 'abort' any request not found in the HAR file will be aborted.", + "liType": "bullet" + }, + { + "type": "li", + "text": "If set to 'fallback' falls through to the next route handler in the handler chain.", + "liType": "bullet" + }, + { + "type": "text", + "text": "Defaults to abort." + } + ], + "required": false, + "comment": "- If set to 'abort' any request not found in the HAR file will be aborted.\n- If set to 'fallback' falls through to the next route handler in the handler chain.\n\nDefaults to abort.", + "async": false, + "alias": "notFound", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.23", + "name": "update", + "type": { + "name": "boolean", + "expression": "boolean" + }, + "spec": [ + { + "type": "text", + "text": "If specified, updates the given HAR with the actual network information instead of serving from file. The file is written to disk when [`method: BrowserContext.close`] is called." + } + ], + "required": false, + "comment": "If specified, updates the given HAR with the actual network information instead of serving from file. The file is\nwritten to disk when [`method: BrowserContext.close`] is called.", + "async": false, + "alias": "update", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.32", + "name": "updateContent", + "type": { + "name": "RouteFromHarUpdateContentPolicy", + "union": [ + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[RouteFromHarUpdateContentPolicy]<\"embed\"|\"attach\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control resource content management. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `attach` is specified, resources are persisted as\nseparate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file.", + "async": false, + "alias": "updateContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.32", + "name": "updateMode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ + { + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `minimal`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to\n`minimal`.", + "async": false, + "alias": "updateMode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.23", + "name": "url", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [ + { + "type": "text", + "text": "A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern will be served from the HAR file. If not specified, all requests are served from the HAR file." + } + ], + "required": false, + "comment": "A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the\npattern will be served from the HAR file. If not specified, all requests are served from the HAR file.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.11", + "name": "serviceWorkers", + "type": { + "name": "Array", + "templates": [ + { + "name": "Worker" + } + ], + "expression": "[Array]<[Worker]>" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "Service workers are only supported on Chromium-based browsers." + }, + { + "type": "text", + "text": "All existing service workers in the context." + } + ], + "required": true, + "comment": "**NOTE** Service workers are only supported on Chromium-based browsers.\n\nAll existing service workers in the context.", + "async": false, + "alias": "serviceWorkers", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "setDefaultNavigationTimeout", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "This setting will change the default maximum navigation time for the following methods and related shortcuts:" + }, + { + "type": "li", + "text": "[`method: Page.goBack`]", + "liType": "bullet" + }, + { + "type": "li", + "text": "[`method: Page.goForward`]", + "liType": "bullet" + }, + { + "type": "li", + "text": "[`method: Page.goto`]", + "liType": "bullet" + }, + { + "type": "li", + "text": "[`method: Page.reload`]", + "liType": "bullet" + }, + { + "type": "li", + "text": "[`method: Page.setContent`]", + "liType": "bullet" + }, + { + "type": "li", + "text": "[`method: Page.waitForNavigation`]", + "liType": "bullet" + }, + { + "type": "note", + "noteType": "note", + "text": "[`method: Page.setDefaultNavigationTimeout`] and [`method: Page.setDefaultTimeout`] take priority over↵[`method: BrowserContext.setDefaultNavigationTimeout`]." + } + ], + "required": true, + "comment": "This setting will change the default maximum navigation time for the following methods and related shortcuts:\n- [`method: Page.goBack`]\n- [`method: Page.goForward`]\n- [`method: Page.goto`]\n- [`method: Page.reload`]\n- [`method: Page.setContent`]\n- [`method: Page.waitForNavigation`]\n\n**NOTE** [`method: Page.setDefaultNavigationTimeout`] and [`method: Page.setDefaultTimeout`] take priority over\n[`method: BrowserContext.setDefaultNavigationTimeout`].", + "async": false, + "alias": "setDefaultNavigationTimeout", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum navigation time in milliseconds" + } + ], + "required": true, + "comment": "Maximum navigation time in milliseconds", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "setDefaultTimeout", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "This setting will change the default maximum time for all the methods accepting `timeout` option." + }, + { + "type": "note", + "noteType": "note", + "text": "[`method: Page.setDefaultNavigationTimeout`], [`method: Page.setDefaultTimeout`] and↵[`method: BrowserContext.setDefaultNavigationTimeout`] take priority over [`method: BrowserContext.setDefaultTimeout`]." + } + ], + "required": true, + "comment": "This setting will change the default maximum time for all the methods accepting `timeout` option.\n\n**NOTE** [`method: Page.setDefaultNavigationTimeout`], [`method: Page.setDefaultTimeout`] and\n[`method: BrowserContext.setDefaultNavigationTimeout`] take priority over\n[`method: BrowserContext.setDefaultTimeout`].", + "async": false, + "alias": "setDefaultTimeout", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds" + } + ], + "required": true, + "comment": "Maximum time in milliseconds", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "setExtraHTTPHeaders", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged↵with page-specific extra HTTP headers set with [`method: Page.setExtraHTTPHeaders`]. If page overrides a particular↵header, page-specific header value will be used instead of the browser context header value." + }, + { + "type": "note", + "noteType": "note", + "text": "[`method: BrowserContext.setExtraHTTPHeaders`] does not guarantee the order of headers in the outgoing requests." + } + ], + "required": true, + "comment": "The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are\nmerged with page-specific extra HTTP headers set with [`method: Page.setExtraHTTPHeaders`]. If page overrides a\nparticular header, page-specific header value will be used instead of the browser context header value.\n\n**NOTE** [`method: BrowserContext.setExtraHTTPHeaders`] does not guarantee the order of headers in the outgoing\nrequests.", + "async": true, + "alias": "setExtraHTTPHeaders", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "headers", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "An object containing additional HTTP headers to be sent with every request. All header values must be strings." + } + ], + "required": true, + "comment": "An object containing additional HTTP headers to be sent with every request. All header values must be strings.", + "async": false, + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "setGeolocation", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Sets the context's geolocation. Passing `null` or `undefined` emulates position unavailable." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "await browserContext.setGeolocation({ latitude: 59.95, longitude: 30.31667 });" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "browserContext.setGeolocation(new Geolocation(59.95, 30.31667));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "await browser_context.set_geolocation({\"latitude\": 59.95, \"longitude\": 30.31667})" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "browser_context.set_geolocation({\"latitude\": 59.95, \"longitude\": 30.31667})" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "await context.SetGeolocationAsync(new Geolocation()", + "{", + " Latitude = 59.95f,", + " Longitude = 30.31667f", + "});" + ], + "codeLang": "csharp" + }, + { + "type": "note", + "noteType": "note", + "text": "Consider using [`method: BrowserContext.grantPermissions`] to grant permissions for the browser context pages to read↵its geolocation." + } + ], + "required": true, + "comment": "Sets the context's geolocation. Passing `null` or `undefined` emulates position unavailable.\n\n**Usage**\n\n```js\nawait browserContext.setGeolocation({ latitude: 59.95, longitude: 30.31667 });\n```\n\n```java\nbrowserContext.setGeolocation(new Geolocation(59.95, 30.31667));\n```\n\n```py\nawait browser_context.set_geolocation({\"latitude\": 59.95, \"longitude\": 30.31667})\n```\n\n```py\nbrowser_context.set_geolocation({\"latitude\": 59.95, \"longitude\": 30.31667})\n```\n\n```csharp\nawait context.SetGeolocationAsync(new Geolocation()\n{\n Latitude = 59.95f,\n Longitude = 30.31667f\n});\n```\n\n**NOTE** Consider using [`method: BrowserContext.grantPermissions`] to grant permissions for the browser context\npages to read its geolocation.", + "async": true, + "alias": "setGeolocation", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "geolocation", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "latitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Latitude between -90 and 90." + } + ], + "required": true, + "comment": "Latitude between -90 and 90.", + "async": false, + "alias": "latitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "longitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Longitude between -180 and 180." + } + ], + "required": true, + "comment": "Longitude between -180 and 180.", + "async": false, + "alias": "longitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "accuracy", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Non-negative accuracy value. Defaults to `0`." + } + ], + "required": false, + "comment": "Non-negative accuracy value. Defaults to `0`.", + "async": false, + "alias": "accuracy", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [], + "required": true, + "comment": "", + "async": false, + "alias": "geolocation", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "deprecated": "Browsers may cache credentials after successful authentication. Create a new browser context instead.", + "name": "setHTTPCredentials", + "type": { + "name": "void" + }, + "spec": [], + "required": true, + "comment": "", + "async": true, + "alias": "setHTTPCredentials", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "httpCredentials", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [], + "required": true, + "comment": "", + "async": false, + "alias": "httpCredentials", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "setOffline", + "type": { + "name": "void" + }, + "spec": [], + "required": true, + "comment": "", + "async": true, + "alias": "setOffline", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "offline", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to emulate network being offline for the browser context." + } + ], + "required": true, + "comment": "Whether to emulate network being offline for the browser context.", + "async": false, + "alias": "offline", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "types": { + "csharp": { + "name": "string", + "expression": "[string]" + }, + "java": { + "name": "string", + "expression": "[string]" + } + } + }, + "experimental": false, + "since": "v1.8", + "name": "storageState", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "cookies", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "domain", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "domain", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "expires", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Unix time in seconds." + } + ], + "required": true, + "comment": "Unix time in seconds.", + "async": false, + "alias": "expires", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "httpOnly", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "httpOnly", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "secure", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "secure", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "sameSite", + "type": { + "name": "SameSiteAttribute", + "union": [ + { + "name": "\"Strict\"" + }, + { + "name": "\"Lax\"" + }, + { + "name": "\"None\"" + } + ], + "expression": "[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "sameSite", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "cookies", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origins", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "localStorage", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "value", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "value", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "localStorage", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "origins", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Returns storage state for this browser context, contains current cookies and local storage snapshot." + } + ], + "required": true, + "comment": "Returns storage state for this browser context, contains current cookies and local storage snapshot.", + "async": true, + "alias": "storageState", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to↵current working directory. If no path is provided, storage↵state is still returned, but won't be saved to the disk." + } + ], + "required": false, + "comment": "The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current\nworking directory. If no path is provided, storage state is still returned, but won't be saved to the disk.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "tracing", + "type": { + "name": "Tracing", + "expression": "[Tracing]" + }, + "spec": [], + "required": true, + "comment": "", + "async": false, + "alias": "tracing", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "unroute", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Removes a route created with [`method: BrowserContext.route`]. When `handler` is not specified, removes all↵routes for the `url`." + } + ], + "required": true, + "comment": "Removes a route created with [`method: BrowserContext.route`]. When `handler` is not specified, removes all routes\nfor the `url`.", + "async": true, + "alias": "unroute", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "url", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + }, + { + "name": "function", + "args": [ + { + "name": "URL" + } + ], + "returnType": { + "name": "boolean" + } + } + ], + "expression": "[string]|[RegExp]|[function]([URL]):[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with↵[`method: BrowserContext.route`]." + } + ], + "required": true, + "comment": "A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with\n[`method: BrowserContext.route`].", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "handler", + "type": { + "name": "function", + "args": [ + { + "name": "Route" + }, + { + "name": "Request" + } + ], + "returnType": { + "name": "", + "union": [ + { + "name": "Promise", + "templates": [ + { + "name": "any" + } + ] + }, + { + "name": "any" + } + ] + }, + "expression": "[function]([Route], [Request]): [Promise|any]" + }, + "spec": [ + { + "type": "text", + "text": "Optional handler function used to register a routing with [`method: BrowserContext.route`]." + } + ], + "required": false, + "comment": "Optional handler function used to register a routing with [`method: BrowserContext.route`].", + "async": false, + "alias": "handler", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "handler", + "type": { + "name": "function", + "args": [ + { + "name": "Route" + } + ], + "expression": "[function]([Route])" + }, + "spec": [ + { + "type": "text", + "text": "Optional handler function used to register a routing with [`method: BrowserContext.route`]." + } + ], + "required": false, + "comment": "Optional handler function used to register a routing with [`method: BrowserContext.route`].", + "async": false, + "alias": "handler", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.32", + "name": "waitForCondition", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "The method will block until the condition returns true. All Playwright events will↵be dispatched while the method is waiting for the condition." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "Use the method to wait for a condition that depends on page events:" + }, + { + "type": "code", + "lines": [ + "List failedUrls = new ArrayList<>();", + "context.onResponse(response -> {", + " if (!response.ok()) {", + " failedUrls.add(response.url());", + " }", + "});", + "page1.getByText(\"Create user\").click();", + "page2.getByText(\"Submit button\").click();", + "context.waitForCondition(() -> failedUrls.size() > 3);" + ], + "codeLang": "java" + } + ], + "required": true, + "comment": "The method will block until the condition returns true. All Playwright events will be dispatched while the method\nis waiting for the condition.\n\n**Usage**\n\nUse the method to wait for a condition that depends on page events:\n\n```java\nList failedUrls = new ArrayList<>();\ncontext.onResponse(response -> {\n if (!response.ok()) {\n failedUrls.add(response.url());\n }\n});\npage1.getByText(\"Create user\").click();\npage2.getByText(\"Submit button\").click();\ncontext.waitForCondition(() -> failedUrls.size() > 3);\n```\n", + "async": true, + "alias": "waitForCondition", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.32", + "name": "condition", + "type": { + "name": "BooleanSupplier", + "expression": "[BooleanSupplier]" + }, + "spec": [ + { + "type": "text", + "text": "Condition to wait for." + } + ], + "required": true, + "comment": "Condition to wait for.", + "async": false, + "alias": "condition", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "python", + "java", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.32", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default↵value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods." + } + ], + "required": false, + "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "java", + "python", + "csharp" + ], + "aliases": { + "python": "expect_console_message", + "csharp": "RunAndWaitForConsoleMessage" + }, + "types": { + "python": { + "name": "EventContextManager", + "templates": [ + { + "name": "ConsoleMessage" + } + ], + "expression": "[EventContextManager]<[ConsoleMessage]>" + } + }, + "overrides": {} + }, + "experimental": false, + "since": "v1.34", + "name": "waitForConsoleMessage", + "type": { + "name": "ConsoleMessage", + "expression": "[ConsoleMessage]" + }, + "spec": [ + { + "type": "text", + "text": "Performs action and waits for a `ConsoleMessage` to be logged by in the pages in the context. If predicate is provided, it passes↵`ConsoleMessage` value into the `predicate` function and waits for `predicate(message)` to return a truthy value.↵Will throw an error if the page is closed before the [`event: BrowserContext.console`] event is fired." + } + ], + "required": true, + "comment": "Performs action and waits for a `ConsoleMessage` to be logged by in the pages in the context. If predicate is\nprovided, it passes `ConsoleMessage` value into the `predicate` function and waits for `predicate(message)` to\nreturn a truthy value. Will throw an error if the page is closed before the [`event: BrowserContext.console`] event\nis fired.", + "async": true, + "alias": "waitForConsoleMessage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.34", + "name": "action", + "type": { + "name": "Func", + "templates": [ + { + "name": "Task" + } + ], + "expression": "[Func]" + }, + "spec": [ + { + "type": "text", + "text": "Action that triggers the event." + } + ], + "required": true, + "comment": "Action that triggers the event.", + "async": false, + "alias": "action", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.34", + "name": "predicate", + "type": { + "name": "function", + "args": [ + { + "name": "ConsoleMessage" + } + ], + "returnType": { + "name": "boolean" + }, + "expression": "[function]([ConsoleMessage]):[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Receives the `ConsoleMessage` object and resolves to truthy value when the waiting should resolve." + } + ], + "required": false, + "comment": "Receives the `ConsoleMessage` object and resolves to truthy value when the waiting should resolve.", + "async": false, + "alias": "predicate", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.34", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]." + } + ], + "required": false, + "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.34", + "name": "callback", + "type": { + "name": "Runnable", + "expression": "[Runnable]" + }, + "spec": [ + { + "type": "text", + "text": "Callback that performs the action triggering the event." + } + ], + "required": true, + "comment": "Callback that performs the action triggering the event.", + "async": false, + "alias": "callback", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": { + "python": "expect_event" + }, + "types": { + "python": { + "name": "EventContextManager", + "expression": "[EventContextManager]" + } + }, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "waitForEvent", + "type": { + "name": "any", + "expression": "[any]" + }, + "spec": [ + { + "type": "text", + "text": "Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy↵value. Will throw an error if the context closes before the event is fired. Returns the event data value." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "const pagePromise = context.waitForEvent('page');", + "await page.getByRole('button').click();", + "const page = await pagePromise;" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "Page newPage = context.waitForPage(() -> page.getByRole(AriaRole.BUTTON).click());" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "async with context.expect_event(\"page\") as event_info:", + " await page.get_by_role(\"button\").click()", + "page = await event_info.value" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "with context.expect_event(\"page\") as event_info:", + " page.get_by_role(\"button\").click()", + "page = event_info.value" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var page = await context.RunAndWaitForPageAsync(async () =>", + "{", + " await page.GetByRole(AriaRole.Button).ClickAsync();", + "});" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue. Will throw an error if the context closes before the event is fired. Returns the event data value.\n\n**Usage**\n\n```js\nconst pagePromise = context.waitForEvent('page');\nawait page.getByRole('button').click();\nconst page = await pagePromise;\n```\n\n```java\nPage newPage = context.waitForPage(() -> page.getByRole(AriaRole.BUTTON).click());\n```\n\n```py\nasync with context.expect_event(\"page\") as event_info:\n await page.get_by_role(\"button\").click()\npage = await event_info.value\n```\n\n```py\nwith context.expect_event(\"page\") as event_info:\n page.get_by_role(\"button\").click()\npage = event_info.value\n```\n\n```csharp\nvar page = await context.RunAndWaitForPageAsync(async () =>\n{\n await page.GetByRole(AriaRole.Button).ClickAsync();\n});\n```\n", + "async": true, + "alias": "waitForEvent", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "event", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Event name, same one would pass into `browserContext.on(event)`." + } + ], + "required": true, + "comment": "Event name, same one would pass into `browserContext.on(event)`.", + "async": false, + "alias": "event", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "optionsOrPredicate", + "type": { + "name": "", + "union": [ + { + "name": "function" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "predicate", + "type": { + "name": "function", + "expression": "[function]" + }, + "spec": [ + { + "type": "text", + "text": "Receives the event data and resolves to truthy value when the waiting should resolve." + } + ], + "required": true, + "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", + "async": false, + "alias": "predicate", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] method." + } + ], + "required": false, + "comment": "Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] method.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[function]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Either a predicate that receives an event or an options object. Optional." + } + ], + "required": false, + "comment": "Either a predicate that receives an event or an options object. Optional.", + "async": false, + "alias": "optionsOrPredicate", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "predicate", + "type": { + "name": "function", + "expression": "[function]" + }, + "spec": [ + { + "type": "text", + "text": "Receives the event data and resolves to truthy value when the waiting should resolve." + } + ], + "required": false, + "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", + "async": false, + "alias": "predicate", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]." + } + ], + "required": false, + "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "java", + "python", + "csharp" + ], + "aliases": { + "python": "expect_page", + "csharp": "RunAndWaitForPage" + }, + "types": { + "python": { + "name": "EventContextManager", + "templates": [ + { + "name": "Page" + } + ], + "expression": "[EventContextManager]<[Page]>" + } + }, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "waitForPage", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "Performs action and waits for a new `Page` to be created in the context. If predicate is provided, it passes↵`Page` value into the `predicate` function and waits for `predicate(event)` to return a truthy value.↵Will throw an error if the context closes before new `Page` is created." + } + ], + "required": true, + "comment": "Performs action and waits for a new `Page` to be created in the context. If predicate is provided, it passes `Page`\nvalue into the `predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error\nif the context closes before new `Page` is created.", + "async": true, + "alias": "waitForPage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.12", + "name": "action", + "type": { + "name": "Func", + "templates": [ + { + "name": "Task" + } + ], + "expression": "[Func]" + }, + "spec": [ + { + "type": "text", + "text": "Action that triggers the event." + } + ], + "required": true, + "comment": "Action that triggers the event.", + "async": false, + "alias": "action", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "predicate", + "type": { + "name": "function", + "args": [ + { + "name": "Page" + } + ], + "returnType": { + "name": "boolean" + }, + "expression": "[function]([Page]):[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Receives the `Page` object and resolves to truthy value when the waiting should resolve." + } + ], + "required": false, + "comment": "Receives the `Page` object and resolves to truthy value when the waiting should resolve.", + "async": false, + "alias": "predicate", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]." + } + ], + "required": false, + "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "callback", + "type": { + "name": "Runnable", + "expression": "[Runnable]" + }, + "spec": [ + { + "type": "text", + "text": "Callback that performs the action triggering the event." + } + ], + "required": true, + "comment": "Callback that performs the action triggering the event.", + "async": false, + "alias": "callback", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "python" + ], + "aliases": { + "python": "wait_for_event" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "waitForEvent2", + "type": { + "name": "any", + "expression": "[any]" + }, + "spec": [ + { + "type": "note", + "noteType": "note", + "text": "In most cases, you should use [`method: BrowserContext.waitForEvent`]." + }, + { + "type": "text", + "text": "Waits for given `event` to fire. If predicate is provided, it passes↵event's value into the `predicate` function and waits for `predicate(event)` to return a truthy value.↵Will throw an error if the browser context is closed before the `event` is fired." + } + ], + "required": true, + "comment": "**NOTE** In most cases, you should use [`method: BrowserContext.waitForEvent`].\n\nWaits for given `event` to fire. If predicate is provided, it passes event's value into the `predicate` function\nand waits for `predicate(event)` to return a truthy value. Will throw an error if the browser context is closed\nbefore the `event` is fired.", + "async": true, + "alias": "waitForEvent2", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "event", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Event name, same one typically passed into `*.on(event)`." + } + ], + "required": true, + "comment": "Event name, same one typically passed into `*.on(event)`.", + "async": false, + "alias": "event", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "predicate", + "type": { + "name": "function", + "expression": "[function]" + }, + "spec": [ + { + "type": "text", + "text": "Receives the event data and resolves to truthy value when the waiting should resolve." + } + ], + "required": false, + "comment": "Receives the event data and resolves to truthy value when the waiting should resolve.", + "async": false, + "alias": "predicate", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]." + } + ], + "required": false, + "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + }, + { + "name": "BrowserServer", + "spec": [], + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "since": "v1.8", + "members": [ + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Emitted when the browser server closes." + } + ], + "required": true, + "comment": "Emitted when the browser server closes.", + "async": false, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Closes the browser gracefully and makes sure the process is terminated." + } + ], + "required": true, + "comment": "Closes the browser gracefully and makes sure the process is terminated.", + "async": true, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "kill", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Kills the browser process and waits for the process to exit." + } + ], + "required": true, + "comment": "Kills the browser process and waits for the process to exit.", + "async": true, + "alias": "kill", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "process", + "type": { + "name": "ChildProcess", + "expression": "[ChildProcess]" + }, + "spec": [ + { + "type": "text", + "text": "Spawned browser application process." + } + ], + "required": true, + "comment": "Spawned browser application process.", + "async": false, + "alias": "process", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "wsEndpoint", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Browser websocket url." + }, + { + "type": "text", + "text": "Browser websocket endpoint which can be used as an argument to [`method: BrowserType.connect`] to establish connection↵to the browser." + } + ], + "required": true, + "comment": "Browser websocket url.\n\nBrowser websocket endpoint which can be used as an argument to [`method: BrowserType.connect`] to establish\nconnection to the browser.", + "async": false, + "alias": "wsEndpoint", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "BrowserType", + "spec": [ + { + "type": "text", + "text": "BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is a↵typical example of using Playwright to drive automation:" + }, + { + "type": "code", + "lines": [ + "const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.", + "", + "(async () => {", + " const browser = await chromium.launch();", + " const page = await browser.newPage();", + " await page.goto('https://example.com');", + " // other actions...", + " await browser.close();", + "})();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "import com.microsoft.playwright.*;", + "", + "public class Example {", + " public static void main(String[] args) {", + " try (Playwright playwright = Playwright.create()) {", + " BrowserType chromium = playwright.chromium();", + " Browser browser = chromium.launch();", + " Page page = browser.newPage();", + " page.navigate(\"https://example.com\");", + " // other actions...", + " browser.close();", + " }", + " }", + "}" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "import asyncio", + "from playwright.async_api import async_playwright, Playwright", + "", + "async def run(playwright: Playwright):", + " chromium = playwright.chromium", + " browser = await chromium.launch()", + " page = await browser.new_page()", + " await page.goto(\"https://example.com\")", + " # other actions...", + " await browser.close()", + "", + "async def main():", + " async with async_playwright() as playwright:", + " await run(playwright)", + "asyncio.run(main())" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "from playwright.sync_api import sync_playwright, Playwright", + "", + "def run(playwright: Playwright):", + " chromium = playwright.chromium", + " browser = chromium.launch()", + " page = browser.new_page()", + " page.goto(\"https://example.com\")", + " # other actions...", + " browser.close()", + "", + "with sync_playwright() as playwright:", + " run(playwright)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "using Microsoft.Playwright;", + "using System.Threading.Tasks;", + "", + "class BrowserTypeExamples", + "{", + " public static async Task Run()", + " {", + " using var playwright = await Playwright.CreateAsync();", + " var chromium = playwright.Chromium;", + " var browser = await chromium.LaunchAsync();", + " var page = await browser.NewPageAsync();", + " await page.GotoAsync(\"https://www.bing.com\");", + " // other actions", + " await browser.CloseAsync();", + " }", + "}" + ], + "codeLang": "csharp" + } + ], + "langs": {}, + "comment": "BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is\na typical example of using Playwright to drive automation:\n\n```js\nconst { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n await page.goto('https://example.com');\n // other actions...\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType chromium = playwright.chromium();\n Browser browser = chromium.launch();\n Page page = browser.newPage();\n page.navigate(\"https://example.com\");\n // other actions...\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n chromium = playwright.chromium\n browser = await chromium.launch()\n page = await browser.new_page()\n await page.goto(\"https://example.com\")\n # other actions...\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n chromium = playwright.chromium\n browser = chromium.launch()\n page = browser.new_page()\n page.goto(\"https://example.com\")\n # other actions...\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass BrowserTypeExamples\n{\n public static async Task Run()\n {\n using var playwright = await Playwright.CreateAsync();\n var chromium = playwright.Chromium;\n var browser = await chromium.LaunchAsync();\n var page = await browser.NewPageAsync();\n await page.GotoAsync(\"https://www.bing.com\");\n // other actions\n await browser.CloseAsync();\n }\n}\n```\n", + "since": "v1.8", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "connect", + "type": { + "name": "Browser", + "expression": "[Browser]" + }, + "spec": [ + { + "type": "text", + "text": "This method attaches Playwright to an existing browser instance. When connecting to another browser launched via `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is compatible with 1.2.x)." + } + ], + "required": true, + "comment": "This method attaches Playwright to an existing browser instance. When connecting to another browser launched via\n`BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is\ncompatible with 1.2.x).", + "async": true, + "alias": "connect", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.10", + "name": "wsEndpoint", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "A browser websocket endpoint to connect to." + } + ], + "required": true, + "comment": "A browser websocket endpoint to connect to.", + "async": false, + "alias": "wsEndpoint", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.37", + "name": "exposeNetwork", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "This option exposes network available on the connecting client to the browser being connected to. Consists of a list of rules separated by comma." + }, + { + "type": "text", + "text": "Available rules:" + }, + { + "type": "li", + "text": "Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "`` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`.", + "liType": "ordinal" + }, + { + "type": "text", + "text": "Some common examples:" + }, + { + "type": "li", + "text": "`\"*\"` to expose all network.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "`\"\"` to expose localhost network.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "`\"*.test.internal-domain,*.staging.internal-domain,\"` to expose test/staging deployments and localhost.", + "liType": "ordinal" + } + ], + "required": false, + "comment": "This option exposes network available on the connecting client to the browser being connected to. Consists of a\nlist of rules separated by comma.\n\nAvailable rules:\n1. Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`.\n1. IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`.\n1. `` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`.\n\nSome common examples:\n1. `\"*\"` to expose all network.\n1. `\"\"` to expose localhost network.\n1. `\"*.test.internal-domain,*.staging.internal-domain,\"` to expose test/staging deployments and\n localhost.", + "async": false, + "alias": "exposeNetwork", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "headers", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Additional HTTP headers to be sent with web socket connect request. Optional." + } + ], + "required": false, + "comment": "Additional HTTP headers to be sent with web socket connect request. Optional.", + "async": false, + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.14", + "name": "logger", + "type": { + "name": "Logger", + "expression": "[Logger]" + }, + "spec": [ + { + "type": "text", + "text": "Logger sink for Playwright logging. Optional." + } + ], + "required": false, + "comment": "Logger sink for Playwright logging. Optional.", + "async": false, + "alias": "logger", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.10", + "name": "slowMo", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you↵can see what is going on. Defaults to 0." + } + ], + "required": false, + "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non. Defaults to 0.", + "async": false, + "alias": "slowMo", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.10", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds to wait for the connection to be established. Defaults to↵`0` (no timeout)." + } + ], + "required": false, + "comment": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `0` (no timeout).", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "connectOverCDP", + "type": { + "name": "Browser", + "expression": "[Browser]" + }, + "spec": [ + { + "type": "text", + "text": "This method attaches Playwright to an existing browser instance using the Chrome DevTools Protocol." + }, + { + "type": "text", + "text": "The default browser context is accessible via [`method: Browser.contexts`]." + }, + { + "type": "note", + "noteType": "note", + "text": "Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "const browser = await playwright.chromium.connectOverCDP('http://localhost:9222');", + "const defaultContext = browser.contexts()[0];", + "const page = defaultContext.pages()[0];" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "Browser browser = playwright.chromium().connectOverCDP(\"http://localhost:9222\");", + "BrowserContext defaultContext = browser.contexts().get(0);", + "Page page = defaultContext.pages().get(0);" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "browser = await playwright.chromium.connect_over_cdp(\"http://localhost:9222\")", + "default_context = browser.contexts[0]", + "page = default_context.pages[0]" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "browser = playwright.chromium.connect_over_cdp(\"http://localhost:9222\")", + "default_context = browser.contexts[0]", + "page = default_context.pages[0]" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var browser = await playwright.Chromium.ConnectOverCDPAsync(\"http://localhost:9222\");", + "var defaultContext = browser.Contexts[0];", + "var page = defaultContext.Pages[0];" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "This method attaches Playwright to an existing browser instance using the Chrome DevTools Protocol.\n\nThe default browser context is accessible via [`method: Browser.contexts`].\n\n**NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.\n\n**Usage**\n\n```js\nconst browser = await playwright.chromium.connectOverCDP('http://localhost:9222');\nconst defaultContext = browser.contexts()[0];\nconst page = defaultContext.pages()[0];\n```\n\n```java\nBrowser browser = playwright.chromium().connectOverCDP(\"http://localhost:9222\");\nBrowserContext defaultContext = browser.contexts().get(0);\nPage page = defaultContext.pages().get(0);\n```\n\n```py\nbrowser = await playwright.chromium.connect_over_cdp(\"http://localhost:9222\")\ndefault_context = browser.contexts[0]\npage = default_context.pages[0]\n```\n\n```py\nbrowser = playwright.chromium.connect_over_cdp(\"http://localhost:9222\")\ndefault_context = browser.contexts[0]\npage = default_context.pages[0]\n```\n\n```csharp\nvar browser = await playwright.Chromium.ConnectOverCDPAsync(\"http://localhost:9222\");\nvar defaultContext = browser.Contexts[0];\nvar page = defaultContext.Pages[0];\n```\n", + "async": true, + "alias": "connectOverCDP", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "endpointURL", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "A CDP websocket endpoint or http url to connect to. For example `http://localhost:9222/` or `ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4`." + } + ], + "required": true, + "comment": "A CDP websocket endpoint or http url to connect to. For example `http://localhost:9222/` or\n`ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4`.", + "async": false, + "alias": "endpointURL", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.14", + "name": "endpointURL", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Deprecated, use the first argument instead. Optional." + } + ], + "required": false, + "comment": "Deprecated, use the first argument instead. Optional.", + "async": false, + "alias": "endpointURL", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "headers", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Additional HTTP headers to be sent with connect request. Optional." + } + ], + "required": false, + "comment": "Additional HTTP headers to be sent with connect request. Optional.", + "async": false, + "alias": "headers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.14", + "name": "logger", + "type": { + "name": "Logger", + "expression": "[Logger]" + }, + "spec": [ + { + "type": "text", + "text": "Logger sink for Playwright logging. Optional." + } + ], + "required": false, + "comment": "Logger sink for Playwright logging. Optional.", + "async": false, + "alias": "logger", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "slowMo", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you↵can see what is going on. Defaults to 0." + } + ], + "required": false, + "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non. Defaults to 0.", + "async": false, + "alias": "slowMo", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds to wait for the connection to be established. Defaults to↵`30000` (30 seconds). Pass `0` to disable timeout." + } + ], + "required": false, + "comment": "Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass\n`0` to disable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "executablePath", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "A path where Playwright expects to find a bundled browser executable." + } + ], + "required": true, + "comment": "A path where Playwright expects to find a bundled browser executable.", + "async": false, + "alias": "executablePath", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "launch", + "type": { + "name": "Browser", + "expression": "[Browser]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the browser instance." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "You can use `ignoreDefaultArgs` to filter out `--mute-audio` from default arguments:" + }, + { + "type": "code", + "lines": [ + "const browser = await chromium.launch({ // Or 'firefox' or 'webkit'.", + " ignoreDefaultArgs: ['--mute-audio']", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "// Or \"firefox\" or \"webkit\".", + "Browser browser = chromium.launch(new BrowserType.LaunchOptions()", + " .setIgnoreDefaultArgs(Arrays.asList(\"--mute-audio\")));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "browser = await playwright.chromium.launch( # or \"firefox\" or \"webkit\".", + " ignore_default_args=[\"--mute-audio\"]", + ")" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "browser = playwright.chromium.launch( # or \"firefox\" or \"webkit\".", + " ignore_default_args=[\"--mute-audio\"]", + ")" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var browser = await playwright.Chromium.LaunchAsync(new() {", + " IgnoreDefaultArgs = new[] { \"--mute-audio\" }", + "});" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "> **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works best with the version of↵Chromium it is bundled with. There is no guarantee it will work with any other version. Use `executablePath`↵option with extreme caution." + }, + { + "type": "text", + "text": ">" + }, + { + "type": "text", + "text": "> If Google Chrome (rather than Chromium) is preferred, a↵[Chrome Canary](https://www.google.com/chrome/browser/canary.html) or↵[Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested." + }, + { + "type": "text", + "text": ">" + }, + { + "type": "text", + "text": "> Stock browsers like Google Chrome and Microsoft Edge are suitable for tests that require proprietary media codecs for video playback. See [this article](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for other differences between Chromium and Chrome.↵[This article](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md)↵describes some differences for Linux users." + } + ], + "required": true, + "comment": "Returns the browser instance.\n\n**Usage**\n\nYou can use `ignoreDefaultArgs` to filter out `--mute-audio` from default arguments:\n\n```js\nconst browser = await chromium.launch({ // Or 'firefox' or 'webkit'.\n ignoreDefaultArgs: ['--mute-audio']\n});\n```\n\n```java\n// Or \"firefox\" or \"webkit\".\nBrowser browser = chromium.launch(new BrowserType.LaunchOptions()\n .setIgnoreDefaultArgs(Arrays.asList(\"--mute-audio\")));\n```\n\n```py\nbrowser = await playwright.chromium.launch( # or \"firefox\" or \"webkit\".\n ignore_default_args=[\"--mute-audio\"]\n)\n```\n\n```py\nbrowser = playwright.chromium.launch( # or \"firefox\" or \"webkit\".\n ignore_default_args=[\"--mute-audio\"]\n)\n```\n\n```csharp\nvar browser = await playwright.Chromium.LaunchAsync(new() {\n IgnoreDefaultArgs = new[] { \"--mute-audio\" }\n});\n```\n\n> **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it\nworks best with the version of Chromium it is bundled with. There is no guarantee it will work with any other\nversion. Use `executablePath` option with extreme caution.\n>\n> If Google Chrome (rather than Chromium) is preferred, a\n[Chrome Canary](https://www.google.com/chrome/browser/canary.html) or\n[Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested.\n>\n> Stock browsers like Google Chrome and Microsoft Edge are suitable for tests that require proprietary media codecs\nfor video playback. See\n[this article](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for\nother differences between Chromium and Chrome.\n[This article](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md)\ndescribes some differences for Linux users.", + "async": true, + "alias": "launch", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "args", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](http://peter.sh/experiments/chromium-command-line-switches/)." + } + ], + "required": false, + "comment": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](http://peter.sh/experiments/chromium-command-line-switches/).", + "async": false, + "alias": "args", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "channel", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." + } + ], + "required": false, + "comment": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", + "async": false, + "alias": "channel", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "chromiumSandbox", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Enable Chromium sandboxing. Defaults to `false`." + } + ], + "required": false, + "comment": "Enable Chromium sandboxing. Defaults to `false`.", + "async": false, + "alias": "chromiumSandbox", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "devtools", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the↵`headless` option will be set `false`." + } + ], + "required": false, + "comment": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the\n`headless` option will be set `false`.", + "async": false, + "alias": "devtools", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "downloadsPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is↵deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in↵is closed." + } + ], + "required": false, + "comment": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and\nis deleted when browser is closed. In either case, the downloads are deleted when the browser context they were\ncreated in is closed.", + "async": false, + "alias": "downloadsPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "env", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`." + } + ], + "required": false, + "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", + "async": false, + "alias": "env", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "env", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`." + } + ], + "required": false, + "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", + "async": false, + "alias": "env", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "executablePath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then↵it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,↵Firefox or WebKit, use at your own risk." + } + ], + "required": false, + "comment": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,\nFirefox or WebKit, use at your own risk.", + "async": false, + "alias": "executablePath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "firefoxUserPrefs", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)." + } + ], + "required": false, + "comment": "Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", + "async": false, + "alias": "firefoxUserPrefs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "firefoxUserPrefs", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "any" + } + ], + "expression": "[Object]<[string], [any]>" + }, + "spec": [ + { + "type": "text", + "text": "Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)." + } + ], + "required": false, + "comment": "Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", + "async": false, + "alias": "firefoxUserPrefs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGHUP", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on SIGHUP. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on SIGHUP. Defaults to `true`.", + "async": false, + "alias": "handleSIGHUP", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGINT", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on Ctrl-C. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on Ctrl-C. Defaults to `true`.", + "async": false, + "alias": "handleSIGINT", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGTERM", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on SIGTERM. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on SIGTERM. Defaults to `true`.", + "async": false, + "alias": "handleSIGTERM", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "headless", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to run browser in headless mode. More details for↵[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and↵[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the↵`devtools` option is `true`." + } + ], + "required": false, + "comment": "Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.", + "async": false, + "alias": "headless", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "ignoreAllDefaultArgs", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`.↵Dangerous option; use with care. Defaults to `false`." + } + ], + "required": false, + "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous\noption; use with care. Defaults to `false`.", + "async": false, + "alias": "ignoreAllDefaultArgs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "ignoreDefaultArgs", + "type": { + "name": "", + "union": [ + { + "name": "boolean" + }, + { + "name": "Array", + "templates": [ + { + "name": "string" + } + ] + } + ], + "expression": "[boolean]|[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an↵array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`." + } + ], + "required": false, + "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", + "async": false, + "alias": "ignoreDefaultArgs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "ignoreDefaultArgs", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`.↵Dangerous option; use with care." + } + ], + "required": false, + "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous\noption; use with care.", + "async": false, + "alias": "ignoreDefaultArgs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "logger", + "type": { + "name": "Logger", + "expression": "[Logger]" + }, + "spec": [ + { + "type": "text", + "text": "Logger sink for Playwright logging." + } + ], + "required": false, + "comment": "Logger sink for Playwright logging.", + "async": false, + "alias": "logger", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "proxy", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "server", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy." + } + ], + "required": true, + "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", + "async": false, + "alias": "server", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "bypass", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`." + } + ], + "required": false, + "comment": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", + "async": false, + "alias": "bypass", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional username to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional username to use if HTTP proxy requires authentication.", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional password to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional password to use if HTTP proxy requires authentication.", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Network proxy settings." + } + ], + "required": false, + "comment": "Network proxy settings.", + "async": false, + "alias": "proxy", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "slowMo", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on." + } + ], + "required": false, + "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non.", + "async": false, + "alias": "slowMo", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout." + } + ], + "required": false, + "comment": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`\nto disable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "tracesDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "If specified, traces are saved into this directory." + } + ], + "required": false, + "comment": "If specified, traces are saved into this directory.", + "async": false, + "alias": "tracesDir", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "launchPersistentContext", + "type": { + "name": "BrowserContext", + "expression": "[BrowserContext]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the persistent browser context instance." + }, + { + "type": "text", + "text": "Launches browser that uses persistent storage located at `userDataDir` and returns the only context. Closing↵this context will automatically close the browser." + } + ], + "required": true, + "comment": "Returns the persistent browser context instance.\n\nLaunches browser that uses persistent storage located at `userDataDir` and returns the only context. Closing this\ncontext will automatically close the browser.", + "async": true, + "alias": "launchPersistentContext", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "userDataDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for↵[Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and↵[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile).↵Note that Chromium's user data directory is the **parent** directory of the \"Profile Path\" seen at `chrome://version`. Pass an empty string to↵use a temporary directory instead." + } + ], + "required": true, + "comment": "Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for\n[Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). Note that Chromium's\nuser data directory is the **parent** directory of the \"Profile Path\" seen at `chrome://version`. Pass an empty\nstring to use a temporary directory instead.", + "async": false, + "alias": "userDataDir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "acceptDownloads", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted." + } + ], + "required": false, + "comment": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.", + "async": false, + "alias": "acceptDownloads", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "args", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](http://peter.sh/experiments/chromium-command-line-switches/)." + } + ], + "required": false, + "comment": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](http://peter.sh/experiments/chromium-command-line-switches/).", + "async": false, + "alias": "args", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "baseURL", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`], [`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`", + "liType": "bullet" + }, + { + "type": "li", + "text": "baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`", + "liType": "bullet" + } + ], + "required": false, + "comment": "When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`],\n[`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by\nusing the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the\ncorresponding URL. Unset by default. Examples:\n- baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`", + "async": false, + "alias": "baseURL", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "bypassCSP", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`." + } + ], + "required": false, + "comment": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`.", + "async": false, + "alias": "bypassCSP", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "channel", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." + } + ], + "required": false, + "comment": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", + "async": false, + "alias": "channel", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "chromiumSandbox", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Enable Chromium sandboxing. Defaults to `false`." + } + ], + "required": false, + "comment": "Enable Chromium sandboxing. Defaults to `false`.", + "async": false, + "alias": "chromiumSandbox", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "colorScheme", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.", + "async": false, + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "colorScheme", + "type": { + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'light'`.", + "async": false, + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "deviceScaleFactor", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about [emulating devices with device scale factor](../emulation.md#devices)." + } + ], + "required": false, + "comment": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](../emulation.md#devices).", + "async": false, + "alias": "deviceScaleFactor", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "devtools", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the↵`headless` option will be set `false`." + } + ], + "required": false, + "comment": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the\n`headless` option will be set `false`.", + "async": false, + "alias": "devtools", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "downloadsPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is↵deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in↵is closed." + } + ], + "required": false, + "comment": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and\nis deleted when browser is closed. In either case, the downloads are deleted when the browser context they were\ncreated in is closed.", + "async": false, + "alias": "downloadsPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "env", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`." + } + ], + "required": false, + "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", + "async": false, + "alias": "env", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "env", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`." + } + ], + "required": false, + "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", + "async": false, + "alias": "env", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "executablePath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then↵it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,↵Firefox or WebKit, use at your own risk." + } + ], + "required": false, + "comment": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,\nFirefox or WebKit, use at your own risk.", + "async": false, + "alias": "executablePath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "extraHTTPHeaders", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "An object containing additional HTTP headers to be sent with every request. Defaults to none." + } + ], + "required": false, + "comment": "An object containing additional HTTP headers to be sent with every request. Defaults to none.", + "async": false, + "alias": "extraHTTPHeaders", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "forcedColors", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ForcedColors", + "union": [ + { + "name": "\"active\"" + }, + { + "name": "\"none\"" + } + ] + } + ], + "expression": "null|[ForcedColors]<\"active\"|\"none\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`." + } + ], + "required": false, + "comment": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'none'`.", + "async": false, + "alias": "forcedColors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "forcedColors", + "type": { + "name": "ForcedColors", + "union": [ + { + "name": "\"active\"" + }, + { + "name": "\"none\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ForcedColors]<\"active\"|\"none\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`." + } + ], + "required": false, + "comment": "Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'none'`.", + "async": false, + "alias": "forcedColors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "geolocation", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "latitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Latitude between -90 and 90." + } + ], + "required": true, + "comment": "Latitude between -90 and 90.", + "async": false, + "alias": "latitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "longitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Longitude between -180 and 180." + } + ], + "required": true, + "comment": "Longitude between -180 and 180.", + "async": false, + "alias": "longitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "accuracy", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Non-negative accuracy value. Defaults to `0`." + } + ], + "required": false, + "comment": "Non-negative accuracy value. Defaults to `0`.", + "async": false, + "alias": "accuracy", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "geolocation", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGHUP", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on SIGHUP. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on SIGHUP. Defaults to `true`.", + "async": false, + "alias": "handleSIGHUP", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGINT", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on Ctrl-C. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on Ctrl-C. Defaults to `true`.", + "async": false, + "alias": "handleSIGINT", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGTERM", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on SIGTERM. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on SIGTERM. Defaults to `true`.", + "async": false, + "alias": "handleSIGTERM", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "hasTouch", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.md#devices)." + } + ], + "required": false, + "comment": "Specifies if viewport supports touch events. Defaults to false. Learn more about\n[mobile emulation](../emulation.md#devices).", + "async": false, + "alias": "hasTouch", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "headless", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to run browser in headless mode. More details for↵[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and↵[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the↵`devtools` option is `true`." + } + ], + "required": false, + "comment": "Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.", + "async": false, + "alias": "headless", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "httpCredentials", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Restrain sending http credentials on specific origin (scheme://host:port)." + } + ], + "required": false, + "comment": "Restrain sending http credentials on specific origin (scheme://host:port).", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses." + } + ], + "required": false, + "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.", + "async": false, + "alias": "httpCredentials", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "ignoreAllDefaultArgs", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`.↵Dangerous option; use with care. Defaults to `false`." + } + ], + "required": false, + "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous\noption; use with care. Defaults to `false`.", + "async": false, + "alias": "ignoreAllDefaultArgs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "ignoreDefaultArgs", + "type": { + "name": "", + "union": [ + { + "name": "boolean" + }, + { + "name": "Array", + "templates": [ + { + "name": "string" + } + ] + } + ], + "expression": "[boolean]|[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an↵array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`." + } + ], + "required": false, + "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", + "async": false, + "alias": "ignoreDefaultArgs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "ignoreDefaultArgs", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`.↵Dangerous option; use with care." + } + ], + "required": false, + "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous\noption; use with care.", + "async": false, + "alias": "ignoreDefaultArgs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "isMobile", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile)." + } + ], + "required": false, + "comment": "Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,\nso you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more\nabout [mobile emulation](../emulation.md#ismobile).", + "async": false, + "alias": "isMobile", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "javaScriptEnabled", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about [disabling JavaScript](../emulation.md#javascript-enabled)." + } + ], + "required": false, + "comment": "Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about\n[disabling JavaScript](../emulation.md#javascript-enabled).", + "async": false, + "alias": "javaScriptEnabled", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "locale", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)." + } + ], + "required": false, + "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).", + "async": false, + "alias": "locale", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "logger", + "type": { + "name": "Logger", + "expression": "[Logger]" + }, + "spec": [ + { + "type": "text", + "text": "Logger sink for Playwright logging." + } + ], + "required": false, + "comment": "Logger sink for Playwright logging.", + "async": false, + "alias": "logger", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "noViewport", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Does not enforce fixed viewport, allows resizing window in the headed mode." + } + ], + "required": false, + "comment": "Does not enforce fixed viewport, allows resizing window in the headed mode.", + "async": false, + "alias": "noViewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "offline", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)." + } + ], + "required": false, + "comment": "Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).", + "async": false, + "alias": "offline", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "permissions", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "A list of permissions to grant to all pages in this context. See↵[`method: BrowserContext.grantPermissions`] for more details. Defaults to none." + } + ], + "required": false, + "comment": "A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for\nmore details. Defaults to none.", + "async": false, + "alias": "permissions", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "proxy", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "server", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy." + } + ], + "required": true, + "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", + "async": false, + "alias": "server", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "bypass", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`." + } + ], + "required": false, + "comment": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", + "async": false, + "alias": "bypass", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional username to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional username to use if HTTP proxy requires authentication.", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional password to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional password to use if HTTP proxy requires authentication.", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Network proxy settings." + } + ], + "required": false, + "comment": "Network proxy settings.", + "async": false, + "alias": "proxy", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHar", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "omitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.", + "async": false, + "alias": "omitContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "content", + "type": { + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.", + "async": false, + "alias": "content", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default." + } + ], + "required": true, + "comment": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ + { + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", + "async": false, + "alias": "mode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "urlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [ + { + "type": "text", + "text": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none." + } + ], + "required": false, + "comment": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.", + "async": false, + "alias": "urlFilter", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved." + } + ], + "required": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.", + "async": false, + "alias": "recordHar", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_content" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarContent", + "type": { + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files and all of these files are archived along with the\nHAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.", + "async": false, + "alias": "recordHarContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_mode" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarMode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ + { + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", + "async": false, + "alias": "recordHarMode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_omit_content" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarOmitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", + "async": false, + "alias": "recordHarOmitContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_path" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved." + } + ], + "required": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.", + "async": false, + "alias": "recordHarPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_url_filter" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordHarUrlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "recordHarUrlFilter", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideo", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "dir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to the directory to put videos into." + } + ], + "required": true, + "comment": "Path to the directory to put videos into.", + "async": false, + "alias": "dir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "size", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "size", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved." + } + ], + "required": false, + "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.", + "async": false, + "alias": "recordVideo", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_dir" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideoDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved." + } + ], + "required": false, + "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.", + "async": false, + "alias": "recordVideoDir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_size" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "recordVideoSize", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "recordVideoSize", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "reducedMotion", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ReducedMotion", + "union": [ + { + "name": "\"reduce\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ReducedMotion]<\"reduce\"|\"no-preference\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'no-preference'`.", + "async": false, + "alias": "reducedMotion", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "reducedMotion", + "type": { + "name": "ReducedMotion", + "union": [ + { + "name": "\"reduce\"" + }, + { + "name": "\"no-preference\"" + }, + { + "name": "\"null\"" + } + ], + "expression": "[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'no-preference'`.", + "async": false, + "alias": "reducedMotion", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "aliases": { + "java": "screenSize", + "csharp": "screenSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "screen", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the↵`viewport` is set." + } + ], + "required": false, + "comment": "Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the\n`viewport` is set.", + "async": false, + "alias": "screen", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "serviceWorkers", + "type": { + "name": "ServiceWorkerPolicy", + "union": [ + { + "name": "\"allow\"" + }, + { + "name": "\"block\"" + } + ], + "expression": "[ServiceWorkerPolicy]<\"allow\"|\"block\">" + }, + "spec": [ + { + "type": "text", + "text": "Whether to allow sites to register Service workers. Defaults to `'allow'`." + }, + { + "type": "li", + "text": "`'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.", + "liType": "bullet" + }, + { + "type": "li", + "text": "`'block'`: Playwright will block all registration of Service Workers.", + "liType": "bullet" + } + ], + "required": false, + "comment": "Whether to allow sites to register Service workers. Defaults to `'allow'`.\n- `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be\n registered.\n- `'block'`: Playwright will block all registration of Service Workers.", + "async": false, + "alias": "serviceWorkers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "slowMo", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on." + } + ], + "required": false, + "comment": "Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non.", + "async": false, + "alias": "slowMo", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "strictSelectors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations↵on selectors that imply single target DOM element will throw when more than one element matches the selector.↵This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.↵See `Locator` to learn more about the strict mode." + } + ], + "required": false, + "comment": "If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on\nselectors that imply single target DOM element will throw when more than one element matches the selector. This\noption does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See `Locator` to learn\nmore about the strict mode.", + "async": false, + "alias": "strictSelectors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout." + } + ], + "required": false, + "comment": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`\nto disable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "timezoneId", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone." + } + ], + "required": false, + "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.", + "async": false, + "alias": "timezoneId", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "tracesDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "If specified, traces are saved into this directory." + } + ], + "required": false, + "comment": "If specified, traces are saved into this directory.", + "async": false, + "alias": "tracesDir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "userAgent", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Specific user agent to use in this context." + } + ], + "required": false, + "comment": "Specific user agent to use in this context.", + "async": false, + "alias": "userAgent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "deprecated": "Use `recordVideo` instead.", + "name": "videoSize", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "videoSize", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "deprecated": "Use `recordVideo` instead.", + "name": "videosPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "videosPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": { + "java": "viewportSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport)." + }, + { + "type": "note", + "noteType": "note", + "text": "The `null` value opts out from the default presets, makes viewport depend on the↵host window size defined by the operating system. It makes the execution of the↵tests non-deterministic." + } + ], + "required": false, + "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent\nviewport emulation. Learn more about [viewport emulation](../emulation#viewport).\n\n**NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined\nby the operating system. It makes the execution of the tests non-deterministic.", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": { + "csharp": "viewportSize" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport)." + }, + { + "type": "note", + "noteType": "note", + "text": "The `ViewportSize.NoViewport` value opts out from the default presets,↵makes viewport depend on the host window size defined by the operating system.↵It makes the execution of the tests non-deterministic." + } + ], + "required": false, + "comment": "Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to\ndisable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport).\n\n**NOTE** The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host\nwindow size defined by the operating system. It makes the execution of the tests non-deterministic.", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "viewport", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page width in pixels." + } + ], + "required": true, + "comment": "page width in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "page height in pixels." + } + ], + "required": true, + "comment": "page height in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport. Learn more about [viewport emulation](../emulation.md#viewport)." + } + ], + "required": false, + "comment": "Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed\nviewport. Learn more about [viewport emulation](../emulation.md#viewport).", + "async": false, + "alias": "viewport", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "launchServer", + "type": { + "name": "BrowserServer", + "expression": "[BrowserServer]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the browser app instance. You can connect to it via [`method: BrowserType.connect`], which requires the major/minor client/server version to match (1.2.3 → is compatible with 1.2.x)." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "text", + "text": "Launches browser server that client can connect to. An example of launching a browser executable and connecting to it↵later:" + }, + { + "type": "code", + "lines": [ + "const { chromium } = require('playwright'); // Or 'webkit' or 'firefox'.", + "", + "(async () => {", + " const browserServer = await chromium.launchServer();", + " const wsEndpoint = browserServer.wsEndpoint();", + " // Use web socket endpoint later to establish a connection.", + " const browser = await chromium.connect(wsEndpoint);", + " // Close browser instance.", + " await browserServer.close();", + "})();" + ], + "codeLang": "js" + } + ], + "required": true, + "comment": "Returns the browser app instance. You can connect to it via [`method: BrowserType.connect`], which requires the\nmajor/minor client/server version to match (1.2.3 → is compatible with 1.2.x).\n\n**Usage**\n\nLaunches browser server that client can connect to. An example of launching a browser executable and connecting to\nit later:\n\n```js\nconst { chromium } = require('playwright'); // Or 'webkit' or 'firefox'.\n\n(async () => {\n const browserServer = await chromium.launchServer();\n const wsEndpoint = browserServer.wsEndpoint();\n // Use web socket endpoint later to establish a connection.\n const browser = await chromium.connect(wsEndpoint);\n // Close browser instance.\n await browserServer.close();\n})();\n```\n", + "async": true, + "alias": "launchServer", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "args", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](http://peter.sh/experiments/chromium-command-line-switches/)." + } + ], + "required": false, + "comment": "Additional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](http://peter.sh/experiments/chromium-command-line-switches/).", + "async": false, + "alias": "args", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "channel", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)." + } + ], + "required": false, + "comment": "Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).", + "async": false, + "alias": "channel", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "chromiumSandbox", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Enable Chromium sandboxing. Defaults to `false`." + } + ], + "required": false, + "comment": "Enable Chromium sandboxing. Defaults to `false`.", + "async": false, + "alias": "chromiumSandbox", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "devtools", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the↵`headless` option will be set `false`." + } + ], + "required": false, + "comment": "**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the\n`headless` option will be set `false`.", + "async": false, + "alias": "devtools", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "downloadsPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is↵deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in↵is closed." + } + ], + "required": false, + "comment": "If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and\nis deleted when browser is closed. In either case, the downloads are deleted when the browser context they were\ncreated in is closed.", + "async": false, + "alias": "downloadsPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "env", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`." + } + ], + "required": false, + "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", + "async": false, + "alias": "env", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "env", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Specify environment variables that will be visible to the browser. Defaults to `process.env`." + } + ], + "required": false, + "comment": "Specify environment variables that will be visible to the browser. Defaults to `process.env`.", + "async": false, + "alias": "env", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "executablePath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then↵it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,↵Firefox or WebKit, use at your own risk." + } + ], + "required": false, + "comment": "Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,\nFirefox or WebKit, use at your own risk.", + "async": false, + "alias": "executablePath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "firefoxUserPrefs", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "float" + }, + { + "name": "boolean" + } + ] + } + ], + "expression": "[Object]<[string], [string]|[float]|[boolean]>" + }, + "spec": [ + { + "type": "text", + "text": "Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)." + } + ], + "required": false, + "comment": "Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", + "async": false, + "alias": "firefoxUserPrefs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "firefoxUserPrefs", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "any" + } + ], + "expression": "[Object]<[string], [any]>" + }, + "spec": [ + { + "type": "text", + "text": "Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)." + } + ], + "required": false, + "comment": "Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).", + "async": false, + "alias": "firefoxUserPrefs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGHUP", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on SIGHUP. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on SIGHUP. Defaults to `true`.", + "async": false, + "alias": "handleSIGHUP", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGINT", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on Ctrl-C. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on Ctrl-C. Defaults to `true`.", + "async": false, + "alias": "handleSIGINT", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "handleSIGTERM", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Close the browser process on SIGTERM. Defaults to `true`." + } + ], + "required": false, + "comment": "Close the browser process on SIGTERM. Defaults to `true`.", + "async": false, + "alias": "handleSIGTERM", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "headless", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to run browser in headless mode. More details for↵[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and↵[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the↵`devtools` option is `true`." + } + ], + "required": false, + "comment": "Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.", + "async": false, + "alias": "headless", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "ignoreDefaultArgs", + "type": { + "name": "", + "union": [ + { + "name": "boolean" + }, + { + "name": "Array", + "templates": [ + { + "name": "string" + } + ] + } + ], + "expression": "[boolean]|[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an↵array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`." + } + ], + "required": false, + "comment": "If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.", + "async": false, + "alias": "ignoreDefaultArgs", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "logger", + "type": { + "name": "Logger", + "expression": "[Logger]" + }, + "spec": [ + { + "type": "text", + "text": "Logger sink for Playwright logging." + } + ], + "required": false, + "comment": "Logger sink for Playwright logging.", + "async": false, + "alias": "logger", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "port", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Port to use for the web socket. Defaults to 0 that picks any available port." + } + ], + "required": false, + "comment": "Port to use for the web socket. Defaults to 0 that picks any available port.", + "async": false, + "alias": "port", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "proxy", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "server", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy." + } + ], + "required": true, + "comment": "Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.", + "async": false, + "alias": "server", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "bypass", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`." + } + ], + "required": false, + "comment": "Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.", + "async": false, + "alias": "bypass", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional username to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional username to use if HTTP proxy requires authentication.", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Optional password to use if HTTP proxy requires authentication." + } + ], + "required": false, + "comment": "Optional password to use if HTTP proxy requires authentication.", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Network proxy settings." + } + ], + "required": false, + "comment": "Network proxy settings.", + "async": false, + "alias": "proxy", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout." + } + ], + "required": false, + "comment": "Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`\nto disable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "tracesDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "If specified, traces are saved into this directory." + } + ], + "required": false, + "comment": "If specified, traces are saved into this directory.", + "async": false, + "alias": "tracesDir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.15", + "name": "wsPath", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Path at which to serve the Browser Server. For security, this defaults to an↵unguessable string." + }, + { + "type": "note", + "noteType": "warning", + "text": "Any process or web page (including those running in Playwright) with knowledge↵of the `wsPath` can take control of the OS user. For this reason, you should↵use an unguessable token when using this option." + } + ], + "required": false, + "comment": "Path at which to serve the Browser Server. For security, this defaults to an unguessable string.\n\n**NOTE** Any process or web page (including those running in Playwright) with knowledge of the `wsPath` can take\ncontrol of the OS user. For this reason, you should use an unguessable token when using this option.", + "async": false, + "alias": "wsPath", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "name", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Returns browser name. For example: `'chromium'`, `'webkit'` or `'firefox'`." + } + ], + "required": true, + "comment": "Returns browser name. For example: `'chromium'`, `'webkit'` or `'firefox'`.", + "async": false, + "alias": "name", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "CDPSession", + "spec": [ + { + "type": "li", + "text": "extends: [EventEmitter]", + "liType": "bullet" + }, + { + "type": "text", + "text": "The `CDPSession` instances are used to talk raw Chrome Devtools Protocol:" + }, + { + "type": "li", + "text": "protocol methods can be called with `session.send` method.", + "liType": "bullet" + }, + { + "type": "li", + "text": "protocol events can be subscribed to with `session.on` method.", + "liType": "bullet" + }, + { + "type": "text", + "text": "Useful links:" + }, + { + "type": "li", + "text": "Documentation on DevTools Protocol can be found here:↵[DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/).", + "liType": "bullet" + }, + { + "type": "li", + "text": "Getting Started with DevTools Protocol:↵https://github.com/aslushnikov/getting-started-with-cdp/blob/master/README.md", + "liType": "bullet" + }, + { + "type": "code", + "lines": [ + "const client = await page.context().newCDPSession(page);", + "await client.send('Animation.enable');", + "client.on('Animation.animationCreated', () => console.log('Animation created!'));", + "const response = await client.send('Animation.getPlaybackRate');", + "console.log('playback rate is ' + response.playbackRate);", + "await client.send('Animation.setPlaybackRate', {", + " playbackRate: response.playbackRate / 2", + "});" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "client = await page.context.new_cdp_session(page)", + "await client.send(\"Animation.enable\")", + "client.on(\"Animation.animationCreated\", lambda: print(\"animation created!\"))", + "response = await client.send(\"Animation.getPlaybackRate\")", + "print(\"playback rate is \" + str(response[\"playbackRate\"]))", + "await client.send(\"Animation.setPlaybackRate\", {", + " playbackRate: response[\"playbackRate\"] / 2", + "})" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "client = page.context.new_cdp_session(page)", + "client.send(\"Animation.enable\")", + "client.on(\"Animation.animationCreated\", lambda: print(\"animation created!\"))", + "response = client.send(\"Animation.getPlaybackRate\")", + "print(\"playback rate is \" + str(response[\"playbackRate\"]))", + "client.send(\"Animation.setPlaybackRate\", {", + " playbackRate: response[\"playbackRate\"] / 2", + "})" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var client = await Page.Context.NewCDPSessionAsync(Page);", + "await client.SendAsync(\"Runtime.enable\");", + "client.Event(\"Animation.animationCreated\").OnEvent += (_, _) => Console.WriteLine(\"Animation created!\");", + "var response = await client.SendAsync(\"Animation.getPlaybackRate\");", + "var playbackRate = response.Value.GetProperty(\"playbackRate\").GetDouble();", + "Console.WriteLine(\"playback rate is \" + playbackRate);", + "await client.SendAsync(\"Animation.setPlaybackRate\", new() { { \"playbackRate\", playbackRate / 2 } });" + ], + "codeLang": "csharp" + }, + { + "type": "code", + "lines": [ + "CDPSession client = page.context().newCDPSession(page);", + "client.send(\"Runtime.enable\");", + "", + "client.on(\"Animation.animationCreated\", (event) -> System.out.println(\"Animation created!\"));", + "", + "JsonObject response = client.send(\"Animation.getPlaybackRate\");", + "double playbackRate = response.get(\"playbackRate\").getAsDouble();", + "System.out.println(\"playback rate is \" + playbackRate);", + "", + "JsonObject params = new JsonObject();", + "params.addProperty(\"playbackRate\", playbackRate / 2);", + "client.send(\"Animation.setPlaybackRate\", params);" + ], + "codeLang": "java" + } + ], + "extends": "EventEmitter", + "langs": {}, + "comment": "- extends: [EventEmitter]\n\nThe `CDPSession` instances are used to talk raw Chrome Devtools Protocol:\n- protocol methods can be called with `session.send` method.\n- protocol events can be subscribed to with `session.on` method.\n\nUseful links:\n- Documentation on DevTools Protocol can be found here:\n [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/).\n- Getting Started with DevTools Protocol:\n https://github.com/aslushnikov/getting-started-with-cdp/blob/master/README.md\n\n```js\nconst client = await page.context().newCDPSession(page);\nawait client.send('Animation.enable');\nclient.on('Animation.animationCreated', () => console.log('Animation created!'));\nconst response = await client.send('Animation.getPlaybackRate');\nconsole.log('playback rate is ' + response.playbackRate);\nawait client.send('Animation.setPlaybackRate', {\n playbackRate: response.playbackRate / 2\n});\n```\n\n```py\nclient = await page.context.new_cdp_session(page)\nawait client.send(\"Animation.enable\")\nclient.on(\"Animation.animationCreated\", lambda: print(\"animation created!\"))\nresponse = await client.send(\"Animation.getPlaybackRate\")\nprint(\"playback rate is \" + str(response[\"playbackRate\"]))\nawait client.send(\"Animation.setPlaybackRate\", {\n playbackRate: response[\"playbackRate\"] / 2\n})\n```\n\n```py\nclient = page.context.new_cdp_session(page)\nclient.send(\"Animation.enable\")\nclient.on(\"Animation.animationCreated\", lambda: print(\"animation created!\"))\nresponse = client.send(\"Animation.getPlaybackRate\")\nprint(\"playback rate is \" + str(response[\"playbackRate\"]))\nclient.send(\"Animation.setPlaybackRate\", {\n playbackRate: response[\"playbackRate\"] / 2\n})\n```\n\n```csharp\nvar client = await Page.Context.NewCDPSessionAsync(Page);\nawait client.SendAsync(\"Runtime.enable\");\nclient.Event(\"Animation.animationCreated\").OnEvent += (_, _) => Console.WriteLine(\"Animation created!\");\nvar response = await client.SendAsync(\"Animation.getPlaybackRate\");\nvar playbackRate = response.Value.GetProperty(\"playbackRate\").GetDouble();\nConsole.WriteLine(\"playback rate is \" + playbackRate);\nawait client.SendAsync(\"Animation.setPlaybackRate\", new() { { \"playbackRate\", playbackRate / 2 } });\n```\n\n```java\nCDPSession client = page.context().newCDPSession(page);\nclient.send(\"Runtime.enable\");\n\nclient.on(\"Animation.animationCreated\", (event) -> System.out.println(\"Animation created!\"));\n\nJsonObject response = client.send(\"Animation.getPlaybackRate\");\ndouble playbackRate = response.get(\"playbackRate\").getAsDouble();\nSystem.out.println(\"playback rate is \" + playbackRate);\n\nJsonObject params = new JsonObject();\nparams.addProperty(\"playbackRate\", playbackRate / 2);\nclient.send(\"Animation.setPlaybackRate\", params);\n```\n", + "since": "v1.8", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "detach", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used to↵send messages." + } + ], + "required": true, + "comment": "Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be\nused to send messages.", + "async": true, + "alias": "detach", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "types": { + "csharp": { + "name": "JsonElement?", + "expression": "[JsonElement?]" + }, + "java": { + "name": "JsonObject", + "expression": "[JsonObject]" + } + } + }, + "experimental": false, + "since": "v1.8", + "name": "send", + "type": { + "name": "Object", + "expression": "[Object]" + }, + "spec": [], + "required": true, + "comment": "", + "async": true, + "alias": "send", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "method", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Protocol method name." + } + ], + "required": true, + "comment": "Protocol method name.", + "async": false, + "alias": "method", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "params", + "type": { + "name": "Object", + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Optional method parameters." + } + ], + "required": false, + "comment": "Optional method parameters.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": { + "csharp": "args" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.30", + "name": "params", + "type": { + "name": "Map", + "templates": [ + { + "name": "string" + }, + { + "name": "Object" + } + ], + "expression": "[Map]" + }, + "spec": [ + { + "type": "text", + "text": "Optional method parameters." + } + ], + "required": false, + "comment": "Optional method parameters.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "java" + ], + "aliases": { + "java": "args" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.37", + "name": "params", + "type": { + "name": "JsonObject", + "expression": "[JsonObject]" + }, + "spec": [ + { + "type": "text", + "text": "Optional method parameters." + } + ], + "required": false, + "comment": "Optional method parameters.", + "async": false, + "alias": "params", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v.1.30", + "name": "event", + "type": { + "name": "CDPSessionEvent", + "expression": "[CDPSessionEvent]" + }, + "spec": [ + { + "type": "text", + "text": "Returns an event emitter for the given CDP event name." + } + ], + "required": true, + "comment": "Returns an event emitter for the given CDP event name.", + "async": false, + "alias": "event", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.30", + "name": "eventName", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "CDP event name." + } + ], + "required": true, + "comment": "CDP event name.", + "async": false, + "alias": "eventName", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.37", + "name": "on", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Register an event handler for events with the specified event name.↵The given handler will be called for every event with the given name." + } + ], + "required": true, + "comment": "Register an event handler for events with the specified event name. The given handler will be called for every\nevent with the given name.", + "async": false, + "alias": "on", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.37", + "name": "eventName", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "CDP event name." + } + ], + "required": true, + "comment": "CDP event name.", + "async": false, + "alias": "eventName", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.37", + "name": "handler", + "type": { + "name": "function", + "args": [ + { + "name": "JsonObject" + } + ], + "expression": "[function]([JsonObject])" + }, + "spec": [ + { + "type": "text", + "text": "Event handler." + } + ], + "required": true, + "comment": "Event handler.", + "async": false, + "alias": "handler", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "only": [ + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.37", + "name": "off", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Unregister an event handler for events with the specified event name.↵The given handler will not be called anymore for events with the given name." + } + ], + "required": true, + "comment": "Unregister an event handler for events with the specified event name. The given handler will not be called anymore\nfor events with the given name.", + "async": false, + "alias": "off", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.37", + "name": "eventName", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "CDP event name." + } + ], + "required": true, + "comment": "CDP event name.", + "async": false, + "alias": "eventName", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.37", + "name": "handler", + "type": { + "name": "function", + "args": [ + { + "name": "JsonObject" + } + ], + "expression": "[function]([JsonObject])" + }, + "spec": [ + { + "type": "text", + "text": "Event handler." + } + ], + "required": true, + "comment": "Event handler.", + "async": false, + "alias": "handler", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + }, + { + "name": "CDPSessionEvent", + "spec": [ + { + "type": "text", + "text": "`CDPSessionEvent` objects are returned by page via the [`method: CDPSession.event`] method." + }, + { + "type": "text", + "text": "Each object represents a named event and allows handling of the event when it is raised." + } + ], + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "comment": "`CDPSessionEvent` objects are returned by page via the [`method: CDPSession.event`] method.\n\nEach object represents a named event and allows handling of the event when it is raised.", + "since": "v1.30", + "members": [ + { + "kind": "event", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.30", + "name": "onEvent", + "type": { + "name": "JsonElement?", + "expression": "[JsonElement?]" + }, + "spec": [], + "required": true, + "comment": "", + "async": false, + "alias": "onEvent", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "1.30", + "name": "eventName", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [], + "required": true, + "comment": "", + "async": false, + "alias": "eventName", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "ConsoleMessage", + "spec": [ + { + "type": "text", + "text": "`ConsoleMessage` objects are dispatched by page via the [`event: Page.console`] event.↵For each console messages logged in the page there will be corresponding event in the Playwright↵context." + }, + { + "type": "code", + "lines": [ + "// Listen for all console logs", + "page.on('console', msg => console.log(msg.text()));", + "", + "// Listen for all console events and handle errors", + "page.on('console', msg => {", + " if (msg.type() === 'error')", + " console.log(`Error text: \"${msg.text()}\"`);", + "});", + "", + "// Get the next console log", + "const msgPromise = page.waitForEvent('console');", + "await page.evaluate(() => {", + " console.log('hello', 42, { foo: 'bar' }); // Issue console.log inside the page", + "});", + "const msg = await msgPromise;", + "", + "// Deconstruct console log arguments", + "await msg.args()[0].jsonValue(); // hello", + "await msg.args()[1].jsonValue(); // 42" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "// Listen for all console messages and print them to the standard output.", + "page.onConsoleMessage(msg -> System.out.println(msg.text()));", + "", + "// Listen for all console messages and print errors to the standard output.", + "page.onConsoleMessage(msg -> {", + " if (\"error\".equals(msg.type()))", + " System.out.println(\"Error text: \" + msg.text());", + "});", + "", + "// Get the next console message", + "ConsoleMessage msg = page.waitForConsoleMessage(() -> {", + " // Issue console.log inside the page", + " page.evaluate(\"console.log('hello', 42, { foo: 'bar' });\");", + "});", + "", + "// Deconstruct console.log arguments", + "msg.args().get(0).jsonValue() // hello", + "msg.args().get(1).jsonValue() // 42" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "# Listen for all console logs", + "page.on(\"console\", lambda msg: print(msg.text))", + "", + "# Listen for all console events and handle errors", + "page.on(\"console\", lambda msg: print(f\"error: {msg.text}\") if msg.type == \"error\" else None)", + "", + "# Get the next console log", + "async with page.expect_console_message() as msg_info:", + " # Issue console.log inside the page", + " await page.evaluate(\"console.log('hello', 42, { foo: 'bar' })\")", + "msg = await msg_info.value", + "", + "# Deconstruct print arguments", + "await msg.args[0].json_value() # hello", + "await msg.args[1].json_value() # 42" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "# Listen for all console logs", + "page.on(\"console\", lambda msg: print(msg.text))", + "", + "# Listen for all console events and handle errors", + "page.on(\"console\", lambda msg: print(f\"error: {msg.text}\") if msg.type == \"error\" else None)", + "", + "# Get the next console log", + "with page.expect_console_message() as msg_info:", + " # Issue console.log inside the page", + " page.evaluate(\"console.log('hello', 42, { foo: 'bar' })\")", + "msg = msg_info.value", + "", + "# Deconstruct print arguments", + "msg.args[0].json_value() # hello", + "msg.args[1].json_value() # 42" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "// Listen for all console messages and print them to the standard output.", + "page.Console += (_, msg) => Console.WriteLine(msg.Text);", + "", + "// Listen for all console messages and print errors to the standard output.", + "page.Console += (_, msg) =>", + "{", + " if (\"error\".Equals(msg.Type))", + " Console.WriteLine(\"Error text: \" + msg.Text);", + "};", + "", + "// Get the next console message", + "var waitForMessageTask = page.WaitForConsoleMessageAsync();", + "await page.EvaluateAsync(\"console.log('hello', 42, { foo: 'bar' });\");", + "var message = await waitForMessageTask;", + "// Deconstruct console.log arguments", + "await message.Args.ElementAt(0).JsonValueAsync(); // hello", + "await message.Args.ElementAt(1).JsonValueAsync(); // 42" + ], + "codeLang": "csharp" + } + ], + "langs": {}, + "comment": "`ConsoleMessage` objects are dispatched by page via the [`event: Page.console`] event. For each console messages\nlogged in the page there will be corresponding event in the Playwright context.\n\n```js\n// Listen for all console logs\npage.on('console', msg => console.log(msg.text()));\n\n// Listen for all console events and handle errors\npage.on('console', msg => {\n if (msg.type() === 'error')\n console.log(`Error text: \"${msg.text()}\"`);\n});\n\n// Get the next console log\nconst msgPromise = page.waitForEvent('console');\nawait page.evaluate(() => {\n console.log('hello', 42, { foo: 'bar' }); // Issue console.log inside the page\n});\nconst msg = await msgPromise;\n\n// Deconstruct console log arguments\nawait msg.args()[0].jsonValue(); // hello\nawait msg.args()[1].jsonValue(); // 42\n```\n\n```java\n// Listen for all console messages and print them to the standard output.\npage.onConsoleMessage(msg -> System.out.println(msg.text()));\n\n// Listen for all console messages and print errors to the standard output.\npage.onConsoleMessage(msg -> {\n if (\"error\".equals(msg.type()))\n System.out.println(\"Error text: \" + msg.text());\n});\n\n// Get the next console message\nConsoleMessage msg = page.waitForConsoleMessage(() -> {\n // Issue console.log inside the page\n page.evaluate(\"console.log('hello', 42, { foo: 'bar' });\");\n});\n\n// Deconstruct console.log arguments\nmsg.args().get(0).jsonValue() // hello\nmsg.args().get(1).jsonValue() // 42\n```\n\n```py\n# Listen for all console logs\npage.on(\"console\", lambda msg: print(msg.text))\n\n# Listen for all console events and handle errors\npage.on(\"console\", lambda msg: print(f\"error: {msg.text}\") if msg.type == \"error\" else None)\n\n# Get the next console log\nasync with page.expect_console_message() as msg_info:\n # Issue console.log inside the page\n await page.evaluate(\"console.log('hello', 42, { foo: 'bar' })\")\nmsg = await msg_info.value\n\n# Deconstruct print arguments\nawait msg.args[0].json_value() # hello\nawait msg.args[1].json_value() # 42\n```\n\n```py\n# Listen for all console logs\npage.on(\"console\", lambda msg: print(msg.text))\n\n# Listen for all console events and handle errors\npage.on(\"console\", lambda msg: print(f\"error: {msg.text}\") if msg.type == \"error\" else None)\n\n# Get the next console log\nwith page.expect_console_message() as msg_info:\n # Issue console.log inside the page\n page.evaluate(\"console.log('hello', 42, { foo: 'bar' })\")\nmsg = msg_info.value\n\n# Deconstruct print arguments\nmsg.args[0].json_value() # hello\nmsg.args[1].json_value() # 42\n```\n\n```csharp\n// Listen for all console messages and print them to the standard output.\npage.Console += (_, msg) => Console.WriteLine(msg.Text);\n\n// Listen for all console messages and print errors to the standard output.\npage.Console += (_, msg) =>\n{\n if (\"error\".Equals(msg.Type))\n Console.WriteLine(\"Error text: \" + msg.Text);\n};\n\n// Get the next console message\nvar waitForMessageTask = page.WaitForConsoleMessageAsync();\nawait page.EvaluateAsync(\"console.log('hello', 42, { foo: 'bar' });\");\nvar message = await waitForMessageTask;\n// Deconstruct console.log arguments\nawait message.Args.ElementAt(0).JsonValueAsync(); // hello\nawait message.Args.ElementAt(1).JsonValueAsync(); // 42\n```\n", + "since": "v1.8", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "args", + "type": { + "name": "Array", + "templates": [ + { + "name": "JSHandle" + } + ], + "expression": "[Array]<[JSHandle]>" + }, + "spec": [ + { + "type": "text", + "text": "List of arguments passed to a `console` function call. See also [`event: Page.console`]." + } + ], + "required": true, + "comment": "List of arguments passed to a `console` function call. See also [`event: Page.console`].", + "async": false, + "alias": "args", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "only": [ + "js", + "python" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "location", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "URL of the resource." + } + ], + "required": true, + "comment": "URL of the resource.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "lineNumber", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "0-based line number in the resource." + } + ], + "required": true, + "comment": "0-based line number in the resource.", + "async": false, + "alias": "lineNumber", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "columnNumber", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "0-based column number in the resource." + } + ], + "required": true, + "comment": "0-based column number in the resource.", + "async": false, + "alias": "columnNumber", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": true, + "comment": "", + "async": false, + "alias": "location", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "only": [ + "csharp", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "location", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "URL of the resource followed by 0-based line and column numbers in the resource formatted as `URL:line:column`." + } + ], + "required": true, + "comment": "URL of the resource followed by 0-based line and column numbers in the resource formatted as `URL:line:column`.", + "async": false, + "alias": "location", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.34", + "name": "page", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Page" + } + ], + "expression": "[null]|[Page]" + }, + "spec": [ + { + "type": "text", + "text": "The page that produced this console message, if any." + } + ], + "required": true, + "comment": "The page that produced this console message, if any.", + "async": false, + "alias": "page", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "text", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "The text of the console message." + } + ], + "required": true, + "comment": "The text of the console message.", + "async": false, + "alias": "text", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "type", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,↵`'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`,↵`'count'`, `'timeEnd'`." + } + ], + "required": true, + "comment": "One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,\n`'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`,\n`'profileEnd'`, `'count'`, `'timeEnd'`.", + "async": false, + "alias": "type", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "Coverage", + "spec": [ + { + "type": "text", + "text": "Coverage gathers information about parts of JavaScript and CSS that were used by the page." + }, + { + "type": "text", + "text": "An example of using JavaScript coverage to produce Istanbul report for page load:" + }, + { + "type": "note", + "noteType": "note", + "text": "Coverage APIs are only supported on Chromium-based browsers." + }, + { + "type": "code", + "lines": [ + "const { chromium } = require('playwright');", + "const v8toIstanbul = require('v8-to-istanbul');", + "", + "(async () => {", + " const browser = await chromium.launch();", + " const page = await browser.newPage();", + " await page.coverage.startJSCoverage();", + " await page.goto('https://chromium.org');", + " const coverage = await page.coverage.stopJSCoverage();", + " for (const entry of coverage) {", + " const converter = v8toIstanbul('', 0, { source: entry.source });", + " await converter.load();", + " converter.applyCoverage(entry.functions);", + " console.log(JSON.stringify(converter.toIstanbul()));", + " }", + " await browser.close();", + "})();" + ], + "codeLang": "js" + } + ], + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "comment": "Coverage gathers information about parts of JavaScript and CSS that were used by the page.\n\nAn example of using JavaScript coverage to produce Istanbul report for page load:\n\n**NOTE** Coverage APIs are only supported on Chromium-based browsers.\n\n```js\nconst { chromium } = require('playwright');\nconst v8toIstanbul = require('v8-to-istanbul');\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n await page.coverage.startJSCoverage();\n await page.goto('https://chromium.org');\n const coverage = await page.coverage.stopJSCoverage();\n for (const entry of coverage) {\n const converter = v8toIstanbul('', 0, { source: entry.source });\n await converter.load();\n converter.applyCoverage(entry.functions);\n console.log(JSON.stringify(converter.toIstanbul()));\n }\n await browser.close();\n})();\n```\n", + "since": "v1.11", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "startCSSCoverage", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Returns coverage is started" + } + ], + "required": true, + "comment": "Returns coverage is started", + "async": true, + "alias": "startCSSCoverage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "resetOnNavigation", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to reset coverage on every navigation. Defaults to `true`." + } + ], + "required": false, + "comment": "Whether to reset coverage on every navigation. Defaults to `true`.", + "async": false, + "alias": "resetOnNavigation", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "startJSCoverage", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Returns coverage is started" + }, + { + "type": "note", + "noteType": "note", + "text": "Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created↵on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts↵will have `__playwright_evaluation_script__` as their URL." + } + ], + "required": true, + "comment": "Returns coverage is started\n\n**NOTE** Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically\ncreated on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts\nwill have `__playwright_evaluation_script__` as their URL.", + "async": true, + "alias": "startJSCoverage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "reportAnonymousScripts", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether anonymous scripts generated by the page should be reported. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether anonymous scripts generated by the page should be reported. Defaults to `false`.", + "async": false, + "alias": "reportAnonymousScripts", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "resetOnNavigation", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to reset coverage on every navigation. Defaults to `true`." + } + ], + "required": false, + "comment": "Whether to reset coverage on every navigation. Defaults to `true`.", + "async": false, + "alias": "resetOnNavigation", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "stopCSSCoverage", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "StyleSheet URL" + } + ], + "required": true, + "comment": "StyleSheet URL", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "text", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "StyleSheet content, if available." + } + ], + "required": false, + "comment": "StyleSheet content, if available.", + "async": false, + "alias": "text", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "ranges", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "start", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "A start offset in text, inclusive" + } + ], + "required": true, + "comment": "A start offset in text, inclusive", + "async": false, + "alias": "start", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "end", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "An end offset in text, exclusive" + } + ], + "required": true, + "comment": "An end offset in text, exclusive", + "async": false, + "alias": "end", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "StyleSheet ranges that were used. Ranges are sorted and non-overlapping." + } + ], + "required": true, + "comment": "StyleSheet ranges that were used. Ranges are sorted and non-overlapping.", + "async": false, + "alias": "ranges", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Returns the array of coverage reports for all stylesheets" + }, + { + "type": "note", + "noteType": "note", + "text": "CSS Coverage doesn't include dynamically injected style tags without sourceURLs." + } + ], + "required": true, + "comment": "Returns the array of coverage reports for all stylesheets\n\n**NOTE** CSS Coverage doesn't include dynamically injected style tags without sourceURLs.", + "async": true, + "alias": "stopCSSCoverage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "stopJSCoverage", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Script URL" + } + ], + "required": true, + "comment": "Script URL", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "scriptId", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Script ID" + } + ], + "required": true, + "comment": "Script ID", + "async": false, + "alias": "scriptId", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "source", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Script content, if applicable." + } + ], + "required": false, + "comment": "Script content, if applicable.", + "async": false, + "alias": "source", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "functions", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "functionName", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "functionName", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "isBlockCoverage", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "isBlockCoverage", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "ranges", + "type": { + "name": "Array", + "templates": [ + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "count", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "count", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "startOffset", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "startOffset", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "endOffset", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "endOffset", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "ranges", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "V8-specific coverage format." + } + ], + "required": true, + "comment": "V8-specific coverage format.", + "async": false, + "alias": "functions", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[Array]<[Object]>" + }, + "spec": [ + { + "type": "text", + "text": "Returns the array of coverage reports for all scripts" + }, + { + "type": "note", + "noteType": "note", + "text": "JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are↵reported." + } + ], + "required": true, + "comment": "Returns the array of coverage reports for all scripts\n\n**NOTE** JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are\nreported.", + "async": true, + "alias": "stopJSCoverage", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "Dialog", + "spec": [ + { + "type": "text", + "text": "`Dialog` objects are dispatched by page via the [`event: Page.dialog`] event." + }, + { + "type": "text", + "text": "An example of using `Dialog` class:" + }, + { + "type": "code", + "lines": [ + "const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.", + "", + "(async () => {", + " const browser = await chromium.launch();", + " const page = await browser.newPage();", + " page.on('dialog', async dialog => {", + " console.log(dialog.message());", + " await dialog.dismiss();", + " });", + " await page.evaluate(() => alert('1'));", + " await browser.close();", + "})();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "import com.microsoft.playwright.*;", + "", + "public class Example {", + " public static void main(String[] args) {", + " try (Playwright playwright = Playwright.create()) {", + " BrowserType chromium = playwright.chromium();", + " Browser browser = chromium.launch();", + " Page page = browser.newPage();", + " page.onDialog(dialog -> {", + " System.out.println(dialog.message());", + " dialog.dismiss();", + " });", + " page.evaluate(\"alert('1')\");", + " browser.close();", + " }", + " }", + "}" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "import asyncio", + "from playwright.async_api import async_playwright, Playwright", + "", + "async def handle_dialog(dialog):", + " print(dialog.message)", + " await dialog.dismiss()", + "", + "async def run(playwright: Playwright):", + " chromium = playwright.chromium", + " browser = await chromium.launch()", + " page = await browser.new_page()", + " page.on(\"dialog\", handle_dialog)", + " page.evaluate(\"alert('1')\")", + " await browser.close()", + "", + "async def main():", + " async with async_playwright() as playwright:", + " await run(playwright)", + "asyncio.run(main())" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "from playwright.sync_api import sync_playwright, Playwright", + "", + "def handle_dialog(dialog):", + " print(dialog.message)", + " dialog.dismiss()", + "", + "def run(playwright: Playwright):", + " chromium = playwright.chromium", + " browser = chromium.launch()", + " page = browser.new_page()", + " page.on(\"dialog\", handle_dialog)", + " page.evaluate(\"alert('1')\")", + " browser.close()", + "", + "with sync_playwright() as playwright:", + " run(playwright)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "using Microsoft.Playwright;", + "using System.Threading.Tasks;", + "", + "class DialogExample", + "{", + " public static async Task Run()", + " {", + " using var playwright = await Playwright.CreateAsync();", + " await using var browser = await playwright.Chromium.LaunchAsync();", + " var page = await browser.NewPageAsync();", + "", + " page.Dialog += async (_, dialog) =>", + " {", + " System.Console.WriteLine(dialog.Message);", + " await dialog.DismissAsync();", + " };", + "", + " await page.EvaluateAsync(\"alert('1');\");", + " }", + "}" + ], + "codeLang": "csharp" + }, + { + "type": "note", + "noteType": "note", + "text": "Dialogs are dismissed automatically, unless there is a [`event: Page.dialog`] listener.↵When listener is present, it **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and actions like click will never finish." + } + ], + "langs": {}, + "comment": "`Dialog` objects are dispatched by page via the [`event: Page.dialog`] event.\n\nAn example of using `Dialog` class:\n\n```js\nconst { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n page.on('dialog', async dialog => {\n console.log(dialog.message());\n await dialog.dismiss();\n });\n await page.evaluate(() => alert('1'));\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType chromium = playwright.chromium();\n Browser browser = chromium.launch();\n Page page = browser.newPage();\n page.onDialog(dialog -> {\n System.out.println(dialog.message());\n dialog.dismiss();\n });\n page.evaluate(\"alert('1')\");\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def handle_dialog(dialog):\n print(dialog.message)\n await dialog.dismiss()\n\nasync def run(playwright: Playwright):\n chromium = playwright.chromium\n browser = await chromium.launch()\n page = await browser.new_page()\n page.on(\"dialog\", handle_dialog)\n page.evaluate(\"alert('1')\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef handle_dialog(dialog):\n print(dialog.message)\n dialog.dismiss()\n\ndef run(playwright: Playwright):\n chromium = playwright.chromium\n browser = chromium.launch()\n page = browser.new_page()\n page.on(\"dialog\", handle_dialog)\n page.evaluate(\"alert('1')\")\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass DialogExample\n{\n public static async Task Run()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Chromium.LaunchAsync();\n var page = await browser.NewPageAsync();\n\n page.Dialog += async (_, dialog) =>\n {\n System.Console.WriteLine(dialog.Message);\n await dialog.DismissAsync();\n };\n\n await page.EvaluateAsync(\"alert('1');\");\n }\n}\n```\n\n**NOTE** Dialogs are dismissed automatically, unless there is a [`event: Page.dialog`] listener. When listener is\npresent, it **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page\nwill [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the\ndialog, and actions like click will never finish.", + "since": "v1.8", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "accept", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Returns when the dialog has been accepted." + } + ], + "required": true, + "comment": "Returns when the dialog has been accepted.", + "async": true, + "alias": "accept", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "promptText", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "A text to enter in prompt. Does not cause any effects if the dialog's `type` is not prompt. Optional." + } + ], + "required": false, + "comment": "A text to enter in prompt. Does not cause any effects if the dialog's `type` is not prompt. Optional.", + "async": false, + "alias": "promptText", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "defaultValue", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "If dialog is prompt, returns default prompt value. Otherwise, returns empty string." + } + ], + "required": true, + "comment": "If dialog is prompt, returns default prompt value. Otherwise, returns empty string.", + "async": false, + "alias": "defaultValue", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "dismiss", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Returns when the dialog has been dismissed." + } + ], + "required": true, + "comment": "Returns when the dialog has been dismissed.", + "async": true, + "alias": "dismiss", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "message", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "A message displayed in the dialog." + } + ], + "required": true, + "comment": "A message displayed in the dialog.", + "async": false, + "alias": "message", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.34", + "name": "page", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Page" + } + ], + "expression": "[null]|[Page]" + }, + "spec": [ + { + "type": "text", + "text": "The page that initiated this dialog, if available." + } + ], + "required": true, + "comment": "The page that initiated this dialog, if available.", + "async": false, + "alias": "page", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "type", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Returns dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`." + } + ], + "required": true, + "comment": "Returns dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`.", + "async": false, + "alias": "type", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "Download", + "spec": [ + { + "type": "text", + "text": "`Download` objects are dispatched by page via the [`event: Page.download`] event." + }, + { + "type": "text", + "text": "All the downloaded files belonging to the browser context are deleted when the↵browser context is closed." + }, + { + "type": "text", + "text": "Download event is emitted once the download starts. Download path becomes available once download completes." + }, + { + "type": "code", + "lines": [ + "// Start waiting for download before clicking. Note no await.", + "const downloadPromise = page.waitForEvent('download');", + "await page.getByText('Download file').click();", + "const download = await downloadPromise;", + "", + "// Wait for the download process to complete and save the downloaded file somewhere.", + "await download.saveAs('/path/to/save/at/' + download.suggestedFilename());" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "// Wait for the download to start", + "Download download = page.waitForDownload(() -> {", + " // Perform the action that initiates download", + " page.getByText(\"Download file\").click();", + "});", + "", + "// Wait for the download process to complete and save the downloaded file somewhere", + "download.saveAs(Paths.get(\"/path/to/save/at/\", download.suggestedFilename()));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "# Start waiting for the download", + "async with page.expect_download() as download_info:", + " # Perform the action that initiates download", + " await page.get_by_text(\"Download file\").click()", + "download = await download_info.value", + "", + "# Wait for the download process to complete and save the downloaded file somewhere", + "await download.save_as(\"/path/to/save/at/\" + download.suggested_filename)" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "# Start waiting for the download", + "with page.expect_download() as download_info:", + " # Perform the action that initiates download", + " page.get_by_text(\"Download file\").click()", + "download = download_info.value", + "", + "# Wait for the download process to complete and save the downloaded file somewhere", + "download.save_as(\"/path/to/save/at/\" + download.suggested_filename)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "// Start the task of waiting for the download before clicking", + "var waitForDownloadTask = page.WaitForDownloadAsync();", + "await page.GetByText(\"Download file\").ClickAsync();", + "var download = await waitForDownloadTask;", + "", + "// Wait for the download process to complete and save the downloaded file somewhere", + "await download.SaveAsAsync(\"/path/to/save/at/\" + download.SuggestedFilename);" + ], + "codeLang": "csharp" + } + ], + "langs": {}, + "comment": "`Download` objects are dispatched by page via the [`event: Page.download`] event.\n\nAll the downloaded files belonging to the browser context are deleted when the browser context is closed.\n\nDownload event is emitted once the download starts. Download path becomes available once download completes.\n\n```js\n// Start waiting for download before clicking. Note no await.\nconst downloadPromise = page.waitForEvent('download');\nawait page.getByText('Download file').click();\nconst download = await downloadPromise;\n\n// Wait for the download process to complete and save the downloaded file somewhere.\nawait download.saveAs('/path/to/save/at/' + download.suggestedFilename());\n```\n\n```java\n// Wait for the download to start\nDownload download = page.waitForDownload(() -> {\n // Perform the action that initiates download\n page.getByText(\"Download file\").click();\n});\n\n// Wait for the download process to complete and save the downloaded file somewhere\ndownload.saveAs(Paths.get(\"/path/to/save/at/\", download.suggestedFilename()));\n```\n\n```py\n# Start waiting for the download\nasync with page.expect_download() as download_info:\n # Perform the action that initiates download\n await page.get_by_text(\"Download file\").click()\ndownload = await download_info.value\n\n# Wait for the download process to complete and save the downloaded file somewhere\nawait download.save_as(\"/path/to/save/at/\" + download.suggested_filename)\n```\n\n```py\n# Start waiting for the download\nwith page.expect_download() as download_info:\n # Perform the action that initiates download\n page.get_by_text(\"Download file\").click()\ndownload = download_info.value\n\n# Wait for the download process to complete and save the downloaded file somewhere\ndownload.save_as(\"/path/to/save/at/\" + download.suggested_filename)\n```\n\n```csharp\n// Start the task of waiting for the download before clicking\nvar waitForDownloadTask = page.WaitForDownloadAsync();\nawait page.GetByText(\"Download file\").ClickAsync();\nvar download = await waitForDownloadTask;\n\n// Wait for the download process to complete and save the downloaded file somewhere\nawait download.SaveAsAsync(\"/path/to/save/at/\" + download.SuggestedFilename);\n```\n", + "since": "v1.8", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.13", + "name": "cancel", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Cancels a download. Will not fail if the download is already finished or canceled.↵Upon successful cancellations, `download.failure()` would resolve to `'canceled'`." + } + ], + "required": true, + "comment": "Cancels a download. Will not fail if the download is already finished or canceled. Upon successful cancellations,\n`download.failure()` would resolve to `'canceled'`.", + "async": true, + "alias": "cancel", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "only": [ + "java", + "js", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "createReadStream", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Readable" + } + ], + "expression": "[null]|[Readable]" + }, + "spec": [ + { + "type": "text", + "text": "Returns readable stream for current download or `null` if download failed." + } + ], + "required": true, + "comment": "Returns readable stream for current download or `null` if download failed.", + "async": true, + "alias": "createReadStream", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "delete", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Deletes the downloaded file. Will wait for the download to finish if necessary." + } + ], + "required": true, + "comment": "Deletes the downloaded file. Will wait for the download to finish if necessary.", + "async": true, + "alias": "delete", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "failure", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "string" + } + ], + "expression": "[null]|[string]" + }, + "spec": [ + { + "type": "text", + "text": "Returns download error if any. Will wait for the download to finish if necessary." + } + ], + "required": true, + "comment": "Returns download error if any. Will wait for the download to finish if necessary.", + "async": true, + "alias": "failure", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "page", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "Get the page that the download belongs to." + } + ], + "required": true, + "comment": "Get the page that the download belongs to.", + "async": false, + "alias": "page", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "path", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "path" + } + ], + "expression": "[null]|[path]" + }, + "spec": [ + { + "type": "text", + "text": "Returns path to the downloaded file in case of successful download. The method will↵wait for the download to finish if necessary. The method throws when connected remotely." + }, + { + "type": "text", + "text": "Note that the download's file name is a random GUID, use [`method: Download.suggestedFilename`]↵to get suggested file name." + } + ], + "required": true, + "comment": "Returns path to the downloaded file in case of successful download. The method will wait for the download to finish\nif necessary. The method throws when connected remotely.\n\nNote that the download's file name is a random GUID, use [`method: Download.suggestedFilename`] to get suggested\nfile name.", + "async": true, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "saveAs", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Copy the download to a user-specified path. It is safe to call this method while the download↵is still in progress. Will wait for the download to finish if necessary." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "await download.saveAs('/path/to/save/at/' + download.suggestedFilename());" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "download.saveAs(Paths.get(\"/path/to/save/at/\", download.suggestedFilename()));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "await download.save_as(\"/path/to/save/at/\" + download.suggested_filename)" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "download.save_as(\"/path/to/save/at/\" + download.suggested_filename)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "await download.SaveAsAsync(\"/path/to/save/at/\" + download.SuggestedFilename);" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Copy the download to a user-specified path. It is safe to call this method while the download is still in progress.\nWill wait for the download to finish if necessary.\n\n**Usage**\n\n```js\nawait download.saveAs('/path/to/save/at/' + download.suggestedFilename());\n```\n\n```java\ndownload.saveAs(Paths.get(\"/path/to/save/at/\", download.suggestedFilename()));\n```\n\n```py\nawait download.save_as(\"/path/to/save/at/\" + download.suggested_filename)\n```\n\n```py\ndownload.save_as(\"/path/to/save/at/\" + download.suggested_filename)\n```\n\n```csharp\nawait download.SaveAsAsync(\"/path/to/save/at/\" + download.SuggestedFilename);\n```\n", + "async": true, + "alias": "saveAs", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path where the download should be copied." + } + ], + "required": true, + "comment": "Path where the download should be copied.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "suggestedFilename", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Returns suggested filename for this download. It is typically computed by the browser from the↵[`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response header↵or the `download` attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources). Different↵browsers can use different logic for computing it." + } + ], + "required": true, + "comment": "Returns suggested filename for this download. It is typically computed by the browser from the\n[`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response\nheader or the `download` attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources).\nDifferent browsers can use different logic for computing it.", + "async": false, + "alias": "suggestedFilename", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "url", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Returns downloaded url." + } + ], + "required": true, + "comment": "Returns downloaded url.", + "async": false, + "alias": "url", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "Electron", + "spec": [ + { + "type": "text", + "text": "Playwright has **experimental** support for Electron automation. You can access electron namespace via:" + }, + { + "type": "code", + "lines": [ + "const { _electron } = require('playwright');" + ], + "codeLang": "js" + }, + { + "type": "text", + "text": "An example of the Electron automation script would be:" + }, + { + "type": "code", + "lines": [ + "const { _electron: electron } = require('playwright');", + "", + "(async () => {", + " // Launch Electron app.", + " const electronApp = await electron.launch({ args: ['main.js'] });", + "", + " // Evaluation expression in the Electron context.", + " const appPath = await electronApp.evaluate(async ({ app }) => {", + " // This runs in the main Electron process, parameter here is always", + " // the result of the require('electron') in the main app script.", + " return app.getAppPath();", + " });", + " console.log(appPath);", + "", + " // Get the first window that the app opens, wait if necessary.", + " const window = await electronApp.firstWindow();", + " // Print the title.", + " console.log(await window.title());", + " // Capture a screenshot.", + " await window.screenshot({ path: 'intro.png' });", + " // Direct Electron console to Node terminal.", + " window.on('console', console.log);", + " // Click button.", + " await window.click('text=Click me');", + " // Exit app.", + " await electronApp.close();", + "})();" + ], + "codeLang": "js" + }, + { + "type": "text", + "text": "Note that since you don't need Playwright to install web browsers when testing Electron, you can omit browser download via setting the following environment variable when installing Playwright:" + }, + { + "type": "code", + "lines": [ + "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright" + ], + "codeLang": "bash js" + }, + { + "type": "text", + "text": "**Supported Electron versions are:**" + }, + { + "type": "li", + "text": "v12.2.0+", + "liType": "bullet" + }, + { + "type": "li", + "text": "v13.4.0+", + "liType": "bullet" + }, + { + "type": "li", + "text": "v14+", + "liType": "bullet" + }, + { + "type": "text", + "text": "**Known issues:**" + }, + { + "type": "text", + "text": "If you are not able to launch Electron and it will end up in timeouts during launch, try the following:" + }, + { + "type": "li", + "text": "Ensure that `nodeCliInspect` ([FuseV1Options.EnableNodeCliInspectArguments](https://www.electronjs.org/docs/latest/tutorial/fuses#nodecliinspect)) fuse is **not** set to `false`.", + "liType": "bullet" + } + ], + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "comment": "Playwright has **experimental** support for Electron automation. You can access electron namespace via:\n\n```js\nconst { _electron } = require('playwright');\n```\n\nAn example of the Electron automation script would be:\n\n```js\nconst { _electron: electron } = require('playwright');\n\n(async () => {\n // Launch Electron app.\n const electronApp = await electron.launch({ args: ['main.js'] });\n\n // Evaluation expression in the Electron context.\n const appPath = await electronApp.evaluate(async ({ app }) => {\n // This runs in the main Electron process, parameter here is always\n // the result of the require('electron') in the main app script.\n return app.getAppPath();\n });\n console.log(appPath);\n\n // Get the first window that the app opens, wait if necessary.\n const window = await electronApp.firstWindow();\n // Print the title.\n console.log(await window.title());\n // Capture a screenshot.\n await window.screenshot({ path: 'intro.png' });\n // Direct Electron console to Node terminal.\n window.on('console', console.log);\n // Click button.\n await window.click('text=Click me');\n // Exit app.\n await electronApp.close();\n})();\n```\n\nNote that since you don't need Playwright to install web browsers when testing Electron, you can omit browser\ndownload via setting the following environment variable when installing Playwright:\n\n```bash\nPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright\n```\n\n**Supported Electron versions are:**\n- v12.2.0+\n- v13.4.0+\n- v14+\n\n**Known issues:**\n\nIf you are not able to launch Electron and it will end up in timeouts during launch, try the following:\n- Ensure that `nodeCliInspect`\n ([FuseV1Options.EnableNodeCliInspectArguments](https://www.electronjs.org/docs/latest/tutorial/fuses#nodecliinspect))\n fuse is **not** set to `false`.", + "since": "v1.9", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "launch", + "type": { + "name": "ElectronApplication", + "expression": "[ElectronApplication]" + }, + "spec": [ + { + "type": "text", + "text": "Launches electron application specified with the `executablePath`." + } + ], + "required": true, + "comment": "Launches electron application specified with the `executablePath`.", + "async": true, + "alias": "launch", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "acceptDownloads", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted." + } + ], + "required": false, + "comment": "Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.", + "async": false, + "alias": "acceptDownloads", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "args", + "type": { + "name": "Array", + "templates": [ + { + "name": "string" + } + ], + "expression": "[Array]<[string]>" + }, + "spec": [ + { + "type": "text", + "text": "Additional arguments to pass to the application when launching. You typically pass the main↵script name here." + } + ], + "required": false, + "comment": "Additional arguments to pass to the application when launching. You typically pass the main script name here.", + "async": false, + "alias": "args", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "bypassCSP", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`." + } + ], + "required": false, + "comment": "Toggles bypassing page's Content-Security-Policy. Defaults to `false`.", + "async": false, + "alias": "bypassCSP", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.12", + "name": "colorScheme", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "ColorScheme", + "union": [ + { + "name": "\"light\"" + }, + { + "name": "\"dark\"" + }, + { + "name": "\"no-preference\"" + } + ] + } + ], + "expression": "null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">" + }, + "spec": [ + { + "type": "text", + "text": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`." + } + ], + "required": false, + "comment": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.", + "async": false, + "alias": "colorScheme", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "cwd", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Current working directory to launch application from." + } + ], + "required": false, + "comment": "Current working directory to launch application from.", + "async": false, + "alias": "cwd", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "env", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "Specifies environment variables that will be visible to Electron. Defaults to `process.env`." + } + ], + "required": false, + "comment": "Specifies environment variables that will be visible to Electron. Defaults to `process.env`.", + "async": false, + "alias": "env", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "executablePath", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Launches given Electron application. If not specified, launches the default Electron↵executable installed in this package, located at `node_modules/.bin/electron`." + } + ], + "required": false, + "comment": "Launches given Electron application. If not specified, launches the default Electron executable installed in this\npackage, located at `node_modules/.bin/electron`.", + "async": false, + "alias": "executablePath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "extraHTTPHeaders", + "type": { + "name": "Object", + "templates": [ + { + "name": "string" + }, + { + "name": "string" + } + ], + "expression": "[Object]<[string], [string]>" + }, + "spec": [ + { + "type": "text", + "text": "An object containing additional HTTP headers to be sent with every request. Defaults to none." + } + ], + "required": false, + "comment": "An object containing additional HTTP headers to be sent with every request. Defaults to none.", + "async": false, + "alias": "extraHTTPHeaders", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "geolocation", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "latitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Latitude between -90 and 90." + } + ], + "required": true, + "comment": "Latitude between -90 and 90.", + "async": false, + "alias": "latitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "longitude", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Longitude between -180 and 180." + } + ], + "required": true, + "comment": "Longitude between -180 and 180.", + "async": false, + "alias": "longitude", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "accuracy", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Non-negative accuracy value. Defaults to `0`." + } + ], + "required": false, + "comment": "Non-negative accuracy value. Defaults to `0`.", + "async": false, + "alias": "accuracy", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [], + "required": false, + "comment": "", + "async": false, + "alias": "geolocation", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "httpCredentials", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "username", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "username", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "password", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "password", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "origin", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Restrain sending http credentials on specific origin (scheme://host:port)." + } + ], + "required": false, + "comment": "Restrain sending http credentials on specific origin (scheme://host:port).", + "async": false, + "alias": "origin", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses." + } + ], + "required": false, + "comment": "Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.", + "async": false, + "alias": "httpCredentials", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "ignoreHTTPSErrors", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.", + "async": false, + "alias": "ignoreHTTPSErrors", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "locale", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)." + } + ], + "required": false, + "comment": "Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).", + "async": false, + "alias": "locale", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "offline", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)." + } + ], + "required": false, + "comment": "Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).", + "async": false, + "alias": "offline", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.12", + "name": "recordHar", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "omitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.", + "async": false, + "alias": "omitContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "content", + "type": { + "name": "HarContentPolicy", + "union": [ + { + "name": "\"omit\"" + }, + { + "name": "\"embed\"" + }, + { + "name": "\"attach\"" + } + ], + "expression": "[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions." + } + ], + "required": false, + "comment": "Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.", + "async": false, + "alias": "content", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "path", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default." + } + ], + "required": true, + "comment": "Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.", + "async": false, + "alias": "path", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "mode", + "type": { + "name": "HarMode", + "union": [ + { + "name": "\"full\"" + }, + { + "name": "\"minimal\"" + } + ], + "expression": "[HarMode]<\"full\"|\"minimal\">" + }, + "spec": [ + { + "type": "text", + "text": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`." + } + ], + "required": false, + "comment": "When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.", + "async": false, + "alias": "mode", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "urlFilter", + "type": { + "name": "", + "union": [ + { + "name": "string" + }, + { + "name": "RegExp" + } + ], + "expression": "[string]|[RegExp]" + }, + "spec": [ + { + "type": "text", + "text": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none." + } + ], + "required": false, + "comment": "A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.", + "async": false, + "alias": "urlFilter", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved." + } + ], + "required": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.", + "async": false, + "alias": "recordHar", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_omit_content" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.12", + "name": "recordHarOmitContent", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`." + } + ], + "required": false, + "comment": "Optional setting to control whether to omit request content from the HAR. Defaults to `false`.", + "async": false, + "alias": "recordHarOmitContent", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_har_path" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.12", + "name": "recordHarPath", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved." + } + ], + "required": false, + "comment": "Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.", + "async": false, + "alias": "recordHarPath", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.12", + "name": "recordVideo", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "dir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Path to the directory to put videos into." + } + ], + "required": true, + "comment": "Path to the directory to put videos into.", + "async": false, + "alias": "dir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "size", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "size", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved." + } + ], + "required": false, + "comment": "Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.", + "async": false, + "alias": "recordVideo", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_dir" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.12", + "name": "recordVideoDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved." + } + ], + "required": false, + "comment": "Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.", + "async": false, + "alias": "recordVideoDir", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "csharp", + "java", + "python" + ], + "aliases": { + "python": "record_video_size" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.12", + "name": "recordVideoSize", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame width." + } + ], + "required": true, + "comment": "Video frame width.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "Video frame height." + } + ], + "required": true, + "comment": "Video frame height.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size." + } + ], + "required": false, + "comment": "Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.", + "async": false, + "alias": "recordVideoSize", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.15", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds to wait for the application to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout." + } + ], + "required": false, + "comment": "Maximum time in milliseconds to wait for the application to start. Defaults to `30000` (30 seconds). Pass `0` to\ndisable timeout.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.12", + "name": "timezoneId", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone." + } + ], + "required": false, + "comment": "Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.", + "async": false, + "alias": "timezoneId", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.36", + "name": "tracesDir", + "type": { + "name": "path", + "expression": "[path]" + }, + "spec": [ + { + "type": "text", + "text": "If specified, traces are saved into this directory." + } + ], + "required": false, + "comment": "If specified, traces are saved into this directory.", + "async": false, + "alias": "tracesDir", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ] + }, + { + "name": "ElectronApplication", + "spec": [ + { + "type": "text", + "text": "Electron application representation. You can use [`method: Electron.launch`] to↵obtain the application instance. This instance you can control main electron process↵as well as work with Electron windows:" + }, + { + "type": "code", + "lines": [ + "const { _electron: electron } = require('playwright');", + "", + "(async () => {", + " // Launch Electron app.", + " const electronApp = await electron.launch({ args: ['main.js'] });", + "", + " // Evaluation expression in the Electron context.", + " const appPath = await electronApp.evaluate(async ({ app }) => {", + " // This runs in the main Electron process, parameter here is always", + " // the result of the require('electron') in the main app script.", + " return app.getAppPath();", + " });", + " console.log(appPath);", + "", + " // Get the first window that the app opens, wait if necessary.", + " const window = await electronApp.firstWindow();", + " // Print the title.", + " console.log(await window.title());", + " // Capture a screenshot.", + " await window.screenshot({ path: 'intro.png' });", + " // Direct Electron console to Node terminal.", + " window.on('console', console.log);", + " // Click button.", + " await window.click('text=Click me');", + " // Exit app.", + " await electronApp.close();", + "})();" + ], + "codeLang": "js" + } + ], + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "comment": "Electron application representation. You can use [`method: Electron.launch`] to obtain the application instance.\nThis instance you can control main electron process as well as work with Electron windows:\n\n```js\nconst { _electron: electron } = require('playwright');\n\n(async () => {\n // Launch Electron app.\n const electronApp = await electron.launch({ args: ['main.js'] });\n\n // Evaluation expression in the Electron context.\n const appPath = await electronApp.evaluate(async ({ app }) => {\n // This runs in the main Electron process, parameter here is always\n // the result of the require('electron') in the main app script.\n return app.getAppPath();\n });\n console.log(appPath);\n\n // Get the first window that the app opens, wait if necessary.\n const window = await electronApp.firstWindow();\n // Print the title.\n console.log(await window.title());\n // Capture a screenshot.\n await window.screenshot({ path: 'intro.png' });\n // Direct Electron console to Node terminal.\n window.on('console', console.log);\n // Click button.\n await window.click('text=Click me');\n // Exit app.\n await electronApp.close();\n})();\n```\n", + "since": "v1.9", + "members": [ + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "This event is issued when the application closes." + } + ], + "required": true, + "comment": "This event is issued when the application closes.", + "async": false, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "event", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "window", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "This event is issued for every window that is created **and loaded** in Electron. It contains a `Page` that can↵be used for Playwright automation." + } + ], + "required": true, + "comment": "This event is issued for every window that is created **and loaded** in Electron. It contains a `Page` that can be\nused for Playwright automation.", + "async": false, + "alias": "window", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "browserWindow", + "type": { + "name": "JSHandle", + "expression": "[JSHandle]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the BrowserWindow object that corresponds to the given Playwright page." + } + ], + "required": true, + "comment": "Returns the BrowserWindow object that corresponds to the given Playwright page.", + "async": true, + "alias": "browserWindow", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "page", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "Page to retrieve the window for." + } + ], + "required": true, + "comment": "Page to retrieve the window for.", + "async": false, + "alias": "page", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "close", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "Closes Electron application." + } + ], + "required": true, + "comment": "Closes Electron application.", + "async": true, + "alias": "close", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "context", + "type": { + "name": "BrowserContext", + "expression": "[BrowserContext]" + }, + "spec": [ + { + "type": "text", + "text": "This method returns browser context that can be used for setting up context-wide routing, etc." + } + ], + "required": true, + "comment": "This method returns browser context that can be used for setting up context-wide routing, etc.", + "async": false, + "alias": "context", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "evaluate", + "type": { + "name": "Serializable", + "expression": "[Serializable]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the return value of `expression`." + }, + { + "type": "text", + "text": "If the function passed to the [`method: ElectronApplication.evaluate`] returns a [Promise], then↵[`method: ElectronApplication.evaluate`] would wait for the promise to resolve and return its value." + }, + { + "type": "text", + "text": "If the function passed to the [`method: ElectronApplication.evaluate`] returns a non-[Serializable] value, then↵[`method: ElectronApplication.evaluate`] returns `undefined`. Playwright also supports transferring↵some additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`." + } + ], + "required": true, + "comment": "Returns the return value of `expression`.\n\nIf the function passed to the [`method: ElectronApplication.evaluate`] returns a [Promise], then\n[`method: ElectronApplication.evaluate`] would wait for the promise to resolve and return its value.\n\nIf the function passed to the [`method: ElectronApplication.evaluate`] returns a non-[Serializable] value, then\n[`method: ElectronApplication.evaluate`] returns `undefined`. Playwright also supports transferring some additional\nvalues that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.", + "async": true, + "alias": "evaluate", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": { + "overrides": { + "js": { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "expression", + "type": { + "name": "", + "union": [ + { + "name": "function" + }, + { + "name": "Electron" + } + ], + "expression": "[function]|[Electron]" + }, + "spec": [ + { + "type": "text", + "text": "Function to be evaluated in the main Electron process." + } + ], + "argsArray": [], + "required": true, + "comment": "", + "args": {}, + "clazz": null, + "async": false, + "alias": "pageFunction", + "overloadIndex": 0, + "paramOrOption": null + } + } + }, + "experimental": false, + "since": "v1.9", + "name": "expression", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked." + } + ], + "required": true, + "comment": "JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.", + "async": false, + "alias": "expression", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "arg", + "type": { + "name": "EvaluationArgument", + "expression": "[EvaluationArgument]" + }, + "spec": [ + { + "type": "text", + "text": "Optional argument to pass to `expression`." + } + ], + "required": false, + "comment": "Optional argument to pass to `expression`.", + "async": false, + "alias": "arg", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "evaluateHandle", + "type": { + "name": "JSHandle", + "expression": "[JSHandle]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the return value of `expression` as a `JSHandle`." + }, + { + "type": "text", + "text": "The only difference between [`method: ElectronApplication.evaluate`] and [`method: ElectronApplication.evaluateHandle`] is that [`method: ElectronApplication.evaluateHandle`] returns `JSHandle`." + }, + { + "type": "text", + "text": "If the function passed to the [`method: ElectronApplication.evaluateHandle`] returns a [Promise], then↵[`method: ElectronApplication.evaluateHandle`] would wait for the promise to resolve and return its value." + } + ], + "required": true, + "comment": "Returns the return value of `expression` as a `JSHandle`.\n\nThe only difference between [`method: ElectronApplication.evaluate`] and\n[`method: ElectronApplication.evaluateHandle`] is that [`method: ElectronApplication.evaluateHandle`] returns\n`JSHandle`.\n\nIf the function passed to the [`method: ElectronApplication.evaluateHandle`] returns a [Promise], then\n[`method: ElectronApplication.evaluateHandle`] would wait for the promise to resolve and return its value.", + "async": true, + "alias": "evaluateHandle", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": { + "overrides": { + "js": { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "expression", + "type": { + "name": "", + "union": [ + { + "name": "function" + }, + { + "name": "Electron" + } + ], + "expression": "[function]|[Electron]" + }, + "spec": [ + { + "type": "text", + "text": "Function to be evaluated in the main Electron process." + } + ], + "argsArray": [], + "required": true, + "comment": "", + "args": {}, + "clazz": null, + "async": false, + "alias": "pageFunction", + "overloadIndex": 0, + "paramOrOption": null + } + } + }, + "experimental": false, + "since": "v1.9", + "name": "expression", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked." + } + ], + "required": true, + "comment": "JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.", + "async": false, + "alias": "expression", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "arg", + "type": { + "name": "EvaluationArgument", + "expression": "[EvaluationArgument]" + }, + "spec": [ + { + "type": "text", + "text": "Optional argument to pass to `expression`." + } + ], + "required": false, + "comment": "Optional argument to pass to `expression`.", + "async": false, + "alias": "arg", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "firstWindow", + "type": { + "name": "Page", + "expression": "[Page]" + }, + "spec": [ + { + "type": "text", + "text": "Convenience method that waits for the first application window to be opened." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "const electronApp = await electron.launch({", + " args: ['main.js']", + "});", + "const window = await electronApp.firstWindow();", + "// ..." + ], + "codeLang": "js" + } + ], + "required": true, + "comment": "Convenience method that waits for the first application window to be opened.\n\n**Usage**\n\n```js\nconst electronApp = await electron.launch({\n args: ['main.js']\n});\nconst window = await electronApp.firstWindow();\n// ...\n```\n", + "async": true, + "alias": "firstWindow", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.33", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds).↵Pass `0` to disable timeout. The default value can be changed by using the↵[`method: BrowserContext.setDefaultTimeout`]." + } + ], + "required": false, + "comment": "Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.21", + "name": "process", + "type": { + "name": "ChildProcess", + "expression": "[ChildProcess]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the main process for this Electron Application." + } + ], + "required": true, + "comment": "Returns the main process for this Electron Application.", + "async": false, + "alias": "process", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "waitForEvent", + "type": { + "name": "any", + "expression": "[any]" + }, + "spec": [ + { + "type": "text", + "text": "Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value. Will throw an error if the application is closed before the event is fired. Returns the event data value." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "const windowPromise = electronApp.waitForEvent('window');", + "await mainWindow.click('button');", + "const window = await windowPromise;" + ], + "codeLang": "js" + } + ], + "required": true, + "comment": "Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue. Will throw an error if the application is closed before the event is fired. Returns the event data value.\n\n**Usage**\n\n```js\nconst windowPromise = electronApp.waitForEvent('window');\nawait mainWindow.click('button');\nconst window = await windowPromise;\n```\n", + "async": true, + "alias": "waitForEvent", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": { + "only": [ + "js", + "python", + "java" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "event", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "Event name, same one typically passed into `*.on(event)`." + } + ], + "required": true, + "comment": "Event name, same one typically passed into `*.on(event)`.", + "async": false, + "alias": "event", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "optionsOrPredicate", + "type": { + "name": "", + "union": [ + { + "name": "function" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "predicate", + "type": { + "name": "function", + "expression": "[function]" + }, + "spec": [ + { + "type": "text", + "text": "receives the event data and resolves to truthy value when the waiting should resolve." + } + ], + "required": true, + "comment": "receives the event data and resolves to truthy value when the waiting should resolve.", + "async": false, + "alias": "predicate", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]." + } + ], + "required": false, + "comment": "maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[function]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "Either a predicate that receives an event or an options object. Optional." + } + ], + "required": false, + "comment": "Either a predicate that receives an event or an options object. Optional.", + "async": false, + "alias": "optionsOrPredicate", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "windows", + "type": { + "name": "Array", + "templates": [ + { + "name": "Page" + } + ], + "expression": "[Array]<[Page]>" + }, + "spec": [ + { + "type": "text", + "text": "Convenience method that returns all the opened windows." + } + ], + "required": true, + "comment": "Convenience method that returns all the opened windows.", + "async": false, + "alias": "windows", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + } + ] + }, + { + "name": "ElementHandle", + "spec": [ + { + "type": "li", + "text": "extends: `JSHandle`", + "liType": "bullet" + }, + { + "type": "text", + "text": "ElementHandle represents an in-page DOM element. ElementHandles can be created with the [`method: Page.querySelector`] method." + }, + { + "type": "note", + "noteType": "caution Discouraged", + "text": "The use of ElementHandle is discouraged, use `Locator` objects and web-first assertions instead." + }, + { + "type": "code", + "lines": [ + "const hrefElement = await page.$('a');", + "await hrefElement.click();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "ElementHandle hrefElement = page.querySelector(\"a\");", + "hrefElement.click();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "href_element = await page.query_selector(\"a\")", + "await href_element.click()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "href_element = page.query_selector(\"a\")", + "href_element.click()" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var handle = await page.QuerySelectorAsync(\"a\");", + "await handle.ClickAsync();" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "ElementHandle prevents DOM element from garbage collection unless the handle is disposed with↵[`method: JSHandle.dispose`]. ElementHandles are auto-disposed when their origin frame gets navigated." + }, + { + "type": "text", + "text": "ElementHandle instances can be used as an argument in [`method: Page.evalOnSelector`] and [`method: Page.evaluate`] methods." + }, + { + "type": "text", + "text": "The difference between the `Locator` and ElementHandle is that the ElementHandle points to a particular element, while `Locator` captures the logic of how to retrieve an element." + }, + { + "type": "text", + "text": "In the example below, handle points to a particular DOM element on page. If that element changes text or is used by React to render an entirely different component, handle is still pointing to that very DOM element. This can lead to unexpected behaviors." + }, + { + "type": "code", + "lines": [ + "const handle = await page.$('text=Submit');", + "// ...", + "await handle.hover();", + "await handle.click();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "ElementHandle handle = page.querySelector(\"text=Submit\");", + "handle.hover();", + "handle.click();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "handle = await page.query_selector(\"text=Submit\")", + "await handle.hover()", + "await handle.click()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "handle = page.query_selector(\"text=Submit\")", + "handle.hover()", + "handle.click()" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var handle = await page.QuerySelectorAsync(\"text=Submit\");", + "await handle.HoverAsync();", + "await handle.ClickAsync();" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "With the locator, every time the `element` is used, up-to-date DOM element is located in the page using the selector. So in the snippet below, underlying DOM element is going to be located twice." + }, + { + "type": "code", + "lines": [ + "const locator = page.getByText('Submit');", + "// ...", + "await locator.hover();", + "await locator.click();" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "Locator locator = page.getByText(\"Submit\");", + "locator.hover();", + "locator.click();" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "locator = page.get_by_text(\"Submit\")", + "await locator.hover()", + "await locator.click()" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "locator = page.get_by_text(\"Submit\")", + "locator.hover()", + "locator.click()" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var locator = page.GetByText(\"Submit\");", + "await locator.HoverAsync();", + "await locator.ClickAsync();" + ], + "codeLang": "csharp" + } + ], + "extends": "JSHandle", + "langs": {}, + "comment": "- extends: `JSHandle`\n\nElementHandle represents an in-page DOM element. ElementHandles can be created with the\n[`method: Page.querySelector`] method.\n\n**NOTE** The use of ElementHandle is discouraged, use `Locator` objects and web-first assertions instead.\n\n```js\nconst hrefElement = await page.$('a');\nawait hrefElement.click();\n```\n\n```java\nElementHandle hrefElement = page.querySelector(\"a\");\nhrefElement.click();\n```\n\n```py\nhref_element = await page.query_selector(\"a\")\nawait href_element.click()\n```\n\n```py\nhref_element = page.query_selector(\"a\")\nhref_element.click()\n```\n\n```csharp\nvar handle = await page.QuerySelectorAsync(\"a\");\nawait handle.ClickAsync();\n```\n\nElementHandle prevents DOM element from garbage collection unless the handle is disposed with\n[`method: JSHandle.dispose`]. ElementHandles are auto-disposed when their origin frame gets navigated.\n\nElementHandle instances can be used as an argument in [`method: Page.evalOnSelector`] and [`method: Page.evaluate`]\nmethods.\n\nThe difference between the `Locator` and ElementHandle is that the ElementHandle points to a particular element,\nwhile `Locator` captures the logic of how to retrieve an element.\n\nIn the example below, handle points to a particular DOM element on page. If that element changes text or is used by\nReact to render an entirely different component, handle is still pointing to that very DOM element. This can lead\nto unexpected behaviors.\n\n```js\nconst handle = await page.$('text=Submit');\n// ...\nawait handle.hover();\nawait handle.click();\n```\n\n```java\nElementHandle handle = page.querySelector(\"text=Submit\");\nhandle.hover();\nhandle.click();\n```\n\n```py\nhandle = await page.query_selector(\"text=Submit\")\nawait handle.hover()\nawait handle.click()\n```\n\n```py\nhandle = page.query_selector(\"text=Submit\")\nhandle.hover()\nhandle.click()\n```\n\n```csharp\nvar handle = await page.QuerySelectorAsync(\"text=Submit\");\nawait handle.HoverAsync();\nawait handle.ClickAsync();\n```\n\nWith the locator, every time the `element` is used, up-to-date DOM element is located in the page using the\nselector. So in the snippet below, underlying DOM element is going to be located twice.\n\n```js\nconst locator = page.getByText('Submit');\n// ...\nawait locator.hover();\nawait locator.click();\n```\n\n```java\nLocator locator = page.getByText(\"Submit\");\nlocator.hover();\nlocator.click();\n```\n\n```py\nlocator = page.get_by_text(\"Submit\")\nawait locator.hover()\nawait locator.click()\n```\n\n```py\nlocator = page.get_by_text(\"Submit\")\nlocator.hover()\nlocator.click()\n```\n\n```csharp\nvar locator = page.GetByText(\"Submit\");\nawait locator.HoverAsync();\nawait locator.ClickAsync();\n```\n", + "since": "v1.8", + "members": [ + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "boundingBox", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "x", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "the x coordinate of the element in pixels." + } + ], + "required": true, + "comment": "the x coordinate of the element in pixels.", + "async": false, + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "y", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "the y coordinate of the element in pixels." + } + ], + "required": true, + "comment": "the y coordinate of the element in pixels.", + "async": false, + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "width", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "the width of the element in pixels." + } + ], + "required": true, + "comment": "the width of the element in pixels.", + "async": false, + "alias": "width", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "height", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "the height of the element in pixels." + } + ], + "required": true, + "comment": "the height of the element in pixels.", + "async": false, + "alias": "height", + "overloadIndex": 0, + "paramOrOption": null + } + ] + } + ], + "expression": "[null]|[Object]" + }, + "spec": [ + { + "type": "text", + "text": "This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is↵calculated relative to the main frame viewport - which is usually the same as the browser window." + }, + { + "type": "text", + "text": "Scrolling affects the returned bounding box, similarly to↵[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). That↵means `x` and/or `y` may be negative." + }, + { + "type": "text", + "text": "Elements from child frames return the bounding box relative to the main frame, unlike the↵[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)." + }, + { + "type": "text", + "text": "Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following↵snippet should click the center of the element." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "const box = await elementHandle.boundingBox();", + "await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "BoundingBox box = elementHandle.boundingBox();", + "page.mouse().click(box.x + box.width / 2, box.y + box.height / 2);" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "box = await element_handle.bounding_box()", + "await page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "box = element_handle.bounding_box()", + "page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var box = await elementHandle.BoundingBoxAsync();", + "await page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2);" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is\ncalculated relative to the main frame viewport - which is usually the same as the browser window.\n\nScrolling affects the returned bounding box, similarly to\n[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\nThat means `x` and/or `y` may be negative.\n\nElements from child frames return the bounding box relative to the main frame, unlike the\n[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\n\nAssuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the\nfollowing snippet should click the center of the element.\n\n**Usage**\n\n```js\nconst box = await elementHandle.boundingBox();\nawait page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);\n```\n\n```java\nBoundingBox box = elementHandle.boundingBox();\npage.mouse().click(box.x + box.width / 2, box.y + box.height / 2);\n```\n\n```py\nbox = await element_handle.bounding_box()\nawait page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)\n```\n\n```py\nbox = element_handle.bounding_box()\npage.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)\n```\n\n```csharp\nvar box = await elementHandle.BoundingBoxAsync();\nawait page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2);\n```\n", + "async": true, + "alias": "boundingBox", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "check", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "This method checks the element by performing the following steps:" + }, + { + "type": "li", + "text": "Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already↵checked, this method returns immediately.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Scroll the element into view if needed.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Use [`property: Page.mouse`] to click in the center of the element.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Ensure that the element is now checked. If not, this method throws.", + "liType": "ordinal" + }, + { + "type": "text", + "text": "If the element is detached from the DOM at any moment during the action, this method throws." + }, + { + "type": "text", + "text": "When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this." + } + ], + "required": true, + "comment": "This method checks the element by performing the following steps:\n1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already\n checked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked. If not, this method throws.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.", + "async": true, + "alias": "check", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "force", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.", + "async": false, + "alias": "force", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "noWaitAfter", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`." + } + ], + "required": false, + "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.", + "async": false, + "alias": "noWaitAfter", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "position", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "x", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "y", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element." + } + ], + "required": false, + "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.", + "async": false, + "alias": "position", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python", + "java", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods." + } + ], + "required": false, + "comment": "Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods." + } + ], + "required": false, + "comment": "Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "trial", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it." + } + ], + "required": false, + "comment": "When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.", + "async": false, + "alias": "trial", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "click", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "This method clicks the element by performing the following steps:" + }, + { + "type": "li", + "text": "Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Scroll the element into view if needed.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.", + "liType": "ordinal" + }, + { + "type": "text", + "text": "If the element is detached from the DOM at any moment during the action, this method throws." + }, + { + "type": "text", + "text": "When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this." + } + ], + "required": true, + "comment": "This method clicks the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.", + "async": true, + "alias": "click", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "button", + "type": { + "name": "MouseButton", + "union": [ + { + "name": "\"left\"" + }, + { + "name": "\"right\"" + }, + { + "name": "\"middle\"" + } + ], + "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">" + }, + "spec": [ + { + "type": "text", + "text": "Defaults to `left`." + } + ], + "required": false, + "comment": "Defaults to `left`.", + "async": false, + "alias": "button", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "clickCount", + "type": { + "name": "int", + "expression": "[int]" + }, + "spec": [ + { + "type": "text", + "text": "defaults to 1. See [UIEvent.detail]." + } + ], + "required": false, + "comment": "defaults to 1. See [UIEvent.detail].", + "async": false, + "alias": "clickCount", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "delay", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0." + } + ], + "required": false, + "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", + "async": false, + "alias": "delay", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "force", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.", + "async": false, + "alias": "force", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "modifiers", + "type": { + "name": "Array", + "templates": [ + { + "name": "KeyboardModifier", + "union": [ + { + "name": "\"Alt\"" + }, + { + "name": "\"Control\"" + }, + { + "name": "\"Meta\"" + }, + { + "name": "\"Shift\"" + } + ] + } + ], + "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>" + }, + "spec": [ + { + "type": "text", + "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used." + } + ], + "required": false, + "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used.", + "async": false, + "alias": "modifiers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "noWaitAfter", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`." + } + ], + "required": false, + "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.", + "async": false, + "alias": "noWaitAfter", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "position", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "x", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "y", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element." + } + ], + "required": false, + "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.", + "async": false, + "alias": "position", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python", + "java", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods." + } + ], + "required": false, + "comment": "Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods." + } + ], + "required": false, + "comment": "Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "trial", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it." + } + ], + "required": false, + "comment": "When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.", + "async": false, + "alias": "trial", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "contentFrame", + "type": { + "name": "", + "union": [ + { + "name": "null" + }, + { + "name": "Frame" + } + ], + "expression": "[null]|[Frame]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the content frame for element handles referencing iframe nodes, or `null` otherwise" + } + ], + "required": true, + "comment": "Returns the content frame for element handles referencing iframe nodes, or `null` otherwise", + "async": true, + "alias": "contentFrame", + "overloadIndex": 0, + "paramOrOption": null, + "args": [] + }, + { + "kind": "method", + "langs": { + "aliases": { + "csharp": "DblClickAsync" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "dblclick", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "This method double clicks the element by performing the following steps:" + }, + { + "type": "li", + "text": "Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Scroll the element into view if needed.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.", + "liType": "ordinal" + }, + { + "type": "li", + "text": "Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that↵if the first click of the `dblclick()` triggers a navigation event, this method will throw.", + "liType": "ordinal" + }, + { + "type": "text", + "text": "If the element is detached from the DOM at any moment during the action, this method throws." + }, + { + "type": "text", + "text": "When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this." + }, + { + "type": "note", + "noteType": "note", + "text": "`elementHandle.dblclick()` dispatches two `click` events and a single `dblclick` event." + } + ], + "required": true, + "comment": "This method double clicks the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if\n the first click of the `dblclick()` triggers a navigation event, this method will throw.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** `elementHandle.dblclick()` dispatches two `click` events and a single `dblclick` event.", + "async": true, + "alias": "dblclick", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "options", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "button", + "type": { + "name": "MouseButton", + "union": [ + { + "name": "\"left\"" + }, + { + "name": "\"right\"" + }, + { + "name": "\"middle\"" + } + ], + "expression": "[MouseButton]<\"left\"|\"right\"|\"middle\">" + }, + "spec": [ + { + "type": "text", + "text": "Defaults to `left`." + } + ], + "required": false, + "comment": "Defaults to `left`.", + "async": false, + "alias": "button", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "delay", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0." + } + ], + "required": false, + "comment": "Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.", + "async": false, + "alias": "delay", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "force", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`." + } + ], + "required": false, + "comment": "Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.", + "async": false, + "alias": "force", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "modifiers", + "type": { + "name": "Array", + "templates": [ + { + "name": "KeyboardModifier", + "union": [ + { + "name": "\"Alt\"" + }, + { + "name": "\"Control\"" + }, + { + "name": "\"Meta\"" + }, + { + "name": "\"Shift\"" + } + ] + } + ], + "expression": "[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">>" + }, + "spec": [ + { + "type": "text", + "text": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used." + } + ], + "required": false, + "comment": "Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used.", + "async": false, + "alias": "modifiers", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "noWaitAfter", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`." + } + ], + "required": false, + "comment": "Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.", + "async": false, + "alias": "noWaitAfter", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "position", + "type": { + "name": "Object", + "properties": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "x", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "x", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.0", + "name": "y", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "" + } + ], + "required": true, + "comment": "", + "async": false, + "alias": "y", + "overloadIndex": 0, + "paramOrOption": null + } + ], + "expression": "[Object]" + }, + "spec": [ + { + "type": "text", + "text": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element." + } + ], + "required": false, + "comment": "A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.", + "async": false, + "alias": "position", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "python", + "java", + "csharp" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods." + } + ], + "required": false, + "comment": "Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.8", + "name": "timeout", + "type": { + "name": "float", + "expression": "[float]" + }, + "spec": [ + { + "type": "text", + "text": "Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods." + } + ], + "required": false, + "comment": "Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.", + "async": false, + "alias": "timeout", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.11", + "name": "trial", + "type": { + "name": "boolean", + "expression": "[boolean]" + }, + "spec": [ + { + "type": "text", + "text": "When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it." + } + ], + "required": false, + "comment": "When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.", + "async": false, + "alias": "trial", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + "required": false, + "comment": "", + "async": false, + "alias": "options", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "dispatchEvent", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`↵is dispatched. This is equivalent to calling↵[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click)." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "await elementHandle.dispatchEvent('click');" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "elementHandle.dispatchEvent(\"click\");" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "await element_handle.dispatch_event(\"click\")" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "element_handle.dispatch_event(\"click\")" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "await elementHandle.DispatchEventAsync(\"click\");" + ], + "codeLang": "csharp" + }, + { + "type": "text", + "text": "Under the hood, it creates an instance of an event based on the given `type`, initializes it with↵`eventInit` properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by↵default." + }, + { + "type": "text", + "text": "Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial↵properties:" + }, + { + "type": "li", + "text": "[DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)", + "liType": "bullet" + }, + { + "type": "li", + "text": "[FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)", + "liType": "bullet" + }, + { + "type": "li", + "text": "[KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)", + "liType": "bullet" + }, + { + "type": "li", + "text": "[MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)", + "liType": "bullet" + }, + { + "type": "li", + "text": "[PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)", + "liType": "bullet" + }, + { + "type": "li", + "text": "[TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)", + "liType": "bullet" + }, + { + "type": "li", + "text": "[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)", + "liType": "bullet" + }, + { + "type": "text", + "text": "You can also specify `JSHandle` as the property value if you want live objects to be passed into the event:" + }, + { + "type": "code", + "lines": [ + "// Note you can only create DataTransfer in Chromium and Firefox", + "const dataTransfer = await page.evaluateHandle(() => new DataTransfer());", + "await elementHandle.dispatchEvent('dragstart', { dataTransfer });" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "// Note you can only create DataTransfer in Chromium and Firefox", + "JSHandle dataTransfer = page.evaluateHandle(\"() => new DataTransfer()\");", + "Map arg = new HashMap<>();", + "arg.put(\"dataTransfer\", dataTransfer);", + "elementHandle.dispatchEvent(\"dragstart\", arg);" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "# note you can only create data_transfer in chromium and firefox", + "data_transfer = await page.evaluate_handle(\"new DataTransfer()\")", + "await element_handle.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "# note you can only create data_transfer in chromium and firefox", + "data_transfer = page.evaluate_handle(\"new DataTransfer()\")", + "element_handle.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var dataTransfer = await page.EvaluateHandleAsync(\"() => new DataTransfer()\");", + "await elementHandle.DispatchEventAsync(\"dragstart\", new Dictionary", + "{", + " { \"dataTransfer\", dataTransfer }", + "});" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element,\n`click` is dispatched. This is equivalent to calling\n[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).\n\n**Usage**\n\n```js\nawait elementHandle.dispatchEvent('click');\n```\n\n```java\nelementHandle.dispatchEvent(\"click\");\n```\n\n```py\nawait element_handle.dispatch_event(\"click\")\n```\n\n```py\nelement_handle.dispatch_event(\"click\")\n```\n\n```csharp\nawait elementHandle.DispatchEventAsync(\"click\");\n```\n\nUnder the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`\nproperties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.\n\nSince `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:\n- [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)\n- [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)\n- [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)\n- [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)\n- [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)\n- [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)\n- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)\n\nYou can also specify `JSHandle` as the property value if you want live objects to be passed into the event:\n\n```js\n// Note you can only create DataTransfer in Chromium and Firefox\nconst dataTransfer = await page.evaluateHandle(() => new DataTransfer());\nawait elementHandle.dispatchEvent('dragstart', { dataTransfer });\n```\n\n```java\n// Note you can only create DataTransfer in Chromium and Firefox\nJSHandle dataTransfer = page.evaluateHandle(\"() => new DataTransfer()\");\nMap arg = new HashMap<>();\narg.put(\"dataTransfer\", dataTransfer);\nelementHandle.dispatchEvent(\"dragstart\", arg);\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = await page.evaluate_handle(\"new DataTransfer()\")\nawait element_handle.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = page.evaluate_handle(\"new DataTransfer()\")\nelement_handle.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})\n```\n\n```csharp\nvar dataTransfer = await page.EvaluateHandleAsync(\"() => new DataTransfer()\");\nawait elementHandle.DispatchEventAsync(\"dragstart\", new Dictionary\n{\n { \"dataTransfer\", dataTransfer }\n});\n```\n", + "async": true, + "alias": "dispatchEvent", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "type", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "DOM event type: `\"click\"`, `\"dragstart\"`, etc." + } + ], + "required": true, + "comment": "DOM event type: `\"click\"`, `\"dragstart\"`, etc.", + "async": false, + "alias": "type", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "eventInit", + "type": { + "name": "EvaluationArgument", + "expression": "[EvaluationArgument]" + }, + "spec": [ + { + "type": "text", + "text": "Optional event-specific initialization properties." + } + ], + "required": false, + "comment": "Optional event-specific initialization properties.", + "async": false, + "alias": "eventInit", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "aliases": { + "python": "eval_on_selector", + "js": "$eval" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "evalOnSelector", + "type": { + "name": "Serializable", + "expression": "[Serializable]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the return value of `expression`." + }, + { + "type": "text", + "text": "The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first↵argument to `expression`. If no elements match the selector, the method throws an error." + }, + { + "type": "text", + "text": "If `expression` returns a [Promise], then [`method: ElementHandle.evalOnSelector`] would wait for the promise to resolve and return its↵value." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "const tweetHandle = await page.$('.tweet');", + "expect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100');", + "expect(await tweetHandle.$eval('.retweets', node => node.innerText)).toBe('10');" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "ElementHandle tweetHandle = page.querySelector(\".tweet\");", + "assertEquals(\"100\", tweetHandle.evalOnSelector(\".like\", \"node => node.innerText\"));", + "assertEquals(\"10\", tweetHandle.evalOnSelector(\".retweets\", \"node => node.innerText\"));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "tweet_handle = await page.query_selector(\".tweet\")", + "assert await tweet_handle.eval_on_selector(\".like\", \"node => node.innerText\") == \"100\"", + "assert await tweet_handle.eval_on_selector(\".retweets\", \"node => node.innerText\") == \"10\"" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "tweet_handle = page.query_selector(\".tweet\")", + "assert tweet_handle.eval_on_selector(\".like\", \"node => node.innerText\") == \"100\"", + "assert tweet_handle.eval_on_selector(\".retweets\", \"node => node.innerText\") == \"10\"" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var tweetHandle = await page.QuerySelectorAsync(\".tweet\");", + "Assert.AreEqual(\"100\", await tweetHandle.EvalOnSelectorAsync(\".like\", \"node => node.innerText\"));", + "Assert.AreEqual(\"10\", await tweetHandle.EvalOnSelectorAsync(\".retweets\", \"node => node.innerText\"));" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Returns the return value of `expression`.\n\nThe method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a\nfirst argument to `expression`. If no elements match the selector, the method throws an error.\n\nIf `expression` returns a [Promise], then [`method: ElementHandle.evalOnSelector`] would wait for the promise to\nresolve and return its value.\n\n**Usage**\n\n```js\nconst tweetHandle = await page.$('.tweet');\nexpect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100');\nexpect(await tweetHandle.$eval('.retweets', node => node.innerText)).toBe('10');\n```\n\n```java\nElementHandle tweetHandle = page.querySelector(\".tweet\");\nassertEquals(\"100\", tweetHandle.evalOnSelector(\".like\", \"node => node.innerText\"));\nassertEquals(\"10\", tweetHandle.evalOnSelector(\".retweets\", \"node => node.innerText\"));\n```\n\n```py\ntweet_handle = await page.query_selector(\".tweet\")\nassert await tweet_handle.eval_on_selector(\".like\", \"node => node.innerText\") == \"100\"\nassert await tweet_handle.eval_on_selector(\".retweets\", \"node => node.innerText\") == \"10\"\n```\n\n```py\ntweet_handle = page.query_selector(\".tweet\")\nassert tweet_handle.eval_on_selector(\".like\", \"node => node.innerText\") == \"100\"\nassert tweet_handle.eval_on_selector(\".retweets\", \"node => node.innerText\") == \"10\"\n```\n\n```csharp\nvar tweetHandle = await page.QuerySelectorAsync(\".tweet\");\nAssert.AreEqual(\"100\", await tweetHandle.EvalOnSelectorAsync(\".like\", \"node => node.innerText\"));\nAssert.AreEqual(\"10\", await tweetHandle.EvalOnSelectorAsync(\".retweets\", \"node => node.innerText\"));\n```\n", + "async": true, + "alias": "evalOnSelector", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "A selector to query for." + } + ], + "required": true, + "comment": "A selector to query for.", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "overrides": { + "js": { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "expression", + "type": { + "name": "", + "union": [ + { + "name": "function", + "args": [ + { + "name": "Element" + } + ] + }, + { + "name": "string" + } + ], + "expression": "[function]([Element])|[string]" + }, + "spec": [ + { + "type": "text", + "text": "Function to be evaluated in the page context." + } + ], + "argsArray": [], + "required": true, + "comment": "", + "args": {}, + "clazz": null, + "async": false, + "alias": "pageFunction", + "overloadIndex": 0, + "paramOrOption": null + } + } + }, + "experimental": false, + "since": "v1.9", + "name": "expression", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked." + } + ], + "required": true, + "comment": "JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.", + "async": false, + "alias": "expression", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "arg", + "type": { + "name": "EvaluationArgument", + "expression": "[EvaluationArgument]" + }, + "spec": [ + { + "type": "text", + "text": "Optional argument to pass to `expression`." + } + ], + "required": false, + "comment": "Optional argument to pass to `expression`.", + "async": false, + "alias": "arg", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": { + "aliases": { + "python": "eval_on_selector_all", + "js": "$$eval" + }, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "evalOnSelectorAll", + "type": { + "name": "Serializable", + "expression": "[Serializable]" + }, + "spec": [ + { + "type": "text", + "text": "Returns the return value of `expression`." + }, + { + "type": "text", + "text": "The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of↵matched elements as a first argument to `expression`." + }, + { + "type": "text", + "text": "If `expression` returns a [Promise], then [`method: ElementHandle.evalOnSelectorAll`] would wait for the promise to resolve and return its↵value." + }, + { + "type": "text", + "text": "**Usage**" + }, + { + "type": "code", + "lines": [ + "
", + "
Hello!
", + "
Hi!
", + "
" + ], + "codeLang": "html" + }, + { + "type": "code", + "lines": [ + "const feedHandle = await page.$('.feed');", + "expect(await feedHandle.$$eval('.tweet', nodes =>", + " nodes.map(n => n.innerText))).toEqual(['Hello!', 'Hi!'],", + ");" + ], + "codeLang": "js" + }, + { + "type": "code", + "lines": [ + "ElementHandle feedHandle = page.querySelector(\".feed\");", + "assertEquals(Arrays.asList(\"Hello!\", \"Hi!\"), feedHandle.evalOnSelectorAll(\".tweet\", \"nodes => nodes.map(n => n.innerText)\"));" + ], + "codeLang": "java" + }, + { + "type": "code", + "lines": [ + "feed_handle = await page.query_selector(\".feed\")", + "assert await feed_handle.eval_on_selector_all(\".tweet\", \"nodes => nodes.map(n => n.innerText)\") == [\"hello!\", \"hi!\"]" + ], + "codeLang": "python async" + }, + { + "type": "code", + "lines": [ + "feed_handle = page.query_selector(\".feed\")", + "assert feed_handle.eval_on_selector_all(\".tweet\", \"nodes => nodes.map(n => n.innerText)\") == [\"hello!\", \"hi!\"]" + ], + "codeLang": "python sync" + }, + { + "type": "code", + "lines": [ + "var feedHandle = await page.QuerySelectorAsync(\".feed\");", + "Assert.AreEqual(new [] { \"Hello!\", \"Hi!\" }, await feedHandle.EvalOnSelectorAllAsync(\".tweet\", \"nodes => nodes.map(n => n.innerText)\"));" + ], + "codeLang": "csharp" + } + ], + "required": true, + "comment": "Returns the return value of `expression`.\n\nThe method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array\nof matched elements as a first argument to `expression`.\n\nIf `expression` returns a [Promise], then [`method: ElementHandle.evalOnSelectorAll`] would wait for the promise to\nresolve and return its value.\n\n**Usage**\n\n```html\n
\n
Hello!
\n
Hi!
\n
\n```\n\n```js\nconst feedHandle = await page.$('.feed');\nexpect(await feedHandle.$$eval('.tweet', nodes =>\n nodes.map(n => n.innerText))).toEqual(['Hello!', 'Hi!'],\n);\n```\n\n```java\nElementHandle feedHandle = page.querySelector(\".feed\");\nassertEquals(Arrays.asList(\"Hello!\", \"Hi!\"), feedHandle.evalOnSelectorAll(\".tweet\", \"nodes => nodes.map(n => n.innerText)\"));\n```\n\n```py\nfeed_handle = await page.query_selector(\".feed\")\nassert await feed_handle.eval_on_selector_all(\".tweet\", \"nodes => nodes.map(n => n.innerText)\") == [\"hello!\", \"hi!\"]\n```\n\n```py\nfeed_handle = page.query_selector(\".feed\")\nassert feed_handle.eval_on_selector_all(\".tweet\", \"nodes => nodes.map(n => n.innerText)\") == [\"hello!\", \"hi!\"]\n```\n\n```csharp\nvar feedHandle = await page.QuerySelectorAsync(\".feed\");\nAssert.AreEqual(new [] { \"Hello!\", \"Hi!\" }, await feedHandle.EvalOnSelectorAllAsync(\".tweet\", \"nodes => nodes.map(n => n.innerText)\"));\n```\n", + "async": true, + "alias": "evalOnSelectorAll", + "overloadIndex": 0, + "paramOrOption": null, + "args": [ + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "selector", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "A selector to query for." + } + ], + "required": true, + "comment": "A selector to query for.", + "async": false, + "alias": "selector", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": { + "overrides": { + "js": { + "kind": "property", + "langs": { + "only": [ + "js" + ], + "aliases": {}, + "types": {}, + "overrides": {} + }, + "experimental": false, + "since": "v1.9", + "name": "expression", + "type": { + "name": "", + "union": [ + { + "name": "function", + "args": [ + { + "name": "Array", + "templates": [ + { + "name": "Element" + } + ] + } + ] + }, + { + "name": "string" + } + ], + "expression": "[function]([Array]<[Element]>)|[string]" + }, + "spec": [ + { + "type": "text", + "text": "Function to be evaluated in the page context." + } + ], + "argsArray": [], + "required": true, + "comment": "", + "args": {}, + "clazz": null, + "async": false, + "alias": "pageFunction", + "overloadIndex": 0, + "paramOrOption": null + } + } + }, + "experimental": false, + "since": "v1.9", + "name": "expression", + "type": { + "name": "string", + "expression": "[string]" + }, + "spec": [ + { + "type": "text", + "text": "JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked." + } + ], + "required": true, + "comment": "JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.", + "async": false, + "alias": "expression", + "overloadIndex": 0, + "paramOrOption": null + }, + { + "kind": "property", + "langs": {}, + "experimental": false, + "since": "v1.9", + "name": "arg", + "type": { + "name": "EvaluationArgument", + "expression": "[EvaluationArgument]" + }, + "spec": [ + { + "type": "text", + "text": "Optional argument to pass to `expression`." + } + ], + "required": false, + "comment": "Optional argument to pass to `expression`.", + "async": false, + "alias": "arg", + "overloadIndex": 0, + "paramOrOption": null + } + ] + }, + { + "kind": "method", + "langs": {}, + "experimental": false, + "since": "v1.8", + "name": "fill", + "type": { + "name": "void" + }, + "spec": [ + { + "type": "text", + "text": "This method waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field." + }, + { + "type": "text", + "text": "If the target element is not an ``, `