diff --git a/FinlyticNews/Adapters/Scraping/ArivaScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/ArivaScraperAdapter.cs new file mode 100644 index 0000000..5220e6c --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/ArivaScraperAdapter.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for Ariva.de. +/// +public class ArivaScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "ariva.de"; + + public override string ArticleBodySelector => "#news_teaser, div.readable, div.column.twothirds"; + + public override async Task ExtractArticleContentAsync(IPage page) + { + // Remove forum widgets, ad containers, and comments before extraction + await page.EvaluateAsync(@"() => { + const el = document.querySelectorAll('#forum_box, #basics-indices-modal, #nativendo-article-desktop, .action-buttons, .summary'); + el.forEach(e => e.remove()); + }"); + + var titleLocator = page.Locator("#news_title").First; + string title = string.Empty; + if (await titleLocator.CountAsync() > 0) + { + title = CleanTitle(await titleLocator.InnerTextAsync()); + } + + var teaserLocator = page.Locator("#news_teaser").First; + if (await teaserLocator.CountAsync() > 0) + { + var text = await teaserLocator.InnerTextAsync(); + var cleaned = TruncateDisclaimers(text.Trim()); + + return new ScrapedArticleResult( + Title: !string.IsNullOrWhiteSpace(title) ? title : CleanTitle(await page.TitleAsync()), + TextContent: cleaned, + HtmlContent: await teaserLocator.InnerHTMLAsync(), + Author: "ARIVA.DE", + Excerpt: cleaned.Length > 250 ? cleaned[..250] + "..." : cleaned, + FinalUrl: page.Url + ); + } + + return await base.ExtractArticleContentAsync(page); + } +} diff --git a/FinlyticNews/Adapters/Scraping/ArticleScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/ArticleScraperAdapter.cs index 50ebeda..29d72d6 100644 --- a/FinlyticNews/Adapters/Scraping/ArticleScraperAdapter.cs +++ b/FinlyticNews/Adapters/Scraping/ArticleScraperAdapter.cs @@ -1,12 +1,13 @@ using System; using System.Text.Json; +using System.Text.RegularExpressions; using System.Threading.Tasks; using Microsoft.Playwright; namespace FinlyticNews.Adapters.Scraping; /// -/// Record holding structured article content extracted via Mozilla Readability. +/// Record holding structured article content extracted from a news webpage. /// public record ScrapedArticleResult( string Title, @@ -14,11 +15,13 @@ public record ScrapedArticleResult( string HtmlContent, string? Author, string? Excerpt, - string FinalUrl + string FinalUrl, + DateTime? PublishedAt = null, + string? Language = null ); /// -/// Abstract base class representing a website-specific scraping adapter. +/// Abstract base class representing a website-specific scraping adapter with heuristic extraction and DOM cleanup. /// public abstract class ArticleScraperAdapter { @@ -33,9 +36,17 @@ public abstract class ArticleScraperAdapter public virtual string? ReadMoreSelector => null; /// - /// Fallback CSS selector targeting the article body text elements if Readability fails. + /// Fallback CSS selector targeting the article body text elements if Readability/JSON-LD fails. /// - public virtual string ArticleBodySelector => "body"; + public virtual string ArticleBodySelector => "article, main, div.article-content, div.article-text, div.entry-content, body"; + + private static readonly Regex RegulatoryDisclaimerRegex = new( + @"(Interessenkonflikt[e:]|Offenlegung nach §|Risikohinweis:|Disclaimer:|Hinweis auf Interessenkonflikte|Keine Anlageberatung).*$", + RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline); + + private static readonly Regex TitlePortalSuffixRegex = new( + @"\s*[-|–—]\s*(DER AKTIONÄR|ARIVA\.DE|IT-Times|onvista|wallstreet:online|Sharedeals\.de|boerse\.de|Handelsblatt|WirtschaftsWoche|finanzen\.net|Finanznachrichten|XTB|Lynx|T3n|ntg24|Moneycab).*$", + RegexOptions.Compiled | RegexOptions.IgnoreCase); /// /// Tries to resolve 'Read More' links or external redirects. @@ -50,7 +61,6 @@ public abstract class ArticleScraperAdapter { try { - // Playwright modern pattern for combined popup or navigation handling var popupTask = page.Context.WaitForPageAsync(new() { Timeout = 6000 }); var navTask = page.WaitForURLAsync(url => url != page.Url, new() { Timeout = 6000 }); @@ -69,7 +79,7 @@ public abstract class ArticleScraperAdapter } catch { - // Timeout / Click failed -> Fallback to current URL + // Fallback to current URL if click/navigation times out } } @@ -77,21 +87,119 @@ public abstract class ArticleScraperAdapter } /// - /// Injects Mozilla's Readability.js into the Playwright page to parse article content cleanly. + /// Extracts structured article content using JSON-LD metadata, DOM noise pruning, and Mozilla Readability. /// public virtual async Task ExtractArticleContentAsync(IPage page) { try { - // 1. Inject Mozilla Readability Standalone JS Bundle via CDN + // 1. Remove DOM noise and ads before extraction + await page.EvaluateAsync(@"() => { + const noiseSelectors = [ + 'nav', 'header', 'footer', 'aside', '.cookie-banner', '#consent', + '[id*=""ad-""], [class*=""banner""], [class*=""outbrain""], [class*=""taboola""]', + '[class*=""share-buttons""], .social-media, .related-articles, .comments', + '#forum_box', '.newsletter-box', '.audio-player', '.tags-container' + ]; + for (const sel of noiseSelectors) { + document.querySelectorAll(sel).forEach(el => el.remove()); + } + }"); + + // 2. Extract JSON-LD (Schema.org) if available + var jsonLdResult = await page.EvaluateAsync(@"() => { + const scripts = document.querySelectorAll('script[type=""application/ld+json""]'); + for (const script of scripts) { + try { + const data = JSON.parse(script.textContent); + const items = Array.isArray(data) ? data : (data['@graph'] || [data]); + for (const item of items) { + if (item['@type'] === 'NewsArticle' || item['@type'] === 'Article' || item['@type'] === 'Report') { + return { + headline: item.headline || null, + description: item.description || null, + articleBody: item.articleBody || null, + author: typeof item.author === 'object' ? item.author.name : item.author, + datePublished: item.datePublished || item.dateCreated || null + }; + } + } + } catch (e) {} + } + return null; + }"); + + string? title = null; + string? excerpt = null; + string? author = null; + DateTime? publishedAt = null; + + if (jsonLdResult.HasValue && jsonLdResult.Value.ValueKind != JsonValueKind.Null) + { + var root = jsonLdResult.Value; + if (root.TryGetProperty("headline", out var hl) && hl.ValueKind == JsonValueKind.String) + { + title = CleanTitle(hl.GetString()); + } + if (root.TryGetProperty("description", out var desc) && desc.ValueKind == JsonValueKind.String) + { + excerpt = desc.GetString(); + } + if (root.TryGetProperty("author", out var auth) && auth.ValueKind == JsonValueKind.String) + { + author = auth.GetString(); + } + if (root.TryGetProperty("datePublished", out var dp) && dp.ValueKind == JsonValueKind.String) + { + if (DateTime.TryParse(dp.GetString(), out var dt)) publishedAt = dt; + } + } + + // 3. Fallback to OpenGraph and Meta tags for missing metadata + if (string.IsNullOrWhiteSpace(title) || string.IsNullOrWhiteSpace(excerpt)) + { + var metaResult = await page.EvaluateAsync(@"() => { + const getMeta = (prop) => { + const el = document.querySelector(`meta[property=""${prop}""], meta[name=""${prop}""]`); + return el ? el.getAttribute('content') : null; + }; + return { + ogTitle: getMeta('og:title') || getMeta('twitter:title'), + ogDesc: getMeta('og:description') || getMeta('description') || getMeta('twitter:description'), + author: getMeta('author') || getMeta('article:author'), + pubDate: getMeta('article:published_time') || getMeta('date') + }; + }"); + + if (metaResult.HasValue && metaResult.Value.ValueKind != JsonValueKind.Null) + { + var m = metaResult.Value; + if (string.IsNullOrWhiteSpace(title) && m.TryGetProperty("ogTitle", out var ogT) && ogT.ValueKind == JsonValueKind.String) + { + title = CleanTitle(ogT.GetString()); + } + if (string.IsNullOrWhiteSpace(excerpt) && m.TryGetProperty("ogDesc", out var ogD) && ogD.ValueKind == JsonValueKind.String) + { + excerpt = ogD.GetString(); + } + if (string.IsNullOrWhiteSpace(author) && m.TryGetProperty("author", out var ogA) && ogA.ValueKind == JsonValueKind.String) + { + author = ogA.GetString(); + } + if (!publishedAt.HasValue && m.TryGetProperty("pubDate", out var ogP) && ogP.ValueKind == JsonValueKind.String) + { + if (DateTime.TryParse(ogP.GetString(), out var dt)) publishedAt = dt; + } + } + } + + // 4. Inject Mozilla Readability to extract main content await page.AddScriptTagAsync(new PageAddScriptTagOptions { Url = "https://cdn.jsdelivr.net/npm/@mozilla/readability@0.5.0/Readability.min.js" }); - // 2. Execute Readability in the Browser Context - var jsScript = @" - () => { + var readabilityResult = await page.EvaluateAsync(@"() => { if (typeof Readability === 'undefined') return null; const documentClone = document.cloneNode(true); const article = new Readability(documentClone).parse(); @@ -104,37 +212,61 @@ public abstract class ArticleScraperAdapter author: article.byline || null, excerpt: article.excerpt || null }; - }"; + }"); - var jsonResult = await page.EvaluateAsync(jsScript); - - if (jsonResult.HasValue && jsonResult.Value.ValueKind != JsonValueKind.Null) + if (readabilityResult.HasValue && readabilityResult.Value.ValueKind != JsonValueKind.Null) { - var root = jsonResult.Value; + var r = readabilityResult.Value; + var rawText = r.GetProperty("textContent").GetString()?.Trim() ?? string.Empty; + var cleanedText = TruncateDisclaimers(rawText); + + if (string.IsNullOrWhiteSpace(title)) + { + title = CleanTitle(r.GetProperty("title").GetString() ?? await page.TitleAsync()); + } + return new ScrapedArticleResult( - Title: root.GetProperty("title").GetString() ?? page.TitleAsync().Result, - TextContent: root.GetProperty("textContent").GetString()?.Trim() ?? string.Empty, - HtmlContent: root.GetProperty("htmlContent").GetString() ?? string.Empty, - Author: root.GetProperty("author").GetString(), - Excerpt: root.GetProperty("excerpt").GetString(), - FinalUrl: page.Url + Title: title ?? string.Empty, + TextContent: cleanedText, + HtmlContent: r.GetProperty("htmlContent").GetString() ?? string.Empty, + Author: author ?? r.GetProperty("author").GetString(), + Excerpt: excerpt ?? r.GetProperty("excerpt").GetString(), + FinalUrl: page.Url, + PublishedAt: publishedAt ); } } catch { - // Readability Injection / Parsing failed -> Fallback to standard selector parsing + // Readability/Script injection failed -> Fallback to selector parsing } - // Fallback: Manuelles Auslesen via ArticleBodySelector - var bodyText = await page.Locator(ArticleBodySelector).InnerTextAsync(); + // 5. Selector-based fallback extraction + var bodyLocator = page.Locator(ArticleBodySelector).First; + var bodyText = await bodyLocator.CountAsync() > 0 ? await bodyLocator.InnerTextAsync() : await page.InnerTextAsync("body"); + var fallbackCleaned = TruncateDisclaimers(bodyText.Trim()); + return new ScrapedArticleResult( - Title: await page.TitleAsync(), - TextContent: bodyText.Trim(), - HtmlContent: await page.Locator(ArticleBodySelector).InnerHTMLAsync(), + Title: CleanTitle(await page.TitleAsync()), + TextContent: fallbackCleaned, + HtmlContent: string.Empty, Author: null, Excerpt: null, FinalUrl: page.Url ); } + + protected static string CleanTitle(string? title) + { + if (string.IsNullOrWhiteSpace(title)) return string.Empty; + var cleaned = TitlePortalSuffixRegex.Replace(title.Trim(), ""); + return cleaned.Trim(); + } + + protected static string TruncateDisclaimers(string text) + { + if (string.IsNullOrWhiteSpace(text)) return string.Empty; + var truncated = RegulatoryDisclaimerRegex.Replace(text, ""); + return truncated.Trim(); + } } \ No newline at end of file diff --git a/FinlyticNews/Adapters/Scraping/DerAktionaerScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/DerAktionaerScraperAdapter.cs new file mode 100644 index 0000000..7313784 --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/DerAktionaerScraperAdapter.cs @@ -0,0 +1,24 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for DerAktionaer.de (DER AKTIONÄR). +/// +public class DerAktionaerScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "deraktionaer.de"; + + public override string ArticleBodySelector => "article#article-detail, div.article-body"; + + public override async Task ExtractArticleContentAsync(IPage page) + { + await page.EvaluateAsync(@"() => { + document.querySelectorAll('.sp_message, .latest-release-item, .article-footer, .subscription-box').forEach(e => e.remove()); + }"); + + return await base.ExtractArticleContentAsync(page); + } +} diff --git a/FinlyticNews/Adapters/Scraping/ItTimesScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/ItTimesScraperAdapter.cs new file mode 100644 index 0000000..510c03a --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/ItTimesScraperAdapter.cs @@ -0,0 +1,24 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for IT-Times.de. +/// +public class ItTimesScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "it-times.de"; + + public override string ArticleBodySelector => "div.story_body, article.article, div.article_content"; + + public override async Task ExtractArticleContentAsync(IPage page) + { + await page.EvaluateAsync(@"() => { + document.querySelectorAll('.social_share, .related_stories, .banner, .ad').forEach(e => e.remove()); + }"); + + return await base.ExtractArticleContentAsync(page); + } +} diff --git a/FinlyticNews/Adapters/Scraping/LynxBrokerScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/LynxBrokerScraperAdapter.cs new file mode 100644 index 0000000..fa7e1e4 --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/LynxBrokerScraperAdapter.cs @@ -0,0 +1,15 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for LynxBroker.de. +/// +public class LynxBrokerScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "lynxbroker.de"; + + public override string ArticleBodySelector => "div.entry-content, article.post, div.post-content"; +} diff --git a/FinlyticNews/Adapters/Scraping/MoneycabScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/MoneycabScraperAdapter.cs new file mode 100644 index 0000000..200f19d --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/MoneycabScraperAdapter.cs @@ -0,0 +1,15 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for Moneycab.com. +/// +public class MoneycabScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "moneycab.com"; + + public override string ArticleBodySelector => "div.entry-content, article, div.post-content"; +} diff --git a/FinlyticNews/Adapters/Scraping/Ntg24ScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/Ntg24ScraperAdapter.cs new file mode 100644 index 0000000..9cca75b --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/Ntg24ScraperAdapter.cs @@ -0,0 +1,15 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for NTG24.de. +/// +public class Ntg24ScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "ntg24.de"; + + public override string ArticleBodySelector => "div.article-content, div.news-content, div.entry-content"; +} diff --git a/FinlyticNews/Adapters/Scraping/SharedealsScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/SharedealsScraperAdapter.cs new file mode 100644 index 0000000..91f2113 --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/SharedealsScraperAdapter.cs @@ -0,0 +1,15 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for Sharedeals.de. +/// +public class SharedealsScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "sharedeals.de"; + + public override string ArticleBodySelector => "div.entry-content, div.article-body, div.post-content"; +} diff --git a/FinlyticNews/Adapters/Scraping/T3nScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/T3nScraperAdapter.cs new file mode 100644 index 0000000..c14da1f --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/T3nScraperAdapter.cs @@ -0,0 +1,15 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for T3n.de. +/// +public class T3nScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "t3n.de"; + + public override string ArticleBodySelector => "article.c-article, div.c-article__body, div.c-content"; +} diff --git a/FinlyticNews/Adapters/Scraping/XtbScraperAdapter.cs b/FinlyticNews/Adapters/Scraping/XtbScraperAdapter.cs new file mode 100644 index 0000000..117ba63 --- /dev/null +++ b/FinlyticNews/Adapters/Scraping/XtbScraperAdapter.cs @@ -0,0 +1,15 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Playwright; + +namespace FinlyticNews.Adapters.Scraping; + +/// +/// Specialized article scraper adapter for XTB.com. +/// +public class XtbScraperAdapter : ArticleScraperAdapter +{ + public override string Hostname => "xtb.com"; + + public override string ArticleBodySelector => "div.news-detail, div.article__content, div.market-analysis-content"; +} diff --git a/FinlyticNews/Database/NewsDbContext.cs b/FinlyticNews/Database/NewsDbContext.cs index 774a769..41d1519 100644 --- a/FinlyticNews/Database/NewsDbContext.cs +++ b/FinlyticNews/Database/NewsDbContext.cs @@ -41,9 +41,9 @@ public class NewsDbContext : DbContext, ISettingsDbContext public DbSet MatchedAssets => Set(); /// - /// Gets or sets the database set for microservice configuration settings. + /// Gets or sets the database set for blocked news URLs (unindexable or duplicate articles). /// - public DbSet Settings => Set(); + public DbSet BlockedNewsUrls => Set(); /// /// Configures the model mapping, database constraints, and unique indices. @@ -64,16 +64,27 @@ public class NewsDbContext : DbContext, ISettingsDbContext .HasIndex(a => a.SourceUrl) .IsUnique(); - // Performance indexes for news queries + // Performance & deduplication indexes for news queries modelBuilder.Entity() .HasIndex(a => new { a.PublishedAt, a.ScrapedAt }); modelBuilder.Entity() .HasIndex(a => a.Status); + modelBuilder.Entity() + .HasIndex(a => a.TitleHash); + + modelBuilder.Entity() + .HasIndex(a => a.SimHash); + modelBuilder.Entity() .HasIndex(m => m.Isin); + // Blocked URLs index + modelBuilder.Entity() + .HasIndex(b => b.Url) + .IsUnique(); + // Configure relationship between NewsArticle and MatchedAssets modelBuilder.Entity() .HasOne(m => m.NewsArticle) diff --git a/FinlyticNews/Dockerfile.playwright-base b/FinlyticNews/Dockerfile.playwright-base index 96c56dc..d2e8f7a 100644 --- a/FinlyticNews/Dockerfile.playwright-base +++ b/FinlyticNews/Dockerfile.playwright-base @@ -1,10 +1,15 @@ # ───────────────────────────────────────────────────────────────────────────── -# Playwright Base Image for FinlyticNews +# Shared Playwright Base Image +# +# Consumed by BOTH FinlyticNews/Dockerfile and FinlyticFundamentals/Dockerfile. # # BUILD ONCE (only rebuild when PLAYWRIGHT_VERSION changes): -# docker build -f FinlyticNews/Dockerfile.playwright-base ` -# -t finlytic-playwright-base:1.49.0 ` -# FinlyticNews +# .\rebuild-playwright-base.ps1 +# or, via Compose: +# docker compose --profile build-base build finlytic-playwright-base +# +# Not built by a plain `docker compose build` — Compose does not resolve +# FROM-references between services, so this must exist beforehand. # # This image is then used as the base in the main Dockerfile so that # Chromium + all its OS dependencies are already cached in the image layer diff --git a/FinlyticNews/Entities/BlockedNewsUrlEntity.cs b/FinlyticNews/Entities/BlockedNewsUrlEntity.cs new file mode 100644 index 0000000..1e9f60e --- /dev/null +++ b/FinlyticNews/Entities/BlockedNewsUrlEntity.cs @@ -0,0 +1,25 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace FinlyticNews.Entities; + +/// +/// Entity representing a blocked news URL (e.g. duplicates, missing content, or no matched assets). +/// Prevents redundant re-discovery and re-scraping of known bad or duplicate URLs. +/// +[Table("BlockedNewsUrls")] +public class BlockedNewsUrlEntity +{ + [Key] + public Guid Id { get; set; } = Guid.NewGuid(); + + [Required] + [MaxLength(2048)] + public string Url { get; set; } = string.Empty; + + [MaxLength(256)] + public string Reason { get; set; } = string.Empty; + + public DateTime BlockedAtUtc { get; set; } = DateTime.UtcNow; +} diff --git a/FinlyticNews/Entities/NewsArticleEntity.cs b/FinlyticNews/Entities/NewsArticleEntity.cs index 243bd8f..d71be02 100644 --- a/FinlyticNews/Entities/NewsArticleEntity.cs +++ b/FinlyticNews/Entities/NewsArticleEntity.cs @@ -57,11 +57,22 @@ public class NewsArticleEntity public DateTime PublishedAt { get; set; } /// - /// Gets or sets the processing lifecycle state (e.g., "Pending", "Processing", "Completed", "Analyzed", "Failed"). + /// Gets or sets the processing lifecycle state (e.g., "Pending", "Processing", "Completed", "Analyzed", "Failed", "Duplicate"). /// [Required] public string Status { get; set; } = "Pending"; + /// + /// Gets or sets the normalized SHA-256 hash of the cleaned title for duplicate detection. + /// + [MaxLength(64)] + public string? TitleHash { get; set; } + + /// + /// Gets or sets the 64-bit SimHash content fingerprint for fuzzy duplicate text detection. + /// + public long? SimHash { get; set; } + /// /// Gets or sets the list of financial assets matched and associated with this news article. /// diff --git a/FinlyticNews/Entities/NewsSettingsEntity.cs b/FinlyticNews/Entities/NewsSettingsEntity.cs deleted file mode 100644 index c0607f9..0000000 --- a/FinlyticNews/Entities/NewsSettingsEntity.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace FinlyticNews.Entities; - -/// -/// Entity representing global runtime settings for the FinlyticNews microservice. -/// Persisted in PostgreSQL and updated dynamically via Admin Panel MQTT events. -/// -public class NewsSettingsEntity -{ - /// - /// Gets or sets the primary key for the settings row. - /// - [Key] - public Guid Id { get; set; } - - /// - /// Frequency in minutes for polling RSS feed sources. - /// - public int PollingFrequencyMinutes { get; set; } = 15; - - /// - /// Article retention period in days before archival or cleanup. - /// - public int ArticleRetentionDays { get; set; } = 90; - - /// - /// Default page size for historical news API pagination queries. - /// - public int DefaultPageSize { get; set; } = 20; - - /// - /// Background scraper interval in minutes. - /// - public int ScrapingIntervalMinutes { get; set; } = 15; - - /// - /// Webhook URL for n8n AI article analysis. - /// - public string N8nWebhookUrl { get; set; } = "http://localhost:5678/webhook/finlytic-news"; - - /// - /// Timestamp of last modification. - /// - public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; -} diff --git a/FinlyticNews/FinlyticNews.csproj b/FinlyticNews/FinlyticNews.csproj index d0501a6..563f640 100644 --- a/FinlyticNews/FinlyticNews.csproj +++ b/FinlyticNews/FinlyticNews.csproj @@ -43,4 +43,11 @@ + + + <_ContentIncludedByDefault Remove="publish\appsettings.Development.json" /> + <_ContentIncludedByDefault Remove="publish\appsettings.json" /> + <_ContentIncludedByDefault Remove="publish\FinlyticNews.deps.json" /> + <_ContentIncludedByDefault Remove="publish\FinlyticNews.runtimeconfig.json" /> + diff --git a/FinlyticNews/Migrations/20260801073336_Init.Designer.cs b/FinlyticNews/Migrations/20260801073336_Init.Designer.cs deleted file mode 100644 index a9116f8..0000000 --- a/FinlyticNews/Migrations/20260801073336_Init.Designer.cs +++ /dev/null @@ -1,174 +0,0 @@ -// -using System; -using FinlyticNews.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace FinlyticNews.Migrations -{ - [DbContext(typeof(NewsDbContext))] - [Migration("20260801073336_Init")] - partial class Init - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.9") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FinlyticNews.Entities.ArticleSourceEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Source") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("ArticleSources"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.MatchedAssetEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Isin") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NewsArticleId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("Isin"); - - b.HasIndex("NewsArticleId"); - - b.ToTable("MatchedAssets"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.NewsArticleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Author") - .HasColumnType("text"); - - b.Property("ContentRaw") - .IsRequired() - .HasColumnType("text"); - - b.Property("Language") - .HasColumnType("text"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ScrapedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceUrl") - .IsUnique(); - - b.HasIndex("Status"); - - b.HasIndex("PublishedAt", "ScrapedAt"); - - b.ToTable("NewsArticles"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.NewsSettingsEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("ArticleRetentionDays") - .HasColumnType("integer"); - - b.Property("DefaultPageSize") - .HasColumnType("integer"); - - b.Property("N8nWebhookUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("PollingFrequencyMinutes") - .HasColumnType("integer"); - - b.Property("ScrapingIntervalMinutes") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.MatchedAssetEntity", b => - { - b.HasOne("FinlyticNews.Entities.NewsArticleEntity", "NewsArticle") - .WithMany("MatchedAssets") - .HasForeignKey("NewsArticleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NewsArticle"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.NewsArticleEntity", b => - { - b.Navigation("MatchedAssets"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FinlyticNews/Migrations/20260813202646_CheckPendingNews.Designer.cs b/FinlyticNews/Migrations/20260813202646_CheckPendingNews.Designer.cs deleted file mode 100644 index 914a348..0000000 --- a/FinlyticNews/Migrations/20260813202646_CheckPendingNews.Designer.cs +++ /dev/null @@ -1,174 +0,0 @@ -// -using System; -using FinlyticNews.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace FinlyticNews.Migrations -{ - [DbContext(typeof(NewsDbContext))] - [Migration("20260813202646_CheckPendingNews")] - partial class CheckPendingNews - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.9") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FinlyticNews.Entities.ArticleSourceEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Source") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("ArticleSources"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.MatchedAssetEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Isin") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NewsArticleId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("Isin"); - - b.HasIndex("NewsArticleId"); - - b.ToTable("MatchedAssets"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.NewsArticleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Author") - .HasColumnType("text"); - - b.Property("ContentRaw") - .IsRequired() - .HasColumnType("text"); - - b.Property("Language") - .HasColumnType("text"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ScrapedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SourceUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("Summary") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("SourceUrl") - .IsUnique(); - - b.HasIndex("Status"); - - b.HasIndex("PublishedAt", "ScrapedAt"); - - b.ToTable("NewsArticles"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.NewsSettingsEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("ArticleRetentionDays") - .HasColumnType("integer"); - - b.Property("DefaultPageSize") - .HasColumnType("integer"); - - b.Property("N8nWebhookUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("PollingFrequencyMinutes") - .HasColumnType("integer"); - - b.Property("ScrapingIntervalMinutes") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.MatchedAssetEntity", b => - { - b.HasOne("FinlyticNews.Entities.NewsArticleEntity", "NewsArticle") - .WithMany("MatchedAssets") - .HasForeignKey("NewsArticleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NewsArticle"); - }); - - modelBuilder.Entity("FinlyticNews.Entities.NewsArticleEntity", b => - { - b.Navigation("MatchedAssets"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FinlyticNews/Migrations/20260813202646_CheckPendingNews.cs b/FinlyticNews/Migrations/20260813202646_CheckPendingNews.cs deleted file mode 100644 index 407245a..0000000 --- a/FinlyticNews/Migrations/20260813202646_CheckPendingNews.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FinlyticNews.Migrations -{ - /// - public partial class CheckPendingNews : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/FinlyticNews/Migrations/20260815183946_AddDynamicSettings.cs b/FinlyticNews/Migrations/20260815183946_AddDynamicSettings.cs deleted file mode 100644 index 7f57c68..0000000 --- a/FinlyticNews/Migrations/20260815183946_AddDynamicSettings.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FinlyticNews.Migrations -{ - /// - public partial class AddDynamicSettings : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "DynamicSettings", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Key = table.Column(type: "character varying(150)", maxLength: 150, nullable: false), - ValueJson = table.Column(type: "text", nullable: false), - ServiceIdentifier = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), - LastUpdatedUtc = table.Column(type: "timestamp with time zone", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DynamicSettings", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_DynamicSettings_Key", - table: "DynamicSettings", - column: "Key", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "DynamicSettings"); - } - } -} diff --git a/FinlyticNews/Migrations/20260815183946_AddDynamicSettings.Designer.cs b/FinlyticNews/Migrations/20260818194224_Init.Designer.cs similarity index 85% rename from FinlyticNews/Migrations/20260815183946_AddDynamicSettings.Designer.cs rename to FinlyticNews/Migrations/20260818194224_Init.Designer.cs index 2940f80..1d989f3 100644 --- a/FinlyticNews/Migrations/20260815183946_AddDynamicSettings.Designer.cs +++ b/FinlyticNews/Migrations/20260818194224_Init.Designer.cs @@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace FinlyticNews.Migrations { [DbContext(typeof(NewsDbContext))] - [Migration("20260815183946_AddDynamicSettings")] - partial class AddDynamicSettings + [Migration("20260818194224_Init")] + partial class Init { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -79,6 +79,33 @@ namespace FinlyticNews.Migrations b.ToTable("ArticleSources"); }); + modelBuilder.Entity("FinlyticNews.Entities.BlockedNewsUrlEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BlockedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Url") + .IsUnique(); + + b.ToTable("BlockedNewsUrls"); + }); + modelBuilder.Entity("FinlyticNews.Entities.MatchedAssetEntity", b => { b.Property("Id") @@ -127,6 +154,9 @@ namespace FinlyticNews.Migrations b.Property("ScrapedAt") .HasColumnType("timestamp with time zone"); + b.Property("SimHash") + .HasColumnType("bigint"); + b.Property("SourceUrl") .IsRequired() .HasColumnType("text"); @@ -142,48 +172,26 @@ namespace FinlyticNews.Migrations .IsRequired() .HasColumnType("text"); + b.Property("TitleHash") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + b.HasKey("Id"); + b.HasIndex("SimHash"); + b.HasIndex("SourceUrl") .IsUnique(); b.HasIndex("Status"); + b.HasIndex("TitleHash"); + b.HasIndex("PublishedAt", "ScrapedAt"); b.ToTable("NewsArticles"); }); - modelBuilder.Entity("FinlyticNews.Entities.NewsSettingsEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("ArticleRetentionDays") - .HasColumnType("integer"); - - b.Property("DefaultPageSize") - .HasColumnType("integer"); - - b.Property("N8nWebhookUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("PollingFrequencyMinutes") - .HasColumnType("integer"); - - b.Property("ScrapingIntervalMinutes") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - modelBuilder.Entity("FinlyticNews.Entities.MatchedAssetEntity", b => { b.HasOne("FinlyticNews.Entities.NewsArticleEntity", "NewsArticle") diff --git a/FinlyticNews/Migrations/20260801073336_Init.cs b/FinlyticNews/Migrations/20260818194224_Init.cs similarity index 66% rename from FinlyticNews/Migrations/20260801073336_Init.cs rename to FinlyticNews/Migrations/20260818194224_Init.cs index ef2f7b6..6c73c37 100644 --- a/FinlyticNews/Migrations/20260801073336_Init.cs +++ b/FinlyticNews/Migrations/20260818194224_Init.cs @@ -25,6 +25,35 @@ namespace FinlyticNews.Migrations table.PrimaryKey("PK_ArticleSources", x => x.Id); }); + migrationBuilder.CreateTable( + name: "BlockedNewsUrls", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Url = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), + Reason = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + BlockedAtUtc = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BlockedNewsUrls", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DynamicSettings", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Key = table.Column(type: "character varying(150)", maxLength: 150, nullable: false), + ValueJson = table.Column(type: "text", nullable: false), + ServiceIdentifier = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + LastUpdatedUtc = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DynamicSettings", x => x.Id); + }); + migrationBuilder.CreateTable( name: "NewsArticles", columns: table => new @@ -38,30 +67,15 @@ namespace FinlyticNews.Migrations SourceUrl = table.Column(type: "text", nullable: false), ScrapedAt = table.Column(type: "timestamp with time zone", nullable: false), PublishedAt = table.Column(type: "timestamp with time zone", nullable: false), - Status = table.Column(type: "text", nullable: false) + Status = table.Column(type: "text", nullable: false), + TitleHash = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + SimHash = table.Column(type: "bigint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_NewsArticles", x => x.Id); }); - migrationBuilder.CreateTable( - name: "Settings", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - PollingFrequencyMinutes = table.Column(type: "integer", nullable: false), - ArticleRetentionDays = table.Column(type: "integer", nullable: false), - DefaultPageSize = table.Column(type: "integer", nullable: false), - ScrapingIntervalMinutes = table.Column(type: "integer", nullable: false), - N8nWebhookUrl = table.Column(type: "text", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Settings", x => x.Id); - }); - migrationBuilder.CreateTable( name: "MatchedAssets", columns: table => new @@ -82,6 +96,18 @@ namespace FinlyticNews.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateIndex( + name: "IX_BlockedNewsUrls_Url", + table: "BlockedNewsUrls", + column: "Url", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_DynamicSettings_Key", + table: "DynamicSettings", + column: "Key", + unique: true); + migrationBuilder.CreateIndex( name: "IX_MatchedAssets_Isin", table: "MatchedAssets", @@ -97,6 +123,11 @@ namespace FinlyticNews.Migrations table: "NewsArticles", columns: new[] { "PublishedAt", "ScrapedAt" }); + migrationBuilder.CreateIndex( + name: "IX_NewsArticles_SimHash", + table: "NewsArticles", + column: "SimHash"); + migrationBuilder.CreateIndex( name: "IX_NewsArticles_SourceUrl", table: "NewsArticles", @@ -107,6 +138,11 @@ namespace FinlyticNews.Migrations name: "IX_NewsArticles_Status", table: "NewsArticles", column: "Status"); + + migrationBuilder.CreateIndex( + name: "IX_NewsArticles_TitleHash", + table: "NewsArticles", + column: "TitleHash"); } /// @@ -116,10 +152,13 @@ namespace FinlyticNews.Migrations name: "ArticleSources"); migrationBuilder.DropTable( - name: "MatchedAssets"); + name: "BlockedNewsUrls"); migrationBuilder.DropTable( - name: "Settings"); + name: "DynamicSettings"); + + migrationBuilder.DropTable( + name: "MatchedAssets"); migrationBuilder.DropTable( name: "NewsArticles"); diff --git a/FinlyticNews/Migrations/NewsDbContextModelSnapshot.cs b/FinlyticNews/Migrations/NewsDbContextModelSnapshot.cs index 12f2e3a..b8e8b25 100644 --- a/FinlyticNews/Migrations/NewsDbContextModelSnapshot.cs +++ b/FinlyticNews/Migrations/NewsDbContextModelSnapshot.cs @@ -76,6 +76,33 @@ namespace FinlyticNews.Migrations b.ToTable("ArticleSources"); }); + modelBuilder.Entity("FinlyticNews.Entities.BlockedNewsUrlEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BlockedAtUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Url") + .IsUnique(); + + b.ToTable("BlockedNewsUrls"); + }); + modelBuilder.Entity("FinlyticNews.Entities.MatchedAssetEntity", b => { b.Property("Id") @@ -124,6 +151,9 @@ namespace FinlyticNews.Migrations b.Property("ScrapedAt") .HasColumnType("timestamp with time zone"); + b.Property("SimHash") + .HasColumnType("bigint"); + b.Property("SourceUrl") .IsRequired() .HasColumnType("text"); @@ -139,48 +169,26 @@ namespace FinlyticNews.Migrations .IsRequired() .HasColumnType("text"); + b.Property("TitleHash") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + b.HasKey("Id"); + b.HasIndex("SimHash"); + b.HasIndex("SourceUrl") .IsUnique(); b.HasIndex("Status"); + b.HasIndex("TitleHash"); + b.HasIndex("PublishedAt", "ScrapedAt"); b.ToTable("NewsArticles"); }); - modelBuilder.Entity("FinlyticNews.Entities.NewsSettingsEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("ArticleRetentionDays") - .HasColumnType("integer"); - - b.Property("DefaultPageSize") - .HasColumnType("integer"); - - b.Property("N8nWebhookUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("PollingFrequencyMinutes") - .HasColumnType("integer"); - - b.Property("ScrapingIntervalMinutes") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - modelBuilder.Entity("FinlyticNews.Entities.MatchedAssetEntity", b => { b.HasOne("FinlyticNews.Entities.NewsArticleEntity", "NewsArticle") diff --git a/FinlyticNews/Program.cs b/FinlyticNews/Program.cs index fe171a1..d570b01 100644 --- a/FinlyticNews/Program.cs +++ b/FinlyticNews/Program.cs @@ -7,6 +7,8 @@ using FinlyticNews.Adapters.Discovery; using FinlyticNews.Adapters.Scraping; using FinlyticNews.Entities; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; var builder = Host.CreateApplicationBuilder(args); @@ -27,13 +29,28 @@ builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); -// Register Service interfaces and implementations +// Register Non-AI Matching, Validation, Deduplication, and Blocklist Services +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(sp => sp.GetRequiredService()); +builder.Services.AddHostedService(sp => sp.GetRequiredService()); +builder.Services.AddSingleton(); + +// Register Scraper and DB Services builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddScoped(); // Register MQTT Client (as singleton hosted service) builder.Services.AddSingleton(); @@ -50,12 +67,8 @@ using (var scope = host.Services.CreateScope()) try { var context = scope.ServiceProvider.GetRequiredService(); - await context.Database.MigrateAsync(); - - // Ensure default settings exist in DB - var settingsService = scope.ServiceProvider.GetRequiredService(); - await settingsService.GetSettingsAsync(); - + var connStr = builder.Configuration.GetConnectionString("DefaultConnection") ?? ""; + await context.MigrateWithBootstrapAsync(connStr); // Seed default article source if empty diff --git a/FinlyticNews/Project.md b/FinlyticNews/Project.md deleted file mode 100644 index c67d707..0000000 --- a/FinlyticNews/Project.md +++ /dev/null @@ -1,71 +0,0 @@ -# Finlytic News Service - -Finlytic News is a scalable C# microservice designed to periodically scrape, deduplicate, pre-filter, and process financial articles before distributing them to downstream consumers via MQTT. It leverages a dynamic adapter-based link discovery system, headless browser automation (Playwright/HtmlAgilityPack) to bypass dynamic site scrapers, integrates with n8n workflows for AI-driven classification, and maintains a resilient state machine database cache. - ---- - -## Architecture & Data Flow - -```mermaid -graph TD - Cron[Cron Trigger: 15m + Jitter] -->|Start Discovery| ADS[ArticleDiscoveryService] - ADS -->|Fetch Content| HTML[RSS Feed / HTML Page] - - ADS -->|Parse XML| RSS[RssDiscoveryAdapter] - ADS -->|Parse HTML| Agility[Custom Host Adapters e.g. HtmlAgilityPack] - - RSS -->|Extract Links| Links[Discovered URLs] - Agility -->|Extract Links| Links - - Links -->|Redirect Resolve & Playwright| Body[Article Content] - Body -->|Idempotency Check| DB{URL/Hash in PostgreSQL?} - DB -->|Exists: Skip| Skip[End Process] - DB -->|New: Load Index| IndexFilter[Asset Index Pre-Filter] - - AssetIndex[assets/index/index.json] -->|ISIN & Name List| IndexFilter - IndexFilter -->|Matched Assets| Webhook[n8n AI Webhook Pipeline] - - Webhook -->|AI Extraction & Score| DBWrite[Save Article & Assets] - DBWrite -->|State = Completed| Broadcast[MQTT Live Broadcast] - - Downstream[Downstream Services] <-->|MQTT RPC / Recovery| MqttRpc[MQTT RPC Server] -``` - ---- - -## Core Features & Capabilities - -### 1. Dynamic Article Discovery & Scraping Architecture -- **Adapter Separation**: Discovery Adapters (`RssDiscoveryAdapter`) & Detail Scrapers (`FinanznachrichtenScraperAdapter`). -- **Stealth Timing**: 15-minute cron with randomized jitter offsets. -- **Headless Scraping**: Playwright & HtmlAgilityPack node parsing. -- **Redirect Resolution**: Automatic URL expansion for canonical links. - -### 2. Data Deduplication & Asset Pre-Filtering -- **Database Idempotency**: Source URL uniqueness index. -- **Asset Index Pre-Filtering**: Matches raw text against `assets/index/index.json`. -- **n8n AI Webhook Integration**: Enrichment & classification pipeline. - -### 3. Database State Management & Performance Indexes -- **Lifecycle States**: `Pending` -> `Processing` -> `Completed` / `Failed`. -- **PostgreSQL Indizes**: Optimized compound index on `(PublishedAt, ScrapedAt)`, `Status`, `SourceUrl`, `Isin`. - -### 4. Event-Driven Messaging (MQTT) -- **Zero-Allocation Broadcast**: Publishes completed articles to `finlytic/news/new` and `finlytic/news/classification`. -- **MQTT RPC Handler**: Serves historical article queries for gateway endpoints. - ---- - -## Feature Status - -### Implemented Features -- [x] RSS & HTML Adapter discovery architecture (`ArticleSourceEntity`). -- [x] Playwright headless browser detail scraping. -- [x] n8n AI webhook integration. -- [x] Database compound indexes on `(PublishedAt, ScrapedAt)`, `Status`, `SourceUrl`. -- [x] MQTT broadcast & RPC response handling. -- [x] Zero-Allocation serialization via `FinlyticJsonSerializerContext`. - -### Planned / Future Features -- [ ] Multi-language translation pipeline (auto-translate foreign language news articles to DE/EN). -- [ ] Direct RSS Feed WebSub (PubSubHubbub) real-time push ingestion for instant zero-latency discovery. diff --git a/FinlyticNews/Services/ArticleDeduplicationService.cs b/FinlyticNews/Services/ArticleDeduplicationService.cs new file mode 100644 index 0000000..dd64177 --- /dev/null +++ b/FinlyticNews/Services/ArticleDeduplicationService.cs @@ -0,0 +1,357 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Security.Cryptography; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; +using FinlyticCore.Services; +using FinlyticNews.Database; +using FinlyticNews.Util; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +namespace FinlyticNews.Services; + +/// +/// Result of a duplicate check on a candidate news article. +/// +public record DuplicateCheckResult( + bool IsDuplicate, + Guid? DuplicateOfArticleId, + string? Reason, + string TitleHash, + long SimHash +); + +/// +/// Service interface for detecting syndicated or near-identical duplicate news articles without AI. +/// +public interface IArticleDeduplicationService +{ + /// + /// Evaluates whether an article is a duplicate based on normalized title similarity and 64-bit text SimHash fingerprinting. + /// + DuplicateCheckResult CheckDuplicate(string title, string content, DateTime publishedAt); + + /// + /// Registers a newly processed article into the in-memory deduplication cache. + /// + void RegisterArticle(Guid articleId, string titleHash, long simHash, string title, DateTime publishedAt); + + /// + /// Loads recent articles from the database into the deduplication cache on startup. + /// + Task InitializeAsync(CancellationToken cancellationToken = default); + + /// + /// Computes the normalized SHA-256 hash of an article title. + /// + string ComputeTitleHash(string title); + + /// + /// Computes the 64-bit SimHash content fingerprint of article text. + /// + long ComputeSimHash(string content); +} + +/// +/// High-performance non-AI deduplication engine using 64-bit SimHash and N-Gram title similarity. +/// +public class ArticleDeduplicationService : IArticleDeduplicationService +{ + private record CachedArticleEntry( + Guid ArticleId, + string TitleHash, + long SimHash, + string NormalizedTitle, + DateTime PublishedAt + ); + + private readonly IServiceScopeFactory _scopeFactory; + private readonly IFinlyticLogger _finlyticLogger; + private readonly ISettingsService _settingsService; + + // Rolling in-memory cache of recent articles + private readonly ConcurrentDictionary _titleHashIndex = new(StringComparer.OrdinalIgnoreCase); + private readonly List _simHashIndex = []; + private readonly ReaderWriterLockSlim _simHashLock = new(); + + private bool _initialized; + private readonly SemaphoreSlim _initLock = new(1, 1); + + private static readonly Regex TitlePortalSuffixRegex = new( + @"\s*[-|–—]\s*(DER AKTIONÄR|ARIVA\.DE|IT-Times|onvista|wallstreet:online|Sharedeals\.de|boerse\.de|Handelsblatt|WirtschaftsWoche|finanzen\.net|Finanznachrichten|XTB|Lynx|T3n|ntg24|Moneycab).*$", + RegexOptions.Compiled | RegexOptions.IgnoreCase); + + private static readonly Regex NonAlphanumericRegex = new(@"[^\w\s]", RegexOptions.Compiled); + private static readonly Regex MultipleSpacesRegex = new(@"\s+", RegexOptions.Compiled); + + public ArticleDeduplicationService( + IServiceScopeFactory scopeFactory, + IFinlyticLogger finlyticLogger, + ISettingsService settingsService) + { + _scopeFactory = scopeFactory; + _finlyticLogger = finlyticLogger; + _settingsService = settingsService; + } + + public async Task InitializeAsync(CancellationToken cancellationToken = default) + { + if (_initialized) return; + + await _initLock.WaitAsync(cancellationToken); + try + { + if (_initialized) return; + + using var scope = _scopeFactory.CreateScope(); + var dbContext = scope.ServiceProvider.GetRequiredService(); + + var windowDays = await _settingsService.GetSettingAsync(SettingKeys.DeduplicationWindowDays, cancellationToken); + var cutoff = DateTime.UtcNow.AddDays(-Math.Max(windowDays, 7)); + + var articles = await dbContext.NewsArticles + .AsNoTracking() + .Where(a => a.PublishedAt >= cutoff && a.Status == "Completed") + .Select(a => new + { + a.Id, + a.Title, + a.TitleHash, + a.SimHash, + a.PublishedAt + }) + .ToListAsync(cancellationToken); + + _simHashLock.EnterWriteLock(); + try + { + foreach (var a in articles) + { + var tHash = a.TitleHash ?? ComputeTitleHash(a.Title); + var sHash = a.SimHash ?? 0L; + var normTitle = NormalizeTitle(a.Title); + + _titleHashIndex[tHash] = a.Id; + + if (sHash != 0L) + { + _simHashIndex.Add(new CachedArticleEntry(a.Id, tHash, sHash, normTitle, a.PublishedAt)); + } + } + } + finally + { + _simHashLock.ExitWriteLock(); + } + + _initialized = true; + await _finlyticLogger.LogInfoAsync(SettingKeys.DeduplicationChannel, "[ArticleDeduplicationService] Initialized with {Count} recent articles for duplicate detection.", articles.Count); + } + finally + { + _initLock.Release(); + } + } + + public DuplicateCheckResult CheckDuplicate(string title, string content, DateTime publishedAt) + { + var titleHash = ComputeTitleHash(title); + var simHash = ComputeSimHash(content); + var normalizedTitle = NormalizeTitle(title); + + // 1. Exact Title Hash Match + if (_titleHashIndex.TryGetValue(titleHash, out var exactMatchId)) + { + return new DuplicateCheckResult( + IsDuplicate: true, + DuplicateOfArticleId: exactMatchId, + Reason: "ExactTitleHashMatch", + TitleHash: titleHash, + SimHash: simHash + ); + } + + _simHashLock.EnterReadLock(); + try + { + var windowCutoff = publishedAt.AddDays(-7); + + foreach (var entry in _simHashIndex) + { + if (entry.PublishedAt < windowCutoff) continue; + + // 2. SimHash Content Similarity (Hamming Distance <= 3 bits -> > 90% identical text) + if (simHash != 0L && entry.SimHash != 0L) + { + int distance = HammingDistance(simHash, entry.SimHash); + if (distance <= 3) + { + return new DuplicateCheckResult( + IsDuplicate: true, + DuplicateOfArticleId: entry.ArticleId, + Reason: $"SimHashSimilarity (HammingDistance: {distance})", + TitleHash: titleHash, + SimHash: simHash + ); + } + } + + // 3. Fuzzy Title Similarity (3-gram Jaccard Index >= 0.85) + double titleSim = Calculate3GramJaccard(normalizedTitle, entry.NormalizedTitle); + if (titleSim >= 0.85) + { + return new DuplicateCheckResult( + IsDuplicate: true, + DuplicateOfArticleId: entry.ArticleId, + Reason: $"FuzzyTitleSimilarity ({titleSim:P0})", + TitleHash: titleHash, + SimHash: simHash + ); + } + } + } + finally + { + _simHashLock.ExitReadLock(); + } + + return new DuplicateCheckResult( + IsDuplicate: false, + DuplicateOfArticleId: null, + Reason: null, + TitleHash: titleHash, + SimHash: simHash + ); + } + + public void RegisterArticle(Guid articleId, string titleHash, long simHash, string title, DateTime publishedAt) + { + _titleHashIndex[titleHash] = articleId; + + _simHashLock.EnterWriteLock(); + try + { + _simHashIndex.Add(new CachedArticleEntry(articleId, titleHash, simHash, NormalizeTitle(title), publishedAt)); + } + finally + { + _simHashLock.ExitWriteLock(); + } + } + + public string ComputeTitleHash(string title) + { + var normalized = NormalizeTitle(title); + var bytes = SHA256.HashData(Encoding.UTF8.GetBytes(normalized)); + return Convert.ToHexString(bytes).ToLowerInvariant(); + } + + public long ComputeSimHash(string content) + { + if (string.IsNullOrWhiteSpace(content)) return 0L; + + // Clean and tokenize content into words + var clean = NonAlphanumericRegex.Replace(content.ToLowerInvariant(), " "); + var words = clean.Split(' ', StringSplitOptions.RemoveEmptyEntries); + if (words.Length < 10) return 0L; + + // Generate 3-word shingles + var v = new int[64]; + for (int i = 0; i < words.Length - 2; i++) + { + var shingle = $"{words[i]} {words[i + 1]} {words[i + 2]}"; + var hash = Hash64(shingle); + + for (int bit = 0; bit < 64; bit++) + { + if (((hash >> bit) & 1L) == 1L) + { + v[bit]++; + } + else + { + v[bit]--; + } + } + } + + long simHash = 0L; + for (int bit = 0; bit < 64; bit++) + { + if (v[bit] > 0) + { + simHash |= (1L << bit); + } + } + + return simHash; + } + + private static string NormalizeTitle(string title) + { + if (string.IsNullOrWhiteSpace(title)) return string.Empty; + var stripped = TitlePortalSuffixRegex.Replace(title, ""); + var cleaned = NonAlphanumericRegex.Replace(stripped.ToLowerInvariant(), " "); + return MultipleSpacesRegex.Replace(cleaned, " ").Trim(); + } + + private static double Calculate3GramJaccard(string a, string b) + { + if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(b)) return 0.0; + if (a == b) return 1.0; + + var gramsA = Get3Grams(a); + var gramsB = Get3Grams(b); + + if (gramsA.Count == 0 || gramsB.Count == 0) return 0.0; + + int intersection = 0; + foreach (var g in gramsA) + { + if (gramsB.Contains(g)) intersection++; + } + + int union = gramsA.Count + gramsB.Count - intersection; + return union == 0 ? 0.0 : (double)intersection / union; + } + + private static HashSet Get3Grams(string text) + { + var set = new HashSet(StringComparer.Ordinal); + if (text.Length < 3) + { + set.Add(text); + return set; + } + + for (int i = 0; i <= text.Length - 3; i++) + { + set.Add(text.Substring(i, 3)); + } + return set; + } + + private static int HammingDistance(long a, long b) + { + return BitOperations.PopCount((ulong)(a ^ b)); + } + + private static long Hash64(string text) + { + // 64-bit FNV-1a Hash + ulong hash = 14695981039346656037UL; + var bytes = Encoding.UTF8.GetBytes(text); + foreach (var b in bytes) + { + hash ^= b; + hash *= 1099511628211UL; + } + return (long)hash; + } +} diff --git a/FinlyticNews/Services/AssetMatcherService.cs b/FinlyticNews/Services/AssetMatcherService.cs new file mode 100644 index 0000000..d4295fd --- /dev/null +++ b/FinlyticNews/Services/AssetMatcherService.cs @@ -0,0 +1,273 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.Json; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; +using FinlyticCore.Models.Assets; +using FinlyticCore.Services; +using FinlyticCore.Util; +using FinlyticNews.Util; +using Microsoft.Extensions.Hosting; + +namespace FinlyticNews.Services; + +/// +/// Candidate asset match identified in an article. +/// +public record MatchedCandidateAsset( + string Isin, + string Name, + int MentionCount, + bool InTitle, + bool InUrl, + double InitialConfidence +); + +/// +/// Service interface for fast in-memory asset detection from news text, titles, and URLs without AI. +/// +public interface IAssetMatcherService +{ + /// + /// Matches financial assets in the given text, title, and URL against the in-memory asset index. + /// + List MatchAssets(string title, string content, string? url = null); + + /// + /// Forces a reload of the index.json from disk into memory. + /// + Task ReloadIndexAsync(CancellationToken cancellationToken = default); +} + +/// +/// In-memory asset matching engine supporting ISIN regex, normalized name matching, legal suffix stripping, and stopword defenses. +/// +public class AssetMatcherService : IAssetMatcherService, IHostedService +{ + private record CompiledNameMatcher( + AssetIndex Asset, + string CleanName, + Regex WordRegex, + bool IsShortOrCommon + ); + + private readonly IFinlyticLogger _finlyticLogger; + private readonly string _indexPath; + + private readonly Dictionary _isinLookup = new(StringComparer.OrdinalIgnoreCase); + private readonly List _nameMatchers = []; + private readonly ReaderWriterLockSlim _indexLock = new(); + + private static readonly Regex IsinRegex = new(@"\b[A-Z]{2}[A-Z0-9]{9}[0-9]\b", RegexOptions.Compiled); + private static readonly Regex FinancialContextRegex = new( + @"(aktie|aktien|kurs|kurse|börse|finanz|umsatz|gewinn|quartal|prognose|dividende|kgv|analyst|kursziel|konzern|shares|stock|stocks|revenue|earnings|ebitda|ceo|cfo|nasdaq|dow|dax|s&p|\$|€)", + RegexOptions.Compiled | RegexOptions.IgnoreCase); + + private static readonly Regex LegalSuffixRegex = new( + @"\s+(AG|SE|GmbH|KGaA|Inc\.?|Incorporated|Corp\.?|Corporation|Ltd\.?|Limited|PLC|Plc|SA|NV|Holdings?|Group|Co\.?|Class\s+[A-Z]|ADR|SpA|Oyj|AB|A\/S|N\.V\.|S\.A\.|S\.E\.)\b", + RegexOptions.Compiled | RegexOptions.IgnoreCase); + + private static readonly HashSet CommonWordStopwords = new(StringComparer.OrdinalIgnoreCase) + { + "CAN", "IT", "ALL", "BE", "NEXT", "MAN", "GAP", "ON", "FOR", "NOW", "ONE", "TOP", "REAL", "DO", "GO", "US", + "DIE", "DER", "DAS", "UND", "VON", "MIT", "AUS", "IN", "AN", "ZU", "WAR", "AUF", "TAG", "PLUS", "FAST", "BEST", + "NEW", "AIR", "SEE", "MAX", "PRO", "NET", "HOME", "WORK", "CAR", "AUTO", "CARE", "LIFE", "WELL", "PURE", "TRUE", + "APP", "BOX", "HUB", "KEY", "PAY", "BUY", "WIN", "RUN", "SET", "GET", "RED", "BIG", "SUN", "SEA", "STAR", "BAY" + }; + + public AssetMatcherService(IFinlyticLogger finlyticLogger) + { + _finlyticLogger = finlyticLogger; + _indexPath = Path.Combine(Volumes.IndexRelativePath, "index.json"); + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + await ReloadIndexAsync(cancellationToken); + } + + public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; + + public async Task ReloadIndexAsync(CancellationToken cancellationToken = default) + { + if (!File.Exists(_indexPath)) + { + await _finlyticLogger.LogWarningAsync(SettingKeys.MatcherChannel, "[AssetMatcherService] Index file not found at: {Path}", _indexPath); + return; + } + + try + { + await using var stream = File.OpenRead(_indexPath); + var assets = await JsonSerializer.DeserializeAsync>(stream, cancellationToken: cancellationToken); + + if (assets == null || assets.Count == 0) + { + await _finlyticLogger.LogWarningAsync(SettingKeys.MatcherChannel, "[AssetMatcherService] Index file is empty."); + return; + } + + _indexLock.EnterWriteLock(); + try + { + _isinLookup.Clear(); + _nameMatchers.Clear(); + + foreach (var asset in assets) + { + if (string.IsNullOrWhiteSpace(asset.Isin)) continue; + _isinLookup[asset.Isin.Trim()] = asset; + + if (!string.IsNullOrWhiteSpace(asset.Name)) + { + var cleanName = CleanCompanyName(asset.Name); + if (cleanName.Length >= 2) + { + bool isShort = cleanName.Length < 4 || CommonWordStopwords.Contains(cleanName); + var pattern = $@"\b{Regex.Escape(cleanName)}\b"; + var regex = new Regex(pattern, isShort ? RegexOptions.Compiled : RegexOptions.Compiled | RegexOptions.IgnoreCase); + + _nameMatchers.Add(new CompiledNameMatcher(asset, cleanName, regex, isShort)); + } + } + } + } + finally + { + _indexLock.ExitWriteLock(); + } + + await _finlyticLogger.LogInfoAsync(SettingKeys.MatcherChannel, "[AssetMatcherService] Successfully loaded {Count} assets and {MatcherCount} name matchers into memory.", _isinLookup.Count, _nameMatchers.Count); + } + catch (Exception ex) + { + await _finlyticLogger.LogErrorAsync(SettingKeys.MatcherChannel, ex, "[AssetMatcherService] Failed to load index from {Path}", _indexPath); + } + } + + public List MatchAssets(string title, string content, string? url = null) + { + var results = new Dictionary(StringComparer.OrdinalIgnoreCase); + var fullText = (title + " " + content); + + _indexLock.EnterReadLock(); + try + { + // 1. URL Mining for ISINs (100% confidence) + if (!string.IsNullOrWhiteSpace(url)) + { + var isinMatchesInUrl = IsinRegex.Matches(url); + foreach (Match m in isinMatchesInUrl) + { + if (_isinLookup.TryGetValue(m.Value, out var asset)) + { + results[asset.Isin] = new MatchedCandidateAsset( + Isin: asset.Isin, + Name: asset.Name, + MentionCount: 1, + InTitle: false, + InUrl: true, + InitialConfidence: 1.0 + ); + } + } + } + + // 2. ISIN Regex in Title & Content + var isinMatches = IsinRegex.Matches(fullText); + foreach (Match m in isinMatches) + { + if (_isinLookup.TryGetValue(m.Value, out var asset)) + { + bool inTitle = title.Contains(m.Value, StringComparison.OrdinalIgnoreCase); + int count = isinMatches.Count(x => x.Value.Equals(m.Value, StringComparison.OrdinalIgnoreCase)); + + results[asset.Isin] = new MatchedCandidateAsset( + Isin: asset.Isin, + Name: asset.Name, + MentionCount: count, + InTitle: inTitle, + InUrl: results.TryGetValue(asset.Isin, out var existing) && existing.InUrl, + InitialConfidence: inTitle ? 1.0 : 0.95 + ); + } + } + + // 3. Name Matchers (Title & Content) + bool hasFinancialContext = FinancialContextRegex.IsMatch(fullText); + + foreach (var matcher in _nameMatchers) + { + if (results.ContainsKey(matcher.Asset.Isin)) continue; + + // Check Title First + bool titleMatch = matcher.WordRegex.IsMatch(title); + if (titleMatch) + { + // If short/common, ensure financial context exists + if (!matcher.IsShortOrCommon || hasFinancialContext) + { + results[matcher.Asset.Isin] = new MatchedCandidateAsset( + Isin: matcher.Asset.Isin, + Name: matcher.Asset.Name, + MentionCount: 1, + InTitle: true, + InUrl: false, + InitialConfidence: 0.9 + ); + continue; + } + } + + // Check Content + var contentMatches = matcher.WordRegex.Matches(content); + if (contentMatches.Count > 0) + { + if (matcher.IsShortOrCommon) + { + // Short words require >= 2 mentions AND financial context + if (contentMatches.Count >= 2 && hasFinancialContext) + { + results[matcher.Asset.Isin] = new MatchedCandidateAsset( + Isin: matcher.Asset.Isin, + Name: matcher.Asset.Name, + MentionCount: contentMatches.Count, + InTitle: false, + InUrl: false, + InitialConfidence: 0.75 + ); + } + } + else + { + results[matcher.Asset.Isin] = new MatchedCandidateAsset( + Isin: matcher.Asset.Isin, + Name: matcher.Asset.Name, + MentionCount: contentMatches.Count, + InTitle: false, + InUrl: false, + InitialConfidence: contentMatches.Count >= 2 ? 0.85 : 0.7 + ); + } + } + } + } + finally + { + _indexLock.ExitReadLock(); + } + + return results.Values.OrderByDescending(r => r.InitialConfidence).ThenByDescending(r => r.MentionCount).ToList(); + } + + private static string CleanCompanyName(string name) + { + if (string.IsNullOrWhiteSpace(name)) return string.Empty; + var stripped = LegalSuffixRegex.Replace(name, "").Trim(); + return stripped; + } +} diff --git a/FinlyticNews/Services/AssetValidationService.cs b/FinlyticNews/Services/AssetValidationService.cs new file mode 100644 index 0000000..38e6420 --- /dev/null +++ b/FinlyticNews/Services/AssetValidationService.cs @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using FinlyticCore.Dtos.Assets; +using FinlyticCore.Models.Assets; +using FinlyticCore.Services; +using FinlyticNews.Util; + +namespace FinlyticNews.Services; + +/// +/// Service interface for validating candidate asset matches against FinlyticAssets metadata and sector clustering. +/// +public interface IAssetValidationService +{ + /// + /// Validates and filters candidate asset matches using FinlyticAssets metadata, sector clustering, and occurrence rules. + /// + Task> ValidateCandidateAssetsAsync( + List candidates, + string title, + string content, + CancellationToken cancellationToken = default); +} + +/// +/// Heuristic asset validation engine verifying asset existence, title priority, mention density, and sector coherence. +/// +public class AssetValidationService : IAssetValidationService +{ + private readonly IFinlyticLogger _finlyticLogger; + private readonly NewsMqttClient _mqttClient; + private readonly ISettingsService _settingsService; + + public AssetValidationService( + IFinlyticLogger finlyticLogger, + NewsMqttClient mqttClient, + ISettingsService settingsService) + { + _finlyticLogger = finlyticLogger; + _mqttClient = mqttClient; + _settingsService = settingsService; + } + + public async Task> ValidateCandidateAssetsAsync( + List candidates, + string title, + string content, + CancellationToken cancellationToken = default) + { + if (candidates.Count == 0) return []; + + var verifiedAssets = new List(); + var assetDetails = new Dictionary(StringComparer.OrdinalIgnoreCase); + + // 1. Fetch Asset Details from FinlyticAssets via MQTT RPC + foreach (var candidate in candidates) + { + try + { + var req = new GetValidAssetRequest(candidate.Isin); + var assets = await _mqttClient.RequestAsync>("services/request/assets_Get", req); + + if (assets != null && assets.Count > 0) + { + var match = assets.FirstOrDefault(a => a.Isin.Equals(candidate.Isin, StringComparison.OrdinalIgnoreCase)); + if (match != null) + { + assetDetails[candidate.Isin] = match; + } + } + } + catch (Exception ex) + { + await _finlyticLogger.LogWarningAsync(SettingKeys.MatcherChannel, ex, "[AssetValidationService] Failed to query FinlyticAssets for ISIN {Isin}. Falling back to index data.", candidate.Isin); + } + } + + // 2. Tag & Sector Frequency Analysis (Clustering) + var sectorCounts = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var (_, dto) in assetDetails) + { + if (dto.Tags != null) + { + foreach (var tag in dto.Tags) + { + if (tag.Type.Equals("sector", StringComparison.OrdinalIgnoreCase) || + tag.Type.Equals("industry", StringComparison.OrdinalIgnoreCase)) + { + sectorCounts[tag.Name] = sectorCounts.GetValueOrDefault(tag.Name, 0) + 1; + } + } + } + } + + bool hasDominantSector = sectorCounts.Values.Any(count => count >= 2); + string? dominantSector = sectorCounts.OrderByDescending(kv => kv.Value).FirstOrDefault().Key; + + // 3. Evaluate Each Candidate + foreach (var candidate in candidates) + { + // Rule A: Direct Title Match or URL Match -> Guaranteed Valid + if (candidate.InTitle || candidate.InUrl) + { + verifiedAssets.Add(candidate); + continue; + } + + // Rule B: Multiple Mentions in Article Body + if (candidate.MentionCount >= 2) + { + verifiedAssets.Add(candidate); + continue; + } + + // Rule C: Single Mention Validation with Sector Clustering + if (assetDetails.TryGetValue(candidate.Isin, out var dto)) + { + bool matchesDominantSector = false; + if (hasDominantSector && dto.Tags != null) + { + matchesDominantSector = dto.Tags.Any(t => t.Name.Equals(dominantSector, StringComparison.OrdinalIgnoreCase)); + } + + if (matchesDominantSector) + { + // Reinforced by cluster + verifiedAssets.Add(candidate); + } + else if (candidate.InitialConfidence >= 0.85) + { + // High-confidence exact unique name match + verifiedAssets.Add(candidate); + } + else + { + await _finlyticLogger.LogDebugAsync(SettingKeys.MatcherChannel, "[AssetValidationService] Pruned low-confidence outlier candidate: {Name} ({Isin})", candidate.Name, candidate.Isin); + } + } + else + { + // If not found in FinlyticAssets, discard + await _finlyticLogger.LogDebugAsync(SettingKeys.MatcherChannel, "[AssetValidationService] Discarded candidate {Isin} as it does not exist in FinlyticAssets.", candidate.Isin); + } + } + + return verifiedAssets; + } +} diff --git a/FinlyticNews/Services/N8nService.cs b/FinlyticNews/Services/N8nService.cs deleted file mode 100644 index a31f3b2..0000000 --- a/FinlyticNews/Services/N8nService.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using FinlyticCore.Dtos.News; -using FinlyticCore.Services; -using FinlyticCore.Util; -using FinlyticNews.Util; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace FinlyticNews.Services; - -/// -/// Defines integration operations with the external n8n AI workflow webhook. -/// -public interface IN8nService -{ - /// - /// Submits raw article content and pre-filtered assets to n8n, returning the parsed response metadata. - /// - Task AnalyzeArticleAsync(string content, List filteredAssets, CancellationToken ct = default); -} - -/// -public class N8nService : IN8nService -{ - private readonly HttpClient _httpClient; - private readonly IServiceScopeFactory _scopeFactory; - private readonly IConfiguration _configuration; - private readonly IFinlyticLogger _finlyticLogger; - - public N8nService( - HttpClient httpClient, - IServiceScopeFactory scopeFactory, - IConfiguration configuration, - IFinlyticLogger finlyticLogger) - { - _httpClient = httpClient; - _scopeFactory = scopeFactory; - _configuration = configuration; - _finlyticLogger = finlyticLogger; - } - - /// - public async Task AnalyzeArticleAsync(string content, List filteredAssets, CancellationToken ct = default) - { - string? targetUrl = null; - - using (var scope = _scopeFactory.CreateScope()) - { - var settingsService = scope.ServiceProvider.GetService(); - if (settingsService != null) - { - var dynamicUrl = await settingsService.GetSettingAsync(SettingKeys.N8nArticleExtractionUrl, ct); - if (!string.IsNullOrWhiteSpace(dynamicUrl)) - { - targetUrl = dynamicUrl.Trim(); - } - } - - if (string.IsNullOrWhiteSpace(targetUrl)) - { - var settingsDb = scope.ServiceProvider.GetService(); - if (settingsDb != null) - { - var settings = await settingsDb.GetSettingsAsync(); - targetUrl = settings?.N8nWebhookUrl; - } - } - } - - if (string.IsNullOrWhiteSpace(targetUrl)) - { - targetUrl = _configuration["N8N:ArticleExtractionUrl"] - ?? _configuration["N8N__ArticleExtractionUrl"]; - } - - if (string.IsNullOrWhiteSpace(targetUrl)) - { - await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, "[N8nService] N8nWebhookUrl is not configured in DB or application settings."); - return null; - } - - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[N8nService] Posting article to n8n webhook pipeline at: {Url}", targetUrl); - - var payload = new N8nRequestPayload(content, filteredAssets ?? []); - - try - { - var jsonContent = JsonSerializer.Serialize(payload, FinlyticJsonSerializerContext.Default.N8nRequestPayload); - using var requestContent = new StringContent(jsonContent, System.Text.Encoding.UTF8, "application/json"); - - using var response = await _httpClient.PostAsync(targetUrl, requestContent, ct); - - if (!response.IsSuccessStatusCode) - { - var errorMsg = await response.Content.ReadAsStringAsync(ct); - await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, "[N8nService] n8n webhook returned status code {StatusCode}. Error payload: {Error}", response.StatusCode, errorMsg); - return null; - } - - using var responseStream = await response.Content.ReadAsStreamAsync(ct); - using var doc = await JsonDocument.ParseAsync(responseStream, cancellationToken: ct); - - var root = doc.RootElement; - - if (root.ValueKind == JsonValueKind.Array) - { - if (root.GetArrayLength() == 0) - { - await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, "[N8nService] n8n webhook returned an empty array."); - return null; - } - root = root[0]; - } - - if (root.ValueKind == JsonValueKind.Object) - { - if (root.TryGetProperty("json", out var jsonChild) && jsonChild.ValueKind == JsonValueKind.Object) - root = jsonChild; - else if (root.TryGetProperty("output", out var outChild) && outChild.ValueKind == JsonValueKind.Object) - root = outChild; - else if (root.TryGetProperty("data", out var dataChild) && dataChild.ValueKind == JsonValueKind.Object) - root = dataChild; - else if (root.TryGetProperty("body", out var bodyChild) && bodyChild.ValueKind == JsonValueKind.Object) - root = bodyChild; - } - - var result = root.Deserialize(FinlyticJsonSerializerContext.Default.N8nResponsePayload); - return result; - } - catch (Exception ex) - { - await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[N8nService] Failed to communicate with or parse response from n8n webhook workflow."); - return null; - } - } -} \ No newline at end of file diff --git a/FinlyticNews/Services/NewsBlocklistService.cs b/FinlyticNews/Services/NewsBlocklistService.cs new file mode 100644 index 0000000..4ac1379 --- /dev/null +++ b/FinlyticNews/Services/NewsBlocklistService.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Concurrent; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using FinlyticCore.Services; +using FinlyticNews.Database; +using FinlyticNews.Entities; +using FinlyticNews.Util; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +namespace FinlyticNews.Services; + +/// +/// Service interface for managing and querying blocked news article URLs (duplicates, missing content, or zero matched assets). +/// +public interface INewsBlocklistService +{ + /// + /// Checks whether the given URL is already recorded on the blocklist. + /// + bool IsBlocked(string url); + + /// + /// Adds a URL to the database blocklist and in-memory cache. + /// + Task BlockUrlAsync(string url, string reason, CancellationToken cancellationToken = default); + + /// + /// Loads all existing blocked URLs from the database into memory on startup. + /// + Task InitializeAsync(CancellationToken cancellationToken = default); +} + +/// +/// High-performance in-memory and database-backed blocklist service. +/// +public class NewsBlocklistService : INewsBlocklistService +{ + private readonly IServiceScopeFactory _scopeFactory; + private readonly IFinlyticLogger _finlyticLogger; + private readonly ConcurrentDictionary _blockedUrls = new(StringComparer.OrdinalIgnoreCase); + private bool _initialized; + private readonly SemaphoreSlim _initLock = new(1, 1); + + public NewsBlocklistService( + IServiceScopeFactory scopeFactory, + IFinlyticLogger finlyticLogger) + { + _scopeFactory = scopeFactory; + _finlyticLogger = finlyticLogger; + } + + public async Task InitializeAsync(CancellationToken cancellationToken = default) + { + if (_initialized) return; + + await _initLock.WaitAsync(cancellationToken); + try + { + if (_initialized) return; + + using var scope = _scopeFactory.CreateScope(); + var dbContext = scope.ServiceProvider.GetRequiredService(); + + var urls = await dbContext.BlockedNewsUrls + .AsNoTracking() + .Select(b => new { b.Url, b.Reason }) + .ToListAsync(cancellationToken); + + foreach (var item in urls) + { + if (!string.IsNullOrWhiteSpace(item.Url)) + { + _blockedUrls[item.Url.Trim()] = item.Reason ?? string.Empty; + } + } + + _initialized = true; + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsBlocklistService] Initialized with {Count} blocked URLs in memory cache.", _blockedUrls.Count); + } + finally + { + _initLock.Release(); + } + } + + public bool IsBlocked(string url) + { + if (string.IsNullOrWhiteSpace(url)) return true; + return _blockedUrls.ContainsKey(url.Trim()); + } + + public async Task BlockUrlAsync(string url, string reason, CancellationToken cancellationToken = default) + { + if (string.IsNullOrWhiteSpace(url)) return; + var cleanUrl = url.Trim(); + + _blockedUrls[cleanUrl] = reason; + + try + { + using var scope = _scopeFactory.CreateScope(); + var dbContext = scope.ServiceProvider.GetRequiredService(); + + bool exists = await dbContext.BlockedNewsUrls.AnyAsync(b => b.Url == cleanUrl, cancellationToken); + if (!exists) + { + dbContext.BlockedNewsUrls.Add(new BlockedNewsUrlEntity + { + Id = Guid.NewGuid(), + Url = cleanUrl, + Reason = reason, + BlockedAtUtc = DateTime.UtcNow + }); + await dbContext.SaveChangesAsync(cancellationToken); + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsBlocklistService] Added URL to blocklist: {Url} (Reason: {Reason})", cleanUrl, reason); + } + } + catch (Exception ex) + { + await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, ex, "[NewsBlocklistService] Failed to persist blocked URL: {Url}", cleanUrl); + } + } +} diff --git a/FinlyticNews/Services/NewsDbService.cs b/FinlyticNews/Services/NewsDbService.cs index 7e7e377..4ecedb7 100644 --- a/FinlyticNews/Services/NewsDbService.cs +++ b/FinlyticNews/Services/NewsDbService.cs @@ -22,7 +22,7 @@ public interface INewsDbService /// /// Phase 1: Discovers and locks a new article URL by setting its status to "Pending". /// - Task CreatePendingArticleAsync( + Task CreatePendingArticleAsync( string url, List? discoveredIsins = null, string? title = null, @@ -35,15 +35,30 @@ public interface INewsDbService /// Task UpdateArticleStatusAsync(Guid id, string status); + /// + /// Deletes an article from the database entirely (e.g. when it fails or is a duplicate). + /// + Task DeleteArticleAsync(Guid id); + /// /// Updates the target URL of an article if a redirect is resolved during the Processing phase. /// Task UpdateArticleUrlAsync(Guid id, string resolvedUrl); /// - /// Phase 4: Saves AI classification from n8n and sets the lifecycle status to "Completed". + /// Saves the processed article content, hashes, and matched assets, and transitions lifecycle status to "Completed". /// - Task SaveArticleClassificationAsync(Guid id, N8nResponsePayload payload, List matchedAssets); + Task SaveProcessedArticleAsync( + Guid id, + string title, + string? author, + string? summary, + string contentRaw, + string? language, + DateTime? publishedAt, + string titleHash, + long simHash, + List matchedAssets); Task> GetArticlesByStatusAsync(string status); @@ -95,7 +110,7 @@ public class NewsDbService : INewsDbService } /// - public async Task CreatePendingArticleAsync( + public async Task CreatePendingArticleAsync( string url, List? discoveredIsins = null, string? title = null, @@ -112,7 +127,7 @@ public class NewsDbService : INewsDbService if (existingArticle != null) { await _finlyticLogger.LogDebugAsync(SettingKeys.NewsChannel, "[Lifecycle] Article URL already exists (Duplicate hit): {Url}", trimmedUrl); - return existingArticle; + return null; } var finalPublishedAt = publishedAt.HasValue @@ -166,9 +181,9 @@ public class NewsDbService : INewsDbService var existing = await _context.NewsArticles.AsNoTracking().FirstOrDefaultAsync(a => a.SourceUrl == trimmedUrl || a.SourceUrl == cleanUrl || a.SourceUrl.StartsWith(cleanUrl)); if (existing != null) { - return existing; + return null; } - return article; + return null; } return article; @@ -191,6 +206,19 @@ public class NewsDbService : INewsDbService } } + /// + public async Task DeleteArticleAsync(Guid id) + { + var rowsAffected = await _context.NewsArticles + .Where(a => a.Id == id) + .ExecuteDeleteAsync(); + + if (rowsAffected > 0) + { + await _finlyticLogger.LogDebugAsync(SettingKeys.NewsChannel, "[Lifecycle] Deleted unused/failed article {Id} from database", id); + } + } + /// public async Task UpdateArticleUrlAsync(Guid id, string resolvedUrl) { @@ -209,37 +237,41 @@ public class NewsDbService : INewsDbService } /// - public async Task SaveArticleClassificationAsync(Guid id, N8nResponsePayload payload, List matchedAssets) + public async Task SaveProcessedArticleAsync( + Guid id, + string title, + string? author, + string? summary, + string contentRaw, + string? language, + DateTime? publishedAt, + string titleHash, + long simHash, + List matchedAssets) { - DateTime? finalPublishedAt = null; - if (DateTime.TryParse(payload.PublishedAt, out var publishedDate)) - { - finalPublishedAt = publishedDate.Kind == DateTimeKind.Unspecified - ? DateTime.SpecifyKind(publishedDate, DateTimeKind.Utc) - : publishedDate.ToUniversalTime(); - } - - DateTime? finalScrapedAt = null; - if (DateTime.TryParse(payload.ScrapedAt, out var scrapedDate)) - { - finalScrapedAt = scrapedDate.ToUniversalTime(); - } + var finalPublishedAt = publishedAt.HasValue + ? (publishedAt.Value.Kind == DateTimeKind.Unspecified + ? DateTime.SpecifyKind(publishedAt.Value, DateTimeKind.Utc) + : publishedAt.Value.ToUniversalTime()) + : DateTime.UtcNow; var rowsAffected = await _context.NewsArticles .Where(a => a.Id == id) .ExecuteUpdateAsync(s => s - .SetProperty(a => a.Title, payload.Title) - .SetProperty(a => a.Author, payload.Author) - .SetProperty(a => a.Summary, payload.Summary) - .SetProperty(a => a.ContentRaw, payload.ContentRaw) - .SetProperty(a => a.Language, payload.Language) + .SetProperty(a => a.Title, title) + .SetProperty(a => a.Author, author) + .SetProperty(a => a.Summary, summary) + .SetProperty(a => a.ContentRaw, contentRaw) + .SetProperty(a => a.Language, language) + .SetProperty(a => a.TitleHash, titleHash) + .SetProperty(a => a.SimHash, simHash) .SetProperty(a => a.Status, "Completed") - .SetProperty(a => a.PublishedAt, a => finalPublishedAt ?? a.PublishedAt) - .SetProperty(a => a.ScrapedAt, a => finalScrapedAt ?? a.ScrapedAt)); + .SetProperty(a => a.PublishedAt, finalPublishedAt) + .SetProperty(a => a.ScrapedAt, DateTime.UtcNow)); if (rowsAffected == 0) { - await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, "[NewsChannel] Article with ID {Id} not found for classification update.", id); + await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, "[NewsChannel] Article with ID {Id} not found for completion update.", id); return null; } @@ -267,7 +299,7 @@ public class NewsDbService : INewsDbService .AsNoTracking() .FirstOrDefaultAsync(a => a.Id == id); - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[Lifecycle] Article {Id} successfully classified and marked 'Completed'. Title: '{Title}'", id, payload.Title); + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[Lifecycle] Article {Id} successfully processed and marked 'Completed'. Title: '{Title}'", id, title); return completedArticle; } @@ -320,7 +352,7 @@ public class NewsDbService : INewsDbService var cleanSearch = searchQuery.Trim().ToLower(); query = query.Where(a => a.Title.ToLower().Contains(cleanSearch) || - a.Summary.ToLower().Contains(cleanSearch) || + (a.Summary != null && a.Summary.ToLower().Contains(cleanSearch)) || a.MatchedAssets.Any(m => m.Name.ToLower().Contains(cleanSearch))); } diff --git a/FinlyticNews/Services/NewsScraperBackgroundService.cs b/FinlyticNews/Services/NewsScraperBackgroundService.cs index 7928ee6..ede19a1 100644 --- a/FinlyticNews/Services/NewsScraperBackgroundService.cs +++ b/FinlyticNews/Services/NewsScraperBackgroundService.cs @@ -1,62 +1,65 @@ using System; -using System.Collections.Concurrent; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Text.Json; -using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; -using FinlyticAssets.Models; -using FinlyticAssets.Util; using FinlyticCore.Dtos.News; using FinlyticCore.Services; -using FinlyticCore.Util; using FinlyticNews.Entities; using FinlyticNews.Util; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace FinlyticNews.Services; /// -/// A background worker service that orchestrates link discovery, Playwright scraping, -/// pre-filtering, n8n AI enrichment, database persistence, and MQTT broadcasts. +/// Background worker service orchestrating link discovery, Playwright scraping, +/// non-AI deduplication, in-memory asset matching, plausibility validation, and MQTT broadcasts. /// public class NewsScraperBackgroundService : BackgroundService { - private record CompiledAssetMatcher( - AssetIndex Asset, - string CoreName, - Regex? WordRegex, - Regex? CoreWordRegex - ); - private readonly IServiceScopeFactory _scopeFactory; private readonly IFinlyticLogger _finlyticLogger; private readonly NewsMqttClient _mqttClient; - private readonly string _indexPath; - - private List? _cachedAssetMatchers; - private DateTime _lastIndexLoadTime = DateTime.MinValue; + private readonly INewsBlocklistService _blocklistService; + private readonly IArticleDeduplicationService _deduplicationService; + private readonly IAssetMatcherService _assetMatcherService; + private readonly IAssetValidationService _assetValidationService; public NewsScraperBackgroundService( IServiceScopeFactory scopeFactory, IFinlyticLogger finlyticLogger, NewsMqttClient mqttClient, - IConfiguration configuration) + INewsBlocklistService blocklistService, + IArticleDeduplicationService deduplicationService, + IAssetMatcherService assetMatcherService, + IAssetValidationService assetValidationService) { _scopeFactory = scopeFactory; _finlyticLogger = finlyticLogger; _mqttClient = mqttClient; - _indexPath = Path.Combine(Volumes.IndexRelativePath, "index.json"); + _blocklistService = blocklistService; + _deduplicationService = deduplicationService; + _assetMatcherService = assetMatcherService; + _assetValidationService = assetValidationService; } protected override async Task ExecuteAsync(CancellationToken stoppingToken) { await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] NewsScraperBackgroundService started."); + // Initialize in-memory blocklist and deduplication cache on startup + try + { + await _blocklistService.InitializeAsync(stoppingToken); + await _deduplicationService.InitializeAsync(stoppingToken); + await _assetMatcherService.ReloadIndexAsync(stoppingToken); + } + catch (Exception ex) + { + await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[NewsScraperBackgroundService] Error during startup service initialization."); + } + while (!stoppingToken.IsCancellationRequested) { try @@ -76,7 +79,7 @@ public class NewsScraperBackgroundService : BackgroundService } catch (Exception ex) when (ex is not OperationCanceledException) { - await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[NewsScraperBackgroundService] An unhandled exception occurred during news scraping cycle."); + await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[NewsScraperBackgroundService] Unhandled exception in news scraping cycle."); } int intervalMinutes = 15; @@ -89,7 +92,7 @@ public class NewsScraperBackgroundService : BackgroundService catch { } var jitterSeconds = Random.Shared.Next(0, 60); - var nextRunDelay = TimeSpan.FromMinutes(intervalMinutes) + TimeSpan.FromSeconds(jitterSeconds); + var nextRunDelay = TimeSpan.FromMinutes(Math.Max(1, intervalMinutes)) + TimeSpan.FromSeconds(jitterSeconds); await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Scraping cycle completed. Next cycle in {Delay} (interval: {Minutes}m).", nextRunDelay, intervalMinutes); try @@ -111,29 +114,26 @@ public class NewsScraperBackgroundService : BackgroundService var dbService = scope.ServiceProvider.GetRequiredService(); var discoveryService = scope.ServiceProvider.GetRequiredService(); var scraperService = scope.ServiceProvider.GetRequiredService(); - var n8nService = scope.ServiceProvider.GetRequiredService(); var settings = scope.ServiceProvider.GetRequiredService(); var maxArticlesPerFeed = await settings.GetSettingAsync(SettingKeys.MaxArticlesPerFeed, stoppingToken); - var assetMatchers = await GetOrLoadAssetMatchersAsync(); - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Loaded {Count} asset index items for text pre-filtering.", assetMatchers.Count); - - var failedArticles = await dbService.GetArticlesByStatusAsync("Scraping"); - if (failedArticles.Count > 0) + // Process any previously interrupted articles + var pendingScraping = await dbService.GetArticlesByStatusAsync("Scraping"); + if (pendingScraping.Count > 0) { - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Found {Count} articles in status 'Scraping' that failed to scrape previously. Retrying...", failedArticles.Count); - foreach (var article in failedArticles) + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Retrying {Count} pending scraping articles...", pendingScraping.Count); + foreach (var article in pendingScraping) { if (stoppingToken.IsCancellationRequested) return; - await ProcessSingleArticleAsync(article, scraperService, n8nService, dbService, assetMatchers, stoppingToken); + await ProcessSingleArticleAsync(article, scraperService, dbService, stoppingToken); } } var sources = await dbService.GetSourcesAsync(); if (sources.Count == 0) { - await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] No article sources configured in database. Skipping cycle."); + await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] No article sources configured in database."); return; } @@ -141,30 +141,35 @@ public class NewsScraperBackgroundService : BackgroundService { if (stoppingToken.IsCancellationRequested) break; - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Starting article link discovery for source: {SourceName} ({Url})", source.Name, source.Source); + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Discovering articles from source: {Name} ({Url})", source.Name, source.Source); var discoveredArticles = await discoveryService.DiscoverLinksAsync(source.Source, source.Type, stoppingToken); if (discoveredArticles == null || discoveredArticles.Count == 0) { - await _finlyticLogger.LogDebugAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] No links discovered from source: {SourceName}", source.Name); continue; } - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Discovered {Count} potential article links from {SourceName}.", discoveredArticles.Count, source.Name); - + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Discovered {Count} potential article links from {Name}.", discoveredArticles.Count, source.Name); var toProcess = discoveredArticles.Take(maxArticlesPerFeed > 0 ? maxArticlesPerFeed : 20); foreach (var discovered in toProcess) { if (stoppingToken.IsCancellationRequested) break; + // 1. Fast Blocklist & Duplicate check before creating DB entry + if (_blocklistService.IsBlocked(discovered.Url)) + { + await _finlyticLogger.LogDebugAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Skipping blocked article URL: {Url}", discovered.Url); + continue; + } + if (await dbService.IsUrlDuplicateAsync(discovered.Url)) { await _finlyticLogger.LogDebugAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Skipping duplicate article URL: {Url}", discovered.Url); continue; } - NewsArticleEntity article; + NewsArticleEntity? article; try { article = await dbService.CreatePendingArticleAsync( @@ -178,17 +183,13 @@ public class NewsScraperBackgroundService : BackgroundService } catch (Exception ex) { - await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[NewsScraperBackgroundService] Failed to register initial pending state for URL: {Url}. Skipping.", discovered.Url); + await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[NewsScraperBackgroundService] Failed to create pending article for {Url}", discovered.Url); continue; } - if (article.Id == Guid.Empty) - { - await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Created pending article has invalid/empty ID for URL: {Url}. Skipping.", discovered.Url); - continue; - } + if (article == null || article.Id == Guid.Empty) continue; - await ProcessSingleArticleAsync(article, scraperService, n8nService, dbService, assetMatchers, stoppingToken); + await ProcessSingleArticleAsync(article, scraperService, dbService, stoppingToken); } } } @@ -196,25 +197,24 @@ public class NewsScraperBackgroundService : BackgroundService private async Task ProcessSingleArticleAsync( NewsArticleEntity article, IPlaywrightScraperService scraperService, - IN8nService n8nService, INewsDbService dbService, - List assetMatchers, CancellationToken stoppingToken) { try { await dbService.UpdateArticleStatusAsync(article.Id, "Processing"); - var (resolvedUrl, rawContent) = await scraperService.ScrapeArticleAsync(article.SourceUrl); + // 1. Playwright Headless Scrape & Redirect Resolution + var (resolvedUrl, scrapeResult) = await scraperService.ScrapeArticleAsync(article.SourceUrl); - if (!string.IsNullOrWhiteSpace(resolvedUrl) && - !resolvedUrl.Equals(article.SourceUrl, StringComparison.OrdinalIgnoreCase)) + // 2. Redirect Handling + if (!string.IsNullOrWhiteSpace(resolvedUrl) && !resolvedUrl.Equals(article.SourceUrl, StringComparison.OrdinalIgnoreCase)) { - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Redirect detected. Initial: {OldUrl} -> Resolved: {NewUrl}", article.SourceUrl, resolvedUrl); - if (await dbService.IsUrlDuplicateAsync(resolvedUrl)) + if (_blocklistService.IsBlocked(resolvedUrl) || await dbService.IsUrlDuplicateAsync(resolvedUrl)) { - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Redirected URL {ResolvedUrl} is a duplicate. Terminating processing.", resolvedUrl); - await dbService.UpdateArticleStatusAsync(article.Id, "Failed"); + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Redirected URL {Url} is already blocked/duplicate.", resolvedUrl); + await _blocklistService.BlockUrlAsync(article.SourceUrl, "RedirectToDuplicate", stoppingToken); + await dbService.DeleteArticleAsync(article.Id); return; } @@ -222,66 +222,84 @@ public class NewsScraperBackgroundService : BackgroundService article.SourceUrl = resolvedUrl; } - if (string.IsNullOrWhiteSpace(rawContent) || rawContent.Length < 60) + // 3. Content Validity Check + var title = !string.IsNullOrWhiteSpace(scrapeResult.Title) ? scrapeResult.Title : article.Title; + var content = scrapeResult.TextContent; + + if (string.IsNullOrWhiteSpace(content) || content.Length < 80 || string.IsNullOrWhiteSpace(title)) { - await dbService.UpdateArticleStatusAsync(article.Id, "Failed"); + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Article {Id} has empty or insufficient content ({Length} chars). Adding to blocklist.", article.Id, content?.Length ?? 0); + await _blocklistService.BlockUrlAsync(article.SourceUrl, "EmptyOrInvalidContent", stoppingToken); + await dbService.DeleteArticleAsync(article.Id); return; } - var discoveredIsins = article.MatchedAssets.Select(m => m.Isin).Where(i => !string.IsNullOrEmpty(i)).ToList(); - var preFilteredAssets = PreFilterAssets(rawContent, article.Title, assetMatchers, discoveredIsins); + var publishedAt = scrapeResult.PublishedAt ?? article.PublishedAt; - if (preFilteredAssets.Count == 0) + // 4. Non-AI Content & Title Deduplication Check (SimHash + N-Gram) + var dupCheck = _deduplicationService.CheckDuplicate(title, content, publishedAt); + if (dupCheck.IsDuplicate) { - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Pre-filtering: Article {Id} does not reference any known assets. Terminating pipeline.", article.Id); - await dbService.UpdateArticleStatusAsync(article.Id, "Failed"); + await _finlyticLogger.LogInfoAsync(SettingKeys.DeduplicationChannel, "[NewsScraperBackgroundService] Article {Id} identified as duplicate of {OriginalId} (Reason: {Reason}). Blocking URL.", article.Id, dupCheck.DuplicateOfArticleId?.ToString() ?? "Unknown", dupCheck.Reason ?? "Duplicate content"); + await _blocklistService.BlockUrlAsync(article.SourceUrl, $"Duplicate:{dupCheck.DuplicateOfArticleId}", stoppingToken); + await dbService.DeleteArticleAsync(article.Id); return; } - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Pre-filtering matched {Count} assets for article {Id}.", preFilteredAssets.Count, article.Id); - - var n8nResponse = await n8nService.AnalyzeArticleAsync(rawContent, preFilteredAssets, stoppingToken); - if (n8nResponse == null) + // 5. In-Memory Asset Matching (ISIN Regex, Name Tokenizer, Suffix Trimming) + var candidateMatches = _assetMatcherService.MatchAssets(title, content, article.SourceUrl); + if (candidateMatches.Count == 0) { - await dbService.UpdateArticleStatusAsync(article.Id, "Failed"); + await _finlyticLogger.LogInfoAsync(SettingKeys.MatcherChannel, "[NewsScraperBackgroundService] No candidate assets matched for article {Id} ('{Title}'). Blocking URL.", article.Id, title); + await _blocklistService.BlockUrlAsync(article.SourceUrl, "NoMatchedAssets", stoppingToken); + await dbService.DeleteArticleAsync(article.Id); return; } - var matchedEntities = new List(); - if (n8nResponse.MatchedAssets != null && n8nResponse.MatchedAssets.Count > 0) + // 6. Multi-Criteria Asset Validation (Sector Clustering, Title Weighting, Existence) + var validatedMatches = await _assetValidationService.ValidateCandidateAssetsAsync(candidateMatches, title, content, stoppingToken); + if (validatedMatches.Count == 0) { - foreach (var asset in n8nResponse.MatchedAssets) - { - var preMatch = preFilteredAssets.FirstOrDefault(p => p.Name.Equals(asset.Name, StringComparison.OrdinalIgnoreCase)); - var isin = preMatch?.Isin ?? asset.Ticker ?? ""; - if (string.IsNullOrWhiteSpace(isin)) continue; - - matchedEntities.Add(new MatchedAssetEntity - { - Id = Guid.NewGuid(), - NewsArticleId = article.Id, - Isin = isin.Trim().ToUpperInvariant(), - Name = !string.IsNullOrWhiteSpace(asset.Name) ? asset.Name.Trim() : isin.Trim().ToUpperInvariant() - }); - } + await _finlyticLogger.LogInfoAsync(SettingKeys.MatcherChannel, "[NewsScraperBackgroundService] All candidate matches pruned during validation for article {Id}. Blocking URL.", article.Id); + await _blocklistService.BlockUrlAsync(article.SourceUrl, "NoValidatedAssets", stoppingToken); + await dbService.DeleteArticleAsync(article.Id); + return; } - if (matchedEntities.Count == 0) + // 7. Prepare Matched Asset Entities + var matchedEntities = validatedMatches.Select(m => new MatchedAssetEntity { - foreach (var preMatch in preFilteredAssets) - { - matchedEntities.Add(new MatchedAssetEntity - { - Id = Guid.NewGuid(), - NewsArticleId = article.Id, - Isin = preMatch.Isin, - Name = preMatch.Name - }); - } + Id = Guid.NewGuid(), + NewsArticleId = article.Id, + Isin = m.Isin, + Name = m.Name + }).ToList(); + + // 8. Generate Clean Summary & Excerpt + var summary = scrapeResult.Excerpt; + if (string.IsNullOrWhiteSpace(summary)) + { + summary = content.Length > 280 ? content[..280] + "..." : content; } - var updatedArticle = await dbService.SaveArticleClassificationAsync(article.Id, n8nResponse, matchedEntities); + // 9. Persist Completed Article + var updatedArticle = await dbService.SaveProcessedArticleAsync( + id: article.Id, + title: title, + author: scrapeResult.Author, + summary: summary, + contentRaw: content, + language: scrapeResult.Language ?? article.Language ?? "de", + publishedAt: publishedAt, + titleHash: dupCheck.TitleHash, + simHash: dupCheck.SimHash, + matchedAssets: matchedEntities + ); + // 10. Register in deduplication memory cache + _deduplicationService.RegisterArticle(article.Id, dupCheck.TitleHash, dupCheck.SimHash, title, publishedAt); + + // 11. Broadcast via MQTT if (updatedArticle != null) { var dto = new NewsArticleDto @@ -304,124 +322,13 @@ public class NewsScraperBackgroundService : BackgroundService }; await _mqttClient.BroadcastArticleAsync(dto); + await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Successfully processed and broadcasted article {Id} ('{Title}') with {Count} matched assets.", article.Id, title, matchedEntities.Count); } } catch (Exception ex) { - await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[NewsScraperBackgroundService] Failed to complete processing pipeline for article: {Url}. Transitioning to 'Scraping' for next cycle retry.", article.SourceUrl); + await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[NewsScraperBackgroundService] Exception processing article {Url}. Flagging for next cycle retry.", article.SourceUrl); await dbService.UpdateArticleStatusAsync(article.Id, "Scraping"); } } - - private List PreFilterAssets( - string content, - string? title, - List assetMatchers, - List? priorityIsins = null) - { - if (assetMatchers.Count == 0) return new List(); - - var fullText = (title != null ? title + " " + content : content); - var matched = new Dictionary(StringComparer.OrdinalIgnoreCase); - - if (priorityIsins != null && priorityIsins.Count > 0) - { - foreach (var isin in priorityIsins) - { - var match = assetMatchers.FirstOrDefault(m => string.Equals(m.Asset.Isin, isin, StringComparison.OrdinalIgnoreCase)); - if (match != null && !matched.ContainsKey(match.Asset.Isin)) - { - matched[match.Asset.Isin] = new FilteredAssetPayload(match.Asset.Name, match.Asset.Isin); - } - } - } - - foreach (var m in assetMatchers) - { - if (matched.ContainsKey(m.Asset.Isin)) continue; - - if (fullText.Contains(m.Asset.Isin, StringComparison.OrdinalIgnoreCase)) - { - matched[m.Asset.Isin] = new FilteredAssetPayload(m.Asset.Name, m.Asset.Isin); - continue; - } - - if (m.WordRegex != null && m.WordRegex.IsMatch(fullText)) - { - matched[m.Asset.Isin] = new FilteredAssetPayload(m.Asset.Name, m.Asset.Isin); - continue; - } - - if (m.CoreWordRegex != null && m.CoreWordRegex.IsMatch(fullText)) - { - matched[m.Asset.Isin] = new FilteredAssetPayload(m.Asset.Name, m.Asset.Isin); - } - } - - return matched.Values.ToList(); - } - - private async Task> GetOrLoadAssetMatchersAsync() - { - if (_cachedAssetMatchers != null && (DateTime.UtcNow - _lastIndexLoadTime).TotalMinutes < 60) - { - return _cachedAssetMatchers; - } - - if (!File.Exists(_indexPath)) - { - await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, "[NewsScraperBackgroundService] Asset index file not found at: {Path}. Pre-filtering will match 0 assets.", _indexPath); - return new List(); - } - - try - { - using var stream = File.OpenRead(_indexPath); - var indexList = await JsonSerializer.DeserializeAsync>(stream); - - if (indexList == null || indexList.Count == 0) - { - return new List(); - } - - var compiled = new List(indexList.Count); - foreach (var asset in indexList) - { - if (string.IsNullOrWhiteSpace(asset.Name) || string.IsNullOrWhiteSpace(asset.Isin)) - continue; - - var rawName = asset.Name.Trim(); - var coreName = ExtractCoreName(rawName); - - Regex? wordRegex = null; - if (rawName.Length >= 4) - { - wordRegex = new Regex($@"\b{Regex.Escape(rawName)}\b", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled); - } - - Regex? coreWordRegex = null; - if (!string.IsNullOrWhiteSpace(coreName) && coreName.Length >= 4 && !coreName.Equals(rawName, StringComparison.OrdinalIgnoreCase)) - { - coreWordRegex = new Regex($@"\b{Regex.Escape(coreName)}\b", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled); - } - - compiled.Add(new CompiledAssetMatcher(asset, coreName, wordRegex, coreWordRegex)); - } - - _cachedAssetMatchers = compiled; - _lastIndexLoadTime = DateTime.UtcNow; - return _cachedAssetMatchers; - } - catch (Exception ex) - { - await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[NewsScraperBackgroundService] Failed to read or parse asset index file from {Path}.", _indexPath); - return _cachedAssetMatchers ?? new List(); - } - } - - private static string ExtractCoreName(string rawName) - { - var cleaned = Regex.Replace(rawName, @"\b(AG|SE|SA|NV|PLC|INC|CORP|LLC|GMBH|CO|KG|HOLDING|GROUP|CLASS\s+[A-Z])\b", "", RegexOptions.IgnoreCase); - return cleaned.Trim(' ', '.', ',', '-'); - } } \ No newline at end of file diff --git a/FinlyticNews/Services/PlaywrightScraperService.cs b/FinlyticNews/Services/PlaywrightScraperService.cs index 3c5ec8f..edb9466 100644 --- a/FinlyticNews/Services/PlaywrightScraperService.cs +++ b/FinlyticNews/Services/PlaywrightScraperService.cs @@ -11,16 +11,16 @@ using Microsoft.Playwright; namespace FinlyticNews.Services; /// -/// Defines a headless scraping service for extracting text and resolving redirects from news sites. +/// Defines a headless scraping service for extracting text, metadata, and resolving redirects from news sites. /// public interface IPlaywrightScraperService { /// - /// Scrapes the text body of an article, automatically following redirects and applying site-specific scraper adapters. + /// Scrapes an article, automatically following redirects and applying site-specific scraper adapters. /// /// The initial article URL. - /// A tuple containing the final resolved URL and the extracted raw text content. - Task<(string ResolvedUrl, string Content)> ScrapeArticleAsync(string url); + /// A tuple containing the final resolved URL and the structured scrape result. + Task<(string ResolvedUrl, ScrapedArticleResult Result)> ScrapeArticleAsync(string url); } /// @@ -45,9 +45,9 @@ public class PlaywrightScraperService : IPlaywrightScraperService, IAsyncDisposa } /// - public async Task<(string ResolvedUrl, string Content)> ScrapeArticleAsync(string url) + public async Task<(string ResolvedUrl, ScrapedArticleResult Result)> ScrapeArticleAsync(string url) { - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[PlaywrightScraperService] Launching browser context to scrape article: {Url}", url); + await _finlyticLogger.LogInfoAsync(SettingKeys.ScraperChannel, "[PlaywrightScraperService] Launching browser context to scrape article: {Url}", url); var browser = await GetOrInitBrowserAsync(); @@ -73,8 +73,6 @@ public class PlaywrightScraperService : IPlaywrightScraperService, IAsyncDisposa } var finalUrl = page.Url; - await _finlyticLogger.LogDebugAsync(SettingKeys.NewsChannel, "[PlaywrightScraperService] Navigation completed. Initial final URL: {Url}", finalUrl); - var host = new Uri(finalUrl).Host; var adapter = _scraperAdapters.FirstOrDefault(a => host.EndsWith(a.Hostname, StringComparison.OrdinalIgnoreCase) || @@ -82,14 +80,13 @@ public class PlaywrightScraperService : IPlaywrightScraperService, IAsyncDisposa if (adapter != null) { - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[PlaywrightScraperService] Executing adapter redirect check for host: {Host}", adapter.Hostname); try { var resolvedRedirectUrl = await adapter.TryResolveRedirectUrlAsync(page); if (!string.IsNullOrWhiteSpace(resolvedRedirectUrl) && !resolvedRedirectUrl.Equals(finalUrl, StringComparison.OrdinalIgnoreCase)) { - await _finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "[PlaywrightScraperService] Redirect resolved to target URL: {Url}", resolvedRedirectUrl); + await _finlyticLogger.LogInfoAsync(SettingKeys.ScraperChannel, "[PlaywrightScraperService] Redirect resolved to target URL: {Url}", resolvedRedirectUrl); var redirectResponse = await page.GotoAsync(resolvedRedirectUrl, new PageGotoOptions { @@ -97,11 +94,6 @@ public class PlaywrightScraperService : IPlaywrightScraperService, IAsyncDisposa Timeout = 30000 }); - if (redirectResponse == null) - { - await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, "[PlaywrightScraperService] Failed to load response for redirect URL: {Url}", resolvedRedirectUrl); - } - finalUrl = page.Url; host = new Uri(finalUrl).Host; @@ -112,26 +104,59 @@ public class PlaywrightScraperService : IPlaywrightScraperService, IAsyncDisposa } catch (Exception ex) { - await _finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, ex, "[PlaywrightScraperService] Failed to resolve redirect through adapter for host: {Host}. Continuing with current page.", adapter.Hostname); + await _finlyticLogger.LogWarningAsync(SettingKeys.ScraperChannel, ex, "[PlaywrightScraperService] Failed to resolve redirect through adapter for host: {Host}. Continuing with current page.", adapter?.Hostname ?? host); } } - string content; - if (adapter != null) + ScrapedArticleResult? result = null; + + for (int attempt = 1; attempt <= 2; attempt++) { - var result = await adapter.ExtractArticleContentAsync(page); - content = result?.TextContent ?? await FallbackExtractContentAsync(page); - } - else - { - content = await FallbackExtractContentAsync(page); + try + { + if (adapter != null) + { + result = await adapter.ExtractArticleContentAsync(page); + } + + if (result == null || string.IsNullOrWhiteSpace(result.TextContent)) + { + var bodyText = await FallbackExtractContentAsync(page); + result = new ScrapedArticleResult( + Title: await page.TitleAsync(), + TextContent: bodyText, + HtmlContent: string.Empty, + Author: null, + Excerpt: null, + FinalUrl: finalUrl + ); + } + + break; // Extraction succeeded without execution context getting destroyed + } + catch (PlaywrightException ex) when (ex.Message.Contains("Execution context was destroyed") && attempt == 1) + { + await _finlyticLogger.LogWarningAsync(SettingKeys.ScraperChannel, "[PlaywrightScraperService] Execution context destroyed (likely JS/Meta redirect). Waiting for new page load..."); + + try + { + await page.WaitForLoadStateAsync(LoadState.DOMContentLoaded, new PageWaitForLoadStateOptions { Timeout = 15000 }); + } + catch (TimeoutException) { /* Ignored, try extracting anyway */ } + + finalUrl = page.Url; + host = new Uri(finalUrl).Host; + adapter = _scraperAdapters.FirstOrDefault(a => + host.EndsWith(a.Hostname, StringComparison.OrdinalIgnoreCase) || + a.Hostname.EndsWith(host, StringComparison.OrdinalIgnoreCase)); + } } - return (finalUrl, content); + return (finalUrl, result!); } catch (Exception ex) { - await _finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "[PlaywrightScraperService] Failed to scrape page content from URL: {Url}", url); + await _finlyticLogger.LogErrorAsync(SettingKeys.ScraperChannel, ex, "[PlaywrightScraperService] Failed to scrape page content from URL: {Url}", url); throw; } finally diff --git a/FinlyticNews/Services/SettingsDbService.cs b/FinlyticNews/Services/SettingsDbService.cs deleted file mode 100644 index 5c50376..0000000 --- a/FinlyticNews/Services/SettingsDbService.cs +++ /dev/null @@ -1,103 +0,0 @@ -using FinlyticNews.Database; -using FinlyticNews.Entities; -using Microsoft.EntityFrameworkCore; - -namespace FinlyticNews.Services; - -/// -/// Service interface for retrieving and persisting runtime settings in PostgreSQL for FinlyticNews. -/// -public interface ISettingsDbService -{ - /// - /// Retrieves current news settings from database, initializing default values if empty. - /// - Task GetSettingsAsync(); - - /// - /// Persists updated settings to PostgreSQL. - /// - Task SaveSettingsAsync(NewsSettingsEntity settings); - - /// - /// Updates settings from a key-value dictionary received via Admin Panel MQTT events. - /// - Task UpdateSettingsFromDictionaryAsync(Dictionary dictionary); -} - -/// -/// EF Core implementation of . -/// -public class SettingsDbService : ISettingsDbService -{ - private readonly NewsDbContext _context; - - /// - /// Initializes a new instance of the class. - /// - /// The database context mapping database tables. - public SettingsDbService(NewsDbContext context) - { - _context = context; - } - - /// - public async Task GetSettingsAsync() - { - var settings = await _context.Settings.AsNoTracking().FirstOrDefaultAsync(); - if (settings == null) - { - settings = new NewsSettingsEntity { Id = Guid.NewGuid() }; - _context.Settings.Add(settings); - await _context.SaveChangesAsync(); - _context.ChangeTracker.Clear(); - } - return settings; - } - - /// - public async Task SaveSettingsAsync(NewsSettingsEntity settings) - { - var existing = await _context.Settings.FirstOrDefaultAsync(); - if (existing == null) - { - if (settings.Id == Guid.Empty) settings.Id = Guid.NewGuid(); - _context.Settings.Add(settings); - } - else - { - existing.PollingFrequencyMinutes = settings.PollingFrequencyMinutes; - existing.ArticleRetentionDays = settings.ArticleRetentionDays; - existing.DefaultPageSize = settings.DefaultPageSize; - existing.ScrapingIntervalMinutes = settings.ScrapingIntervalMinutes; - existing.N8nWebhookUrl = settings.N8nWebhookUrl; - existing.UpdatedAt = settings.UpdatedAt; - _context.Settings.Update(existing); - } - await _context.SaveChangesAsync(); - return settings; - } - - /// - public async Task UpdateSettingsFromDictionaryAsync(Dictionary dictionary) - { - var settings = await GetSettingsAsync(); - - foreach (var (key, value) in dictionary) - { - if (string.Equals(key, "PollingFrequencyMinutes", StringComparison.OrdinalIgnoreCase) && int.TryParse(value, out var pfm)) - settings.PollingFrequencyMinutes = pfm; - else if (string.Equals(key, "ArticleRetentionDays", StringComparison.OrdinalIgnoreCase) && int.TryParse(value, out var ard)) - settings.ArticleRetentionDays = ard; - else if (string.Equals(key, "DefaultPageSize", StringComparison.OrdinalIgnoreCase) && int.TryParse(value, out var dps)) - settings.DefaultPageSize = dps; - else if (string.Equals(key, "ScrapingIntervalMinutes", StringComparison.OrdinalIgnoreCase) && int.TryParse(value, out var sim)) - settings.ScrapingIntervalMinutes = sim; - else if (string.Equals(key, "N8nWebhookUrl", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(value)) - settings.N8nWebhookUrl = value.Trim(); - } - - settings.UpdatedAt = DateTime.UtcNow; - await SaveSettingsAsync(settings); - } -} diff --git a/FinlyticNews/Util/NewsMqttClient.cs b/FinlyticNews/Util/NewsMqttClient.cs index 18bcab1..3bf7f9a 100644 --- a/FinlyticNews/Util/NewsMqttClient.cs +++ b/FinlyticNews/Util/NewsMqttClient.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; using FinlyticCore.Dtos; @@ -12,7 +10,6 @@ using FinlyticCore.Dtos.Settings; using FinlyticCore.Models; using FinlyticCore.Services; using FinlyticCore.Util; -using FinlyticNews.Database; using FinlyticNews.Entities; using FinlyticNews.Services; using Microsoft.Extensions.Configuration; @@ -23,7 +20,7 @@ using Microsoft.Extensions.Logging; namespace FinlyticNews.Util; /// -/// A managed MQTT client for broadcasting completed news articles and responding to RPC requests. +/// Managed MQTT client for broadcasting completed news articles and handling typed RPC requests for FinlyticNews. /// public class NewsMqttClient : ManagedMqttClient, IHostedService { @@ -44,12 +41,7 @@ public class NewsMqttClient : ManagedMqttClient, IHostedService /// public async Task StartAsync(CancellationToken cancellationToken) { - var config = new MqttConfiguration - { - Host = _configuration["MQTT:Host"] ?? _configuration["MQTT__Host"] ?? "localhost", - Port = Convert.ToInt32(_configuration["MQTT:Port"] ?? _configuration["MQTT__Port"] ?? "1883"), - ClientId = $"{(_configuration["MQTT:ClientId"] ?? _configuration["MQTT__ClientId"] ?? "FinlyticNews")}_{Guid.NewGuid()}" - }; + var config = MqttConfiguration.FromConfiguration(_configuration, "FinlyticNews"); _logger.LogInformation("Starting News MQTT client. Host: {Host}, ClientId: {ClientId}", config.Host, config.ClientId); await ConnectAsync(config); @@ -65,22 +57,22 @@ public class NewsMqttClient : ManagedMqttClient, IHostedService /// protected override async Task OnConnectedAsync() { - _logger.LogInformation("News MQTT client connected. Subscribing to RPC topics..."); + _logger.LogInformation("News MQTT client connected. Registering RPC topic subscriptions..."); - await SubscribeAsync("services/request/news_Get/#"); - await SubscribeAsync("services/request/news_GetById/#"); - await SubscribeAsync("services/request/news_GetPending/#"); - await SubscribeAsync("services/request/news_UpdateStatus/#"); - await SubscribeAsync("services/request/news_settings_GetAll/#"); - await SubscribeAsync("services/request/news_settings_Update/#"); - await SubscribeAsync("services/request/health_Ping/#"); - await SubscribeAsync("services/config/updated/#"); + await SubscribeAsync(MqttTopics.ResponseWildcard); + await SubscribeRpcAsync>(MqttTopics.RequestFilter(MqttTopics.Channels.NewsGet), HandleNewsGetRpcAsync); + await SubscribeRpcAsync(MqttTopics.RequestFilter(MqttTopics.Channels.NewsGetById), HandleNewsGetByIdRpcAsync); + await SubscribeRpcAsync>(MqttTopics.RequestFilter(MqttTopics.Channels.NewsGetPending), HandleNewsGetPendingRpcAsync); + await SubscribeRpcAsync(MqttTopics.RequestFilter(MqttTopics.Channels.NewsUpdateStatus), HandleNewsUpdateStatusRpcAsync); + await SubscribeRpcAsync>(MqttTopics.RequestFilter(MqttTopics.Channels.NewsSettingsGetAll), HandleSettingsGetAllRpcAsync); + await SubscribeRpcAsync, List>(MqttTopics.RequestFilter(MqttTopics.Channels.NewsSettingsUpdate), HandleSettingsUpdateRpcAsync); + await SubscribeAsync(MqttTopics.RequestFilter(MqttTopics.Channels.HealthPing), HandleHealthPingRpcAsync); - FinlyticCore.Services.FinlyticLogBroadcaster.OnLogPublished = async (logDto) => + FinlyticLogBroadcaster.OnLogPublished = async (logDto) => { if (IsConnected && string.Equals(logDto.ServiceName, "FinlyticNews", StringComparison.OrdinalIgnoreCase)) { - await PublishAsync("finlytic/logs/FinlyticNews", logDto); + await PublishAsync(MqttTopics.Logs("FinlyticNews"), logDto); } }; } @@ -90,317 +82,126 @@ public class NewsMqttClient : ManagedMqttClient, IHostedService /// public async Task BroadcastArticleAsync(NewsArticleDto article) { - const string topic = "services/news/completed"; + const string topic = MqttTopics.NewsCompleted; _logger.LogInformation("Broadcasting completed article to MQTT topic: {Topic}. ID: {Id}", topic, article.Id); await PublishAsync(topic, article); var firstIsin = article.MatchedAssets.FirstOrDefault()?.Isin; if (!string.IsNullOrWhiteSpace(firstIsin)) { - string isinTopic = $"finlytic/news/stream/{firstIsin.Trim().ToLowerInvariant()}"; + string isinTopic = MqttTopics.NewsStream(firstIsin); await PublishAsync(isinTopic, article); } } - /// - protected override async Task OnMessageReceivedAsync(string topic, string payload) - { - if (string.IsNullOrWhiteSpace(topic)) return; - - if (topic.StartsWith("services/config/updated", StringComparison.OrdinalIgnoreCase)) - { - if (topic.EndsWith("FinlyticNews", StringComparison.OrdinalIgnoreCase)) - { - await OnConfigUpdatedAsync(payload); - } - return; - } - - var segments = topic.Split('/'); - if (segments.Length < 4) return; - - var channel = segments[2]; - var correlationId = segments[^1]; - - switch (channel) - { - case "news_Get": - await OnGetNewsAsync(payload, correlationId); - break; - - case "news_GetById": - await OnGetNewsByIdAsync(payload, correlationId); - break; - - case "news_GetPending": - await OnGetPendingNewsAsync(payload, correlationId); - break; - - case "news_UpdateStatus": - await OnUpdateNewsStatusAsync(payload, correlationId); - break; - - case "news_settings_GetAll": - await OnSettingsGetAllAsync(correlationId); - break; - - case "news_settings_Update": - await OnSettingsUpdateAsync(payload, correlationId); - break; - - case "health_Ping": - await OnHealthPingAsync(segments, correlationId); - break; - - default: - _logger.LogDebug("Received unhandled RPC channel: {Channel}", channel); - break; - } - } - - private async Task OnGetNewsAsync(string payload, string correlationId) + private async Task> HandleNewsGetRpcAsync(DailyNewsRequest? req, string correlationId) { using var scope = _scopeFactory.CreateScope(); var finlyticLogger = scope.ServiceProvider.GetRequiredService>(); - await finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "Received RPC news_Get request. Correlation: {CorrelationId}", correlationId); + await finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "Received RPC news_Get request [CorrelationId: {CorrelationId}]", correlationId); - int limit = 20; - int offset = 0; - string? isin = null; - DateTime? date = null; - string? status = null; - string? searchQuery = null; + int limit = req?.Limit > 0 ? req.Limit : 20; + int offset = req?.Offset >= 0 ? req.Offset : 0; + string? isin = !string.IsNullOrWhiteSpace(req?.Isin) ? req.Isin : null; + string? status = req?.Status; + string? searchQuery = req?.Query; + DateTime? date = req?.Date; - if (!string.IsNullOrWhiteSpace(payload)) + if (req?.HasSentiment == true && string.IsNullOrEmpty(status)) { - try - { - var req = JsonSerializer.Deserialize(payload, FinlyticJsonSerializerContext.Default.DailyNewsRequest); - if (req != null) - { - limit = req.Limit > 0 ? req.Limit : 20; - offset = req.Offset >= 0 ? req.Offset : 0; - isin = !string.IsNullOrWhiteSpace(req.Isin) ? req.Isin : null; - status = req.Status; - searchQuery = req.Query; - date = req.Date; - - if (req.HasSentiment == true && string.IsNullOrEmpty(status)) - { - status = "Analyzed"; - } - } - } - catch (Exception ex) - { - await finlyticLogger.LogWarningAsync(SettingKeys.NewsChannel, ex, "Failed to parse DailyNewsRequest payload on news_Get"); - } + status = "Analyzed"; } try { var dbService = scope.ServiceProvider.GetRequiredService(); var articles = await dbService.GetFilteredNewsAsync(limit, offset, isin, date, status, searchQuery); - var dtos = (await Task.WhenAll(articles.Select(a => MapToDtoAsync(a)))).ToList(); - - string responseTopic = $"services/response/news_Get/{correlationId}"; - await finlyticLogger.LogInfoAsync(SettingKeys.NewsChannel, "Publishing RPC response to {ResponseTopic} with {Count} articles.", responseTopic, dtos.Count); - await PublishAsync(responseTopic, dtos); + return (await Task.WhenAll(articles.Select(a => MapToDtoAsync(a)))).ToList(); } catch (Exception ex) { await finlyticLogger.LogErrorAsync(SettingKeys.NewsChannel, ex, "Failed to compile RPC response for news_Get"); - try - { - string responseTopic = $"services/response/news_Get/{correlationId}"; - await PublishAsync(responseTopic, new List()); - } - catch { } + return []; } } - private async Task OnGetNewsByIdAsync(string payload, string correlationId) + private async Task HandleNewsGetByIdRpcAsync(ArticleRequest? req, string correlationId) { - string responseTopic = $"services/response/news_GetById/{correlationId}"; - if (string.IsNullOrWhiteSpace(payload)) + var targetIdStr = req?.ArticleId ?? req?.Id; + if (Guid.TryParse(targetIdStr, out var articleId)) { - await PublishAsync(responseTopic, (object?)null); - return; - } + using var scope = _scopeFactory.CreateScope(); + var dbService = scope.ServiceProvider.GetRequiredService(); + var article = await dbService.GetArticleByIdAsync(articleId); - try - { - var request = JsonSerializer.Deserialize(payload, FinlyticJsonSerializerContext.Default.ArticleRequest); - var targetIdStr = request?.ArticleId ?? request?.Id; - - if (Guid.TryParse(targetIdStr, out var articleId)) + if (article != null) { - using var scope = _scopeFactory.CreateScope(); - var dbService = scope.ServiceProvider.GetRequiredService(); - var article = await dbService.GetArticleByIdAsync(articleId); - - if (article != null) - { - var dto = await MapToDtoAsync(article); - await PublishAsync(responseTopic, dto); - return; - } + return await MapToDtoAsync(article); } } - catch { } - - await PublishAsync(responseTopic, (object?)null); + return null; } - private async Task OnGetPendingNewsAsync(string payload, string correlationId) + private async Task> HandleNewsGetPendingRpcAsync(object? _, string correlationId) { - int limit = 10; - if (!string.IsNullOrWhiteSpace(payload)) - { - try - { - using var doc = JsonDocument.Parse(payload); - if (doc.RootElement.TryGetProperty("limit", out var limitProp) && limitProp.TryGetInt32(out var parsedLimit)) - { - limit = Math.Min(parsedLimit, 10); - } - } - catch { } - } - try { using var scope = _scopeFactory.CreateScope(); var dbService = scope.ServiceProvider.GetRequiredService(); - - var pendingArticles = await dbService.GetArticlesByStatusAsync("Pending"); - var dtos = (await Task.WhenAll(pendingArticles.Take(limit).Select(a => MapToDtoAsync(a)))).ToList(); - - string responseTopic = $"services/response/news_GetPending/{correlationId}"; - await PublishAsync(responseTopic, dtos); + var pendingArticles = await dbService.GetArticlesByStatusAsync("Completed"); + return (await Task.WhenAll(pendingArticles.Take(10).Select(a => MapToDtoAsync(a)))).ToList(); + } + catch + { + return []; } - catch { } } - private async Task OnUpdateNewsStatusAsync(string payload, string correlationId) + private async Task HandleNewsUpdateStatusRpcAsync(UpdateNewsStatusRequest? req, string correlationId) { - UpdateNewsStatusResponse response; - try + if (req != null && req.Id != Guid.Empty) { - var request = JsonSerializer.Deserialize(payload, FinlyticJsonSerializerContext.Default.UpdateNewsStatusRequest); - if (request != null && request.Id != Guid.Empty) - { - using var scope = _scopeFactory.CreateScope(); - var dbService = scope.ServiceProvider.GetRequiredService(); - - await dbService.UpdateArticleStatusAsync(request.Id, request.Status); - response = new UpdateNewsStatusResponse(true, "Status updated successfully."); - } - else - { - response = new UpdateNewsStatusResponse(false, "Invalid payload."); - } + using var scope = _scopeFactory.CreateScope(); + var dbService = scope.ServiceProvider.GetRequiredService(); + await dbService.UpdateArticleStatusAsync(req.Id, req.Status); + return new UpdateNewsStatusResponse(true, "Status updated successfully."); } - catch (Exception ex) - { - response = new UpdateNewsStatusResponse(false, ex.Message); - } - - string responseTopic = $"services/response/news_UpdateStatus/{correlationId}"; - await PublishAsync(responseTopic, response); + return new UpdateNewsStatusResponse(false, "Invalid payload."); } - private async Task OnSettingsGetAllAsync(string correlationId) + private async Task> HandleSettingsGetAllRpcAsync(object? _, string correlationId) { using var scope = _scopeFactory.CreateScope(); var finlyticLogger = scope.ServiceProvider.GetRequiredService>(); var settingsService = scope.ServiceProvider.GetRequiredService(); - await finlyticLogger.LogInfoAsync(SettingKeys.MqttChannel, "[FinlyticNews] [Settings_GetAll] Retrieving all dynamic settings via reflection [CorrelationId: {CorrelationId}]", correlationId); - try - { - var settings = await settingsService.GetAllRegisteredSettingsAsync(new[] { typeof(SettingKeys) }); - var responseTopic = $"services/response/news_settings_GetAll/{correlationId}"; - - await PublishAsync(responseTopic, settings); - await finlyticLogger.LogInfoAsync(SettingKeys.MqttChannel, "[FinlyticNews] [Settings_GetAll] Published {Count} settings to '{ResponseTopic}'", settings.Count, responseTopic); - } - catch (Exception ex) - { - await finlyticLogger.LogErrorAsync(SettingKeys.MqttChannel, ex, "[FinlyticNews] [Settings_GetAll] Failed to retrieve settings."); - } + await finlyticLogger.LogInfoAsync(SettingKeys.MqttChannel, "[FinlyticNews] [Settings_GetAll] Retrieving service dynamic settings [CorrelationId: {CorrelationId}]", correlationId); + return await settingsService.GetAllRegisteredSettingsAsync(new[] { typeof(SettingKeys) }); } - private async Task OnSettingsUpdateAsync(string payload, string correlationId) + private async Task> HandleSettingsUpdateRpcAsync(Dictionary? updates, string correlationId) { - if (string.IsNullOrWhiteSpace(payload)) return; - using var scope = _scopeFactory.CreateScope(); var finlyticLogger = scope.ServiceProvider.GetRequiredService>(); var settingsService = scope.ServiceProvider.GetRequiredService(); await finlyticLogger.LogInfoAsync(SettingKeys.MqttChannel, "[FinlyticNews] [Settings_Update] Processing settings update RPC [CorrelationId: {CorrelationId}]", correlationId); - try + if (updates != null && updates.Count > 0) { - Dictionary? updates = null; - try - { - updates = JsonSerializer.Deserialize>(payload); - } - catch - { - var list = JsonSerializer.Deserialize>(payload); - if (list != null) - { - updates = new Dictionary(); - foreach (var item in list) updates[item.Key] = item.Value; - } - } - - if (updates != null && updates.Count > 0) - { - await settingsService.UpdateSettingsAsync(updates); - await finlyticLogger.LogInfoAsync(SettingKeys.MqttChannel, "[FinlyticNews] [Settings_Update] Successfully updated {Count} settings in database and cache.", updates.Count); - } - - var currentSettings = await settingsService.GetAllRegisteredSettingsAsync(new[] { typeof(SettingKeys) }); - var responseTopic = $"services/response/news_settings_Update/{correlationId}"; - await PublishAsync(responseTopic, currentSettings); - } - catch (Exception ex) - { - await finlyticLogger.LogErrorAsync(SettingKeys.MqttChannel, ex, "[FinlyticNews] [Settings_Update] Failed to update settings."); + await settingsService.UpdateSettingsAsync(updates); + await finlyticLogger.LogInfoAsync(SettingKeys.MqttChannel, "[FinlyticNews] [Settings_Update] Successfully updated {Count} settings in database and cache.", updates.Count); } + return await settingsService.GetAllRegisteredSettingsAsync(new[] { typeof(SettingKeys) }); } - private async Task OnConfigUpdatedAsync(string payload) + private async Task HandleHealthPingRpcAsync(object? _, string topic, string correlationId) { - try + if (topic.Contains("FinlyticNews", StringComparison.OrdinalIgnoreCase)) { - using var doc = JsonDocument.Parse(payload); - if (doc.RootElement.TryGetProperty("settings", out var settingsProp)) - { - var dict = JsonSerializer.Deserialize>(settingsProp.GetRawText()); - if (dict != null && dict.Count > 0) - { - using var scope = _scopeFactory.CreateScope(); - var settings = scope.ServiceProvider.GetRequiredService(); - await settings.UpdateSettingsAsync(dict); - } - } - } - catch { } - } - - private async Task OnHealthPingAsync(string[] segments, string correlationId) - { - bool isForMe = segments.Length >= 5 && segments[3].Equals("FinlyticNews", StringComparison.OrdinalIgnoreCase); - if (isForMe) - { - string respTopic = $"services/response/health_Ping/{correlationId}"; + string respTopic = MqttTopics.ResponseTopic(MqttTopics.Channels.HealthPing, correlationId); await PublishAsync(respTopic, new ServiceHealthResponse("FinlyticNews", "Online", DateTime.UtcNow, "Connected")); - + using var scope = _scopeFactory.CreateScope(); var finlyticLogger = scope.ServiceProvider.GetRequiredService>(); await finlyticLogger.LogInfoAsync(SettingKeys.HealthPingChannel, "Responded to live health_Ping RPC request [CorrelationId: {CorrelationId}].", correlationId); @@ -408,7 +209,11 @@ public class NewsMqttClient : ManagedMqttClient, IHostedService } /// - /// Maps a NewsArticleEntity to a NewsArticleDto while performing zero-latency disk lookups for sentiment summaries. + /// Maps a NewsArticleEntity to a NewsArticleDto, enriching it with the FinBERT sentiment result for the + /// article by querying FinlyticSentiment over the RPC + /// channel. This previously read a legacy on-disk cache at data/summaries/articles/*.json and + /// data/summaries/isin/*.json, but nothing in this repository writes those files anymore (FinlyticSentiment + /// persists results to its own database) - the disk lookup was silently degrading Sentiment to always-null. /// private async Task MapToDtoAsync(NewsArticleEntity a) { @@ -419,55 +224,27 @@ public class NewsMqttClient : ManagedMqttClient, IHostedService try { - var targetId = a.Id.ToString(); - IsinAnalysisEntry? sentimentEntry = null; - - var articlePath = Path.Combine(Directory.GetCurrentDirectory(), "data", "summaries", "articles", $"{targetId}.json"); - if (File.Exists(articlePath)) + if (IsConnected) { - try + var targetId = a.Id.ToString(); + var sentimentEntry = await SendRpcRequestAsync( + MqttTopics.Channels.SentimentGetArticle, + new ArticleRequest(targetId, targetId), + TimeSpan.FromSeconds(3)); + + if (sentimentEntry?.FinbertResult != null) { - var json = await File.ReadAllTextAsync(articlePath); - sentimentEntry = JsonSerializer.Deserialize(json, FinlyticJsonSerializerContext.Default.IsinAnalysisEntry); + finbertResult = sentimentEntry.FinbertResult; + sentimentLabel = finbertResult.Label; + sentimentScore = finbertResult.CompoundScore; + confidence = finbertResult.Confidence; } - catch { } - } - - if (sentimentEntry == null && a.MatchedAssets != null && a.MatchedAssets.Count > 0) - { - foreach (var asset in a.MatchedAssets) - { - if (string.IsNullOrWhiteSpace(asset.Isin)) continue; - var isinPath = Path.Combine(Directory.GetCurrentDirectory(), "data", "summaries", "isin", $"{asset.Isin.Trim()}.json"); - - if (File.Exists(isinPath)) - { - try - { - var json = await File.ReadAllTextAsync(isinPath); - var isinDoc = JsonSerializer.Deserialize(json, FinlyticJsonSerializerContext.Default.IsinSentimentSummaryDto); - var match = isinDoc?.Analyses?.FirstOrDefault(entry => string.Equals(entry.Article?.ArticleId?.Trim(), targetId, StringComparison.OrdinalIgnoreCase)); - - if (match != null) - { - sentimentEntry = match; - break; - } - } - catch { } - } - } - } - - if (sentimentEntry?.FinbertResult != null) - { - finbertResult = sentimentEntry.FinbertResult; - sentimentLabel = finbertResult.Label; - sentimentScore = finbertResult.CompoundScore; - confidence = finbertResult.Confidence; } } - catch { } + catch (Exception ex) + { + _logger.LogWarning(ex, "[NewsMqttClient] Failed to fetch sentiment for article {ArticleId} via '{Channel}' RPC.", a.Id, MqttTopics.Channels.SentimentGetArticle); + } return new NewsArticleDto { diff --git a/FinlyticNews/Util/SettingKeys.cs b/FinlyticNews/Util/SettingKeys.cs index 9e651dd..4c262ba 100644 --- a/FinlyticNews/Util/SettingKeys.cs +++ b/FinlyticNews/Util/SettingKeys.cs @@ -2,26 +2,36 @@ using FinlyticCore.Models.Settings; namespace FinlyticNews.Util; +/// +/// Service-scoped dynamic setting keys for FinlyticNews. +/// public static class SettingKeys { // --- Logging-Kanäle --- public static readonly SettingKey NewsChannel = new("Logging.Channel.News", true); public static readonly SettingKey MqttChannel = new("Logging.Channel.MQTT", true); public static readonly SettingKey HealthPingChannel = new("Logging.Channel.Health", true); + public static readonly SettingKey ScraperChannel = new("Logging.Channel.Scraper", true); + public static readonly SettingKey MatcherChannel = new("Logging.Channel.Matcher", true); + public static readonly SettingKey DeduplicationChannel = new("Logging.Channel.Deduplication", true); // --- Scraping & Feed-Konfiguration --- public static readonly SettingKey ScrapeIntervalMinutes = new("Scraping.IntervalMinutes", 15); public static readonly SettingKey MaxArticlesPerFeed = new("Scraping.MaxArticlesPerFeed", 20); public static readonly SettingKey EnableAutoScraping = new("Feature.EnableAutoScraping", true); - public static readonly SettingKey HttpTimeoutSeconds = new("Scraping.HttpTimeoutSeconds", 20); + public static readonly SettingKey HttpTimeoutSeconds = new("Scraping.HttpTimeoutSeconds", 30); - // --- KI & Sentiment-Konfiguration --- - public static readonly SettingKey FinBertBatchSize = new("AI.FinBertBatchSize", 8); - public static readonly SettingKey MinSentimentConfidence = new("AI.MinSentimentConfidence", 0.65); + // --- Deduplication & Fingerprinting --- + public static readonly SettingKey TitleSimilarityThreshold = new("Deduplication.TitleSimilarityThreshold", 0.85); + public static readonly SettingKey SimHashMaxHammingDistance = new("Deduplication.SimHashMaxHammingDistance", 3); + public static readonly SettingKey DeduplicationWindowDays = new("Deduplication.WindowDays", 7); + + // --- Asset Matching & Validation --- + public static readonly SettingKey MinNameLength = new("Matching.MinNameLength", 3); + public static readonly SettingKey EnableSectorClustering = new("Matching.EnableSectorClustering", true); + public static readonly SettingKey RequireFinancialContextForShortNames = new("Matching.RequireFinancialContextForShortNames", true); // --- Daten-Retention & Cleanup --- public static readonly SettingKey ArticleRetentionDays = new("Data.ArticleRetentionDays", 90); - - // --- N8N / Webhook-Konfiguration --- - public static readonly SettingKey N8nArticleExtractionUrl = new("N8N.ArticleExtractionUrl", "https://n8n.kleidukos.me/webhook/gemini/article/extraction"); } + diff --git a/FinlyticNews/Util/Volumes.cs b/FinlyticNews/Util/Volumes.cs index aa71727..84618e1 100644 --- a/FinlyticNews/Util/Volumes.cs +++ b/FinlyticNews/Util/Volumes.cs @@ -1,4 +1,4 @@ -namespace FinlyticAssets.Util; +namespace FinlyticNews.Util; public class Volumes { diff --git a/FinlyticNews/publish/.playwright/node/LICENSE b/FinlyticNews/publish/.playwright/node/LICENSE deleted file mode 100644 index 4efd43c..0000000 --- a/FinlyticNews/publish/.playwright/node/LICENSE +++ /dev/null @@ -1,2579 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -The Node.js license applies to all parts of Node.js that are not externally -maintained libraries. - -The externally maintained libraries used by Node.js are: - -- Acorn, located at deps/acorn, is licensed as follows: - """ - MIT License - - Copyright (C) 2012-2022 by various contributors (see AUTHORS) - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - """ - -- c-ares, located at deps/cares, is licensed as follows: - """ - MIT License - - Copyright (c) 1998 Massachusetts Institute of Technology - Copyright (c) 2007 - 2023 Daniel Stenberg with many contributors, see AUTHORS - file. - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - the Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - """ - -- cjs-module-lexer, located at deps/cjs-module-lexer, is licensed as follows: - """ - MIT License - ----------- - - Copyright (C) 2018-2020 Guy Bedford - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- ittapi, located at deps/v8/third_party/ittapi, is licensed as follows: - """ - Copyright (c) 2019 Intel Corporation. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- amaro, located at deps/amaro, is licensed as follows: - """ - MIT License - - Copyright (c) Marco Ippolito and Amaro contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - """ - -- swc, located at deps/amaro/dist, is licensed as follows: - """ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2024 SWC contributors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - """ - -- ICU, located at deps/icu-small, is licensed as follows: - """ - UNICODE LICENSE V3 - - COPYRIGHT AND PERMISSION NOTICE - - Copyright © 2016-2024 Unicode, Inc. - - NOTICE TO USER: Carefully read the following legal agreement. BY - DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR - SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE - TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT - DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of data files and any associated documentation (the "Data Files") or - software and any associated documentation (the "Software") to deal in the - Data Files or Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, and/or sell - copies of the Data Files or Software, and to permit persons to whom the - Data Files or Software are furnished to do so, provided that either (a) - this copyright and permission notice appear with all copies of the Data - Files or Software, or (b) this copyright and permission notice appear in - associated Documentation. - - THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY - KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF - THIRD PARTY RIGHTS. - - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE - BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, - OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA - FILES OR SOFTWARE. - - Except as contained in this notice, the name of a copyright holder shall - not be used in advertising or otherwise to promote the sale, use or other - dealings in these Data Files or Software without prior written - authorization of the copyright holder. - - SPDX-License-Identifier: Unicode-3.0 - - ---------------------------------------------------------------------- - - Third-Party Software Licenses - - This section contains third-party software notices and/or additional - terms for licensed third-party software components included within ICU - libraries. - - ---------------------------------------------------------------------- - - ICU License - ICU 1.8.1 to ICU 57.1 - - COPYRIGHT AND PERMISSION NOTICE - - Copyright (c) 1995-2016 International Business Machines Corporation and others - All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, and/or sell copies of the Software, and to permit persons - to whom the Software is furnished to do so, provided that the above - copyright notice(s) and this permission notice appear in all copies of - the Software and that both the above copyright notice(s) and this - permission notice appear in supporting documentation. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT - OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY - SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - Except as contained in this notice, the name of a copyright holder - shall not be used in advertising or otherwise to promote the sale, use - or other dealings in this Software without prior written authorization - of the copyright holder. - - All trademarks and registered trademarks mentioned herein are the - property of their respective owners. - - ---------------------------------------------------------------------- - - Chinese/Japanese Word Break Dictionary Data (cjdict.txt) - - # The Google Chrome software developed by Google is licensed under - # the BSD license. Other software included in this distribution is - # provided under other licenses, as set forth below. - # - # The BSD License - # http://opensource.org/licenses/bsd-license.php - # Copyright (C) 2006-2008, Google Inc. - # - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided with - # the distribution. - # Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - # - # The word list in cjdict.txt are generated by combining three word lists - # listed below with further processing for compound word breaking. The - # frequency is generated with an iterative training against Google web - # corpora. - # - # * Libtabe (Chinese) - # - https://sourceforge.net/project/?group_id=1519 - # - Its license terms and conditions are shown below. - # - # * IPADIC (Japanese) - # - http://chasen.aist-nara.ac.jp/chasen/distribution.html - # - Its license terms and conditions are shown below. - # - # ---------COPYING.libtabe ---- BEGIN-------------------- - # - # /* - # * Copyright (c) 1999 TaBE Project. - # * Copyright (c) 1999 Pai-Hsiang Hsiao. - # * All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the TaBE Project nor the names of its - # * contributors may be used to endorse or promote products derived - # * from this software without specific prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # /* - # * Copyright (c) 1999 Computer Systems and Communication Lab, - # * Institute of Information Science, Academia - # * Sinica. All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the Computer Systems and Communication Lab - # * nor the names of its contributors may be used to endorse or - # * promote products derived from this software without specific - # * prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - # University of Illinois - # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 - # - # ---------------COPYING.libtabe-----END-------------------------------- - # - # - # ---------------COPYING.ipadic-----BEGIN------------------------------- - # - # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science - # and Technology. All Rights Reserved. - # - # Use, reproduction, and distribution of this software is permitted. - # Any copy of this software, whether in its original form or modified, - # must include both the above copyright notice and the following - # paragraphs. - # - # Nara Institute of Science and Technology (NAIST), - # the copyright holders, disclaims all warranties with regard to this - # software, including all implied warranties of merchantability and - # fitness, in no event shall NAIST be liable for - # any special, indirect or consequential damages or any damages - # whatsoever resulting from loss of use, data or profits, whether in an - # action of contract, negligence or other tortuous action, arising out - # of or in connection with the use or performance of this software. - # - # A large portion of the dictionary entries - # originate from ICOT Free Software. The following conditions for ICOT - # Free Software applies to the current dictionary as well. - # - # Each User may also freely distribute the Program, whether in its - # original form or modified, to any third party or parties, PROVIDED - # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear - # on, or be attached to, the Program, which is distributed substantially - # in the same form as set out herein and that such intended - # distribution, if actually made, will neither violate or otherwise - # contravene any of the laws and regulations of the countries having - # jurisdiction over the User or the intended distribution itself. - # - # NO WARRANTY - # - # The program was produced on an experimental basis in the course of the - # research and development conducted during the project and is provided - # to users as so produced on an experimental basis. Accordingly, the - # program is provided without any warranty whatsoever, whether express, - # implied, statutory or otherwise. The term "warranty" used herein - # includes, but is not limited to, any warranty of the quality, - # performance, merchantability and fitness for a particular purpose of - # the program and the nonexistence of any infringement or violation of - # any right of any third party. - # - # Each user of the program will agree and understand, and be deemed to - # have agreed and understood, that there is no warranty whatsoever for - # the program and, accordingly, the entire risk arising from or - # otherwise connected with the program is assumed by the user. - # - # Therefore, neither ICOT, the copyright holder, or any other - # organization that participated in or was otherwise related to the - # development of the program and their respective officials, directors, - # officers and other employees shall be held liable for any and all - # damages, including, without limitation, general, special, incidental - # and consequential damages, arising out of or otherwise in connection - # with the use or inability to use the program or any product, material - # or result produced or otherwise obtained by using the program, - # regardless of whether they have been advised of, or otherwise had - # knowledge of, the possibility of such damages at any time during the - # project or thereafter. Each user will be deemed to have agreed to the - # foregoing by his or her commencement of use of the program. The term - # "use" as used herein includes, but is not limited to, the use, - # modification, copying and distribution of the program and the - # production of secondary products from the program. - # - # In the case where the program, whether in its original form or - # modified, was distributed or delivered to or received by a user from - # any person, organization or entity other than ICOT, unless it makes or - # grants independently of ICOT any specific warranty to the user in - # writing, such person, organization or entity, will also be exempted - # from and not be held liable to the user for any such damages as noted - # above as far as the program is concerned. - # - # ---------------COPYING.ipadic-----END---------------------------------- - - ---------------------------------------------------------------------- - - Lao Word Break Dictionary Data (laodict.txt) - - # Copyright (C) 2016 and later: Unicode, Inc. and others. - # License & terms of use: http://www.unicode.org/copyright.html - # Copyright (c) 2015 International Business Machines Corporation - # and others. All Rights Reserved. - # - # Project: https://github.com/rober42539/lao-dictionary - # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt - # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt - # (copied below) - # - # This file is derived from the above dictionary version of Nov 22, 2020 - # ---------------------------------------------------------------------- - # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. Redistributions in binary - # form must reproduce the above copyright notice, this list of conditions and - # the following disclaimer in the documentation and/or other materials - # provided with the distribution. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # OF THE POSSIBILITY OF SUCH DAMAGE. - # -------------------------------------------------------------------------- - - ---------------------------------------------------------------------- - - Burmese Word Break Dictionary Data (burmesedict.txt) - - # Copyright (c) 2014 International Business Machines Corporation - # and others. All Rights Reserved. - # - # This list is part of a project hosted at: - # github.com/kanyawtech/myanmar-karen-word-lists - # - # -------------------------------------------------------------------------- - # Copyright (c) 2013, LeRoy Benjamin Sharon - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: Redistributions of source code must retain the above - # copyright notice, this list of conditions and the following - # disclaimer. Redistributions in binary form must reproduce the - # above copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided - # with the distribution. - # - # Neither the name Myanmar Karen Word Lists, nor the names of its - # contributors may be used to endorse or promote products derived - # from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS - # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - # SUCH DAMAGE. - # -------------------------------------------------------------------------- - - ---------------------------------------------------------------------- - - Time Zone Database - - ICU uses the public domain data and code derived from Time Zone - Database for its time zone support. The ownership of the TZ database - is explained in BCP 175: Procedure for Maintaining the Time Zone - Database section 7. - - # 7. Database Ownership - # - # The TZ database itself is not an IETF Contribution or an IETF - # document. Rather it is a pre-existing and regularly updated work - # that is in the public domain, and is intended to remain in the - # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do - # not apply to the TZ Database or contributions that individuals make - # to it. Should any claims be made and substantiated against the TZ - # Database, the organization that is providing the IANA - # Considerations defined in this RFC, under the memorandum of - # understanding with the IETF, currently ICANN, may act in accordance - # with all competent court orders. No ownership claims will be made - # by ICANN or the IETF Trust on the database or the code. Any person - # making a contribution to the database or code waives all rights to - # future claims in that contribution or in the TZ Database. - - ---------------------------------------------------------------------- - - Google double-conversion - - Copyright 2006-2011, the V8 project authors. All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ---------------------------------------------------------------------- - - File: aclocal.m4 (only for ICU4C) - Section: pkg.m4 - Macros to locate and utilise pkg-config. - - Copyright © 2004 Scott James Remnant . - Copyright © 2012-2015 Dan Nicholson - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. - - As a special exception to the GNU General Public License, if you - distribute this file as part of a program that contains a - configuration script generated by Autoconf, you may include it under - the same distribution terms that you use for the rest of that - program. - - (The condition for the exception is fulfilled because - ICU4C includes a configuration script generated by Autoconf, - namely the `configure` script.) - - ---------------------------------------------------------------------- - - File: config.guess (only for ICU4C) - - This file is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - As a special exception to the GNU General Public License, if you - distribute this file as part of a program that contains a - configuration script generated by Autoconf, you may include it under - the same distribution terms that you use for the rest of that - program. This Exception is an additional permission under section 7 - of the GNU General Public License, version 3 ("GPLv3"). - - (The condition for the exception is fulfilled because - ICU4C includes a configuration script generated by Autoconf, - namely the `configure` script.) - - ---------------------------------------------------------------------- - - File: install-sh (only for ICU4C) - - Copyright 1991 by the Massachusetts Institute of Technology - - Permission to use, copy, modify, distribute, and sell this software and its - documentation for any purpose is hereby granted without fee, provided that - the above copyright notice appear in all copies and that both that - copyright notice and this permission notice appear in supporting - documentation, and that the name of M.I.T. not be used in advertising or - publicity pertaining to distribution of the software without specific, - written prior permission. M.I.T. makes no representations about the - suitability of this software for any purpose. It is provided "as is" - without express or implied warranty. - """ - -- libuv, located at deps/uv, is licensed as follows: - """ - Copyright (c) 2015-present libuv project contributors. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - This license applies to parts of libuv originating from the - https://github.com/joyent/libuv repository: - - ==== - - Copyright Joyent, Inc. and other Node contributors. All rights reserved. - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - - ==== - - This license applies to all parts of libuv that are not externally - maintained libraries. - - The externally maintained libraries used by libuv are: - - - tree.h (from FreeBSD), copyright Niels Provos. Two clause BSD license. - - - inet_pton and inet_ntop implementations, contained in src/inet.c, are - copyright the Internet Systems Consortium, Inc., and licensed under the ISC - license. - """ - -- llhttp, located at deps/llhttp, is licensed as follows: - """ - This software is licensed under the MIT License. - - Copyright Fedor Indutny, 2018. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the - following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- corepack, located at deps/corepack, is licensed as follows: - """ - **Copyright © Corepack contributors** - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- undici, located at deps/undici, is licensed as follows: - """ - MIT License - - Copyright (c) Matteo Collina and Undici contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - """ - -- postject, located at test/fixtures/postject-copy, is licensed as follows: - """ - Postject is licensed for use as follows: - - """ - MIT License - - Copyright (c) 2022 Postman, Inc - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - """ - - The Postject license applies to all parts of Postject that are not externally - maintained libraries. - - The externally maintained libraries used by Postject are: - - - LIEF, located at vendor/LIEF, is licensed as follows: - """ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 - 2022 R. Thomas - Copyright 2017 - 2022 Quarkslab - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - """ - """ - -- OpenSSL, located at deps/openssl, is licensed as follows: - """ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - """ - -- Punycode.js, located at lib/punycode.js, is licensed as follows: - """ - Copyright Mathias Bynens - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- V8, located at deps/v8, is licensed as follows: - """ - This license applies to all parts of V8 that are not externally - maintained libraries. The externally maintained libraries used by V8 - are: - - - PCRE test suite, located in - test/mjsunit/third_party/regexp-pcre/regexp-pcre.js. This is based on the - test suite from PCRE-7.3, which is copyrighted by the University - of Cambridge and Google, Inc. The copyright notice and license - are embedded in regexp-pcre.js. - - - Layout tests, located in test/mjsunit/third_party/object-keys. These are - based on layout tests from webkit.org which are copyrighted by - Apple Computer, Inc. and released under a 3-clause BSD license. - - - Strongtalk assembler, the basis of the files assembler-arm-inl.h, - assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h, - assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h, - assembler-x64.cc, assembler-x64.h, assembler.cc and assembler.h. - This code is copyrighted by Sun Microsystems Inc. and released - under a 3-clause BSD license. - - - Valgrind client API header, located at src/third_party/valgrind/valgrind.h - This is released under the BSD license. - - - The Wasm C/C++ API headers, located at third_party/wasm-api/wasm.{h,hh} - This is released under the Apache license. The API's upstream prototype - implementation also formed the basis of V8's implementation in - src/wasm/c-api.cc. - - These libraries have their own licenses; we recommend you read them, - as their terms may differ from the terms below. - - Further license information can be found in LICENSE files located in - sub-directories. - - Copyright 2014, the V8 project authors. All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- SipHash, located at deps/v8/src/third_party/siphash, is licensed as follows: - """ - SipHash reference C implementation - - Copyright (c) 2016 Jean-Philippe Aumasson - - To the extent possible under law, the author(s) have dedicated all - copyright and related and neighboring rights to this software to the public - domain worldwide. This software is distributed without any warranty. - """ - -- zlib, located at deps/zlib, is licensed as follows: - """ - zlib.h -- interface of the 'zlib' general purpose compression library - version 1.3.0.1, August xxth, 2023 - - Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - """ - -- simdjson, located at deps/simdjson, is licensed as follows: - """ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018-2023 The simdjson authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - """ - -- simdutf, located at deps/simdutf, is licensed as follows: - """ - Copyright 2021 The simdutf authors - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - the Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- ada, located at deps/ada, is licensed as follows: - """ - Copyright 2023 Yagiz Nizipli and Daniel Lemire - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - the Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- minimatch, located at deps/minimatch, is licensed as follows: - """ - The ISC License - - Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR - IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - """ - -- npm, located at deps/npm, is licensed as follows: - """ - The npm application - Copyright (c) npm, Inc. and Contributors - Licensed on the terms of The Artistic License 2.0 - - Node package dependencies of the npm application - Copyright (c) their respective copyright owners - Licensed on their respective license terms - - The npm public registry at https://registry.npmjs.org - and the npm website at https://www.npmjs.com - Operated by npm, Inc. - Use governed by terms published on https://www.npmjs.com - - "Node.js" - Trademark Joyent, Inc., https://joyent.com - Neither npm nor npm, Inc. are affiliated with Joyent, Inc. - - The Node.js application - Project of Node Foundation, https://nodejs.org - - The npm Logo - Copyright (c) Mathias Pettersson and Brian Hammond - - "Gubblebum Blocky" typeface - Copyright (c) Tjarda Koster, https://jelloween.deviantart.com - Used with permission - - -------- - - The Artistic License 2.0 - - Copyright (c) 2000-2006, The Perl Foundation. - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - This license establishes the terms under which a given free software - Package may be copied, modified, distributed, and/or redistributed. - The intent is that the Copyright Holder maintains some artistic - control over the development of that Package while still keeping the - Package available as open source and free software. - - You are always permitted to make arrangements wholly outside of this - license directly with the Copyright Holder of a given Package. If the - terms of this license do not permit the full use that you propose to - make of the Package, you should contact the Copyright Holder and seek - a different licensing arrangement. - - Definitions - - "Copyright Holder" means the individual(s) or organization(s) - named in the copyright notice for the entire Package. - - "Contributor" means any party that has contributed code or other - material to the Package, in accordance with the Copyright Holder's - procedures. - - "You" and "your" means any person who would like to copy, - distribute, or modify the Package. - - "Package" means the collection of files distributed by the - Copyright Holder, and derivatives of that collection and/or of - those files. A given Package may consist of either the Standard - Version, or a Modified Version. - - "Distribute" means providing a copy of the Package or making it - accessible to anyone else, or in the case of a company or - organization, to others outside of your company or organization. - - "Distributor Fee" means any fee that you charge for Distributing - this Package or providing support for this Package to another - party. It does not mean licensing fees. - - "Standard Version" refers to the Package if it has not been - modified, or has been modified only in ways explicitly requested - by the Copyright Holder. - - "Modified Version" means the Package, if it has been changed, and - such changes were not explicitly requested by the Copyright - Holder. - - "Original License" means this Artistic License as Distributed with - the Standard Version of the Package, in its current version or as - it may be modified by The Perl Foundation in the future. - - "Source" form means the source code, documentation source, and - configuration files for the Package. - - "Compiled" form means the compiled bytecode, object code, binary, - or any other form resulting from mechanical transformation or - translation of the Source form. - - Permission for Use and Modification Without Distribution - - (1) You are permitted to use the Standard Version and create and use - Modified Versions for any purpose without restriction, provided that - you do not Distribute the Modified Version. - - Permissions for Redistribution of the Standard Version - - (2) You may Distribute verbatim copies of the Source form of the - Standard Version of this Package in any medium without restriction, - either gratis or for a Distributor Fee, provided that you duplicate - all of the original copyright notices and associated disclaimers. At - your discretion, such verbatim copies may or may not include a - Compiled form of the Package. - - (3) You may apply any bug fixes, portability changes, and other - modifications made available from the Copyright Holder. The resulting - Package will still be considered the Standard Version, and as such - will be subject to the Original License. - - Distribution of Modified Versions of the Package as Source - - (4) You may Distribute your Modified Version as Source (either gratis - or for a Distributor Fee, and with or without a Compiled form of the - Modified Version) provided that you clearly document how it differs - from the Standard Version, including, but not limited to, documenting - any non-standard features, executables, or modules, and provided that - you do at least ONE of the following: - - (a) make the Modified Version available to the Copyright Holder - of the Standard Version, under the Original License, so that the - Copyright Holder may include your modifications in the Standard - Version. - - (b) ensure that installation of your Modified Version does not - prevent the user installing or running the Standard Version. In - addition, the Modified Version must bear a name that is different - from the name of the Standard Version. - - (c) allow anyone who receives a copy of the Modified Version to - make the Source form of the Modified Version available to others - under - - (i) the Original License or - - (ii) a license that permits the licensee to freely copy, - modify and redistribute the Modified Version using the same - licensing terms that apply to the copy that the licensee - received, and requires that the Source form of the Modified - Version, and of any works derived from it, be made freely - available in that license fees are prohibited but Distributor - Fees are allowed. - - Distribution of Compiled Forms of the Standard Version - or Modified Versions without the Source - - (5) You may Distribute Compiled forms of the Standard Version without - the Source, provided that you include complete instructions on how to - get the Source of the Standard Version. Such instructions must be - valid at the time of your distribution. If these instructions, at any - time while you are carrying out such distribution, become invalid, you - must provide new instructions on demand or cease further distribution. - If you provide valid instructions or cease distribution within thirty - days after you become aware that the instructions are invalid, then - you do not forfeit any of your rights under this license. - - (6) You may Distribute a Modified Version in Compiled form without - the Source, provided that you comply with Section 4 with respect to - the Source of the Modified Version. - - Aggregating or Linking the Package - - (7) You may aggregate the Package (either the Standard Version or - Modified Version) with other packages and Distribute the resulting - aggregation provided that you do not charge a licensing fee for the - Package. Distributor Fees are permitted, and licensing fees for other - components in the aggregation are permitted. The terms of this license - apply to the use and Distribution of the Standard or Modified Versions - as included in the aggregation. - - (8) You are permitted to link Modified and Standard Versions with - other works, to embed the Package in a larger work of your own, or to - build stand-alone binary or bytecode versions of applications that - include the Package, and Distribute the result without restriction, - provided the result does not expose a direct interface to the Package. - - Items That are Not Considered Part of a Modified Version - - (9) Works (including, but not limited to, modules and scripts) that - merely extend or make use of the Package, do not, by themselves, cause - the Package to be a Modified Version. In addition, such works are not - considered parts of the Package itself, and are not subject to the - terms of this license. - - General Provisions - - (10) Any use, modification, and distribution of the Standard or - Modified Versions is governed by this Artistic License. By using, - modifying or distributing the Package, you accept this license. Do not - use, modify, or distribute the Package, if you do not accept this - license. - - (11) If your Modified Version has been derived from a Modified - Version made by someone other than you, you are nevertheless required - to ensure that your Modified Version complies with the requirements of - this license. - - (12) This license does not grant you the right to use any trademark, - service mark, tradename, or logo of the Copyright Holder. - - (13) This license includes the non-exclusive, worldwide, - free-of-charge patent license to make, have made, use, offer to sell, - sell, import and otherwise transfer the Package with respect to any - patent claims licensable by the Copyright Holder that are necessarily - infringed by the Package. If you institute patent litigation - (including a cross-claim or counterclaim) against any party alleging - that the Package constitutes direct or contributory patent - infringement, then this Artistic License to you shall terminate on the - date that such litigation is filed. - - (14) Disclaimer of Warranty: - THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS - IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR - NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL - LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL - DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -------- - """ - -- GYP, located at tools/gyp, is licensed as follows: - """ - Copyright (c) 2020 Node.js contributors. All rights reserved. - Copyright (c) 2009 Google Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- inspector_protocol, located at tools/inspector_protocol, is licensed as follows: - """ - // Copyright 2016 The Chromium Authors. All rights reserved. - // - // Redistribution and use in source and binary forms, with or without - // modification, are permitted provided that the following conditions are - // met: - // - // * Redistributions of source code must retain the above copyright - // notice, this list of conditions and the following disclaimer. - // * Redistributions in binary form must reproduce the above - // copyright notice, this list of conditions and the following disclaimer - // in the documentation and/or other materials provided with the - // distribution. - // * Neither the name of Google Inc. nor the names of its - // contributors may be used to endorse or promote products derived from - // this software without specific prior written permission. - // - // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- jinja2, located at tools/inspector_protocol/jinja2, is licensed as follows: - """ - Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details. - - Some rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- markupsafe, located at tools/inspector_protocol/markupsafe, is licensed as follows: - """ - Copyright (c) 2010 by Armin Ronacher and contributors. See AUTHORS - for more details. - - Some rights reserved. - - Redistribution and use in source and binary forms of the software as well - as documentation, with or without modification, are permitted provided - that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT - NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - """ - -- cpplint.py, located at tools/cpplint.py, is licensed as follows: - """ - Copyright (c) 2009 Google Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- gypi_to_gn.py, located at tools/gypi_to_gn.py, is licensed as follows: - """ - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google LLC nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- gtest, located at deps/googletest, is licensed as follows: - """ - Copyright 2008, Google Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- nghttp2, located at deps/nghttp2, is licensed as follows: - """ - The MIT License - - Copyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa - Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- large_pages, located at src/large_pages, is licensed as follows: - """ - Copyright (C) 2018 Intel Corporation - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom - the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES - OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE - OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- caja, located at lib/internal/freeze_intrinsics.js, is licensed as follows: - """ - Adapted from SES/Caja - Copyright (C) 2011 Google Inc. - Copyright (C) 2018 Agoric - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - """ - -- brotli, located at deps/brotli, is licensed as follows: - """ - Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - """ - -- HdrHistogram, located at deps/histogram, is licensed as follows: - """ - The code in this repository code was Written by Gil Tene, Michael Barker, - and Matt Warren, and released to the public domain, as explained at - http://creativecommons.org/publicdomain/zero/1.0/ - - For users of this code who wish to consume it under the "BSD" license - rather than under the public domain or CC0 contribution text mentioned - above, the code found under this directory is *also* provided under the - following license (commonly referred to as the BSD 2-Clause License). This - license does not detract from the above stated release of the code into - the public domain, and simply represents an additional license granted by - the Author. - - ----------------------------------------------------------------------------- - ** Beginning of "BSD 2-Clause License" text. ** - - Copyright (c) 2012, 2013, 2014 Gil Tene - Copyright (c) 2014 Michael Barker - Copyright (c) 2014 Matt Warren - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - """ - -- node-heapdump, located at src/heap_utils.cc, is licensed as follows: - """ - ISC License - - Copyright (c) 2012, Ben Noordhuis - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - === src/compat.h src/compat-inl.h === - - ISC License - - Copyright (c) 2014, StrongLoop Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - """ - -- rimraf, located at lib/internal/fs/rimraf.js, is licensed as follows: - """ - The ISC License - - Copyright (c) Isaac Z. Schlueter and Contributors - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR - IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - """ - -- uvwasi, located at deps/uvwasi, is licensed as follows: - """ - MIT License - - Copyright (c) 2019 Colin Ihrig and Contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - """ - -- ngtcp2, located at deps/ngtcp2/ngtcp2/, is licensed as follows: - """ - The MIT License - - Copyright (c) 2016 ngtcp2 contributors - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- nghttp3, located at deps/ngtcp2/nghttp3/, is licensed as follows: - """ - The MIT License - - Copyright (c) 2019 nghttp3 contributors - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- node-fs-extra, located at lib/internal/fs/cp, is licensed as follows: - """ - (The MIT License) - - Copyright (c) 2011-2017 JP Richardson - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files - (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS - OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- on-exit-leak-free, located at lib/internal/process/finalization, is licensed as follows: - """ - MIT License - - Copyright (c) 2021 Matteo Collina - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - """ diff --git a/FinlyticNews/publish/.playwright/node/win32_x64/node.exe b/FinlyticNews/publish/.playwright/node/win32_x64/node.exe deleted file mode 100644 index 542d384..0000000 Binary files a/FinlyticNews/publish/.playwright/node/win32_x64/node.exe and /dev/null differ diff --git a/FinlyticNews/publish/.playwright/package/README.md b/FinlyticNews/publish/.playwright/package/README.md deleted file mode 100644 index 422b373..0000000 --- a/FinlyticNews/publish/.playwright/package/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# playwright-core - -This package contains the no-browser flavor of [Playwright](http://github.com/microsoft/playwright). diff --git a/FinlyticNews/publish/.playwright/package/ThirdPartyNotices.txt b/FinlyticNews/publish/.playwright/package/ThirdPartyNotices.txt deleted file mode 100644 index 89a6418..0000000 --- a/FinlyticNews/publish/.playwright/package/ThirdPartyNotices.txt +++ /dev/null @@ -1,1234 +0,0 @@ -microsoft/playwright-core - -THIRD-PARTY SOFTWARE NOTICES AND INFORMATION - -This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise. - -- @types/node@17.0.24 (https://github.com/DefinitelyTyped/DefinitelyTyped) -- @types/yauzl@2.10.0 (https://github.com/DefinitelyTyped/DefinitelyTyped) -- agent-base@7.1.1 (https://github.com/TooTallNate/proxy-agents) -- balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match) -- brace-expansion@1.1.11 (https://github.com/juliangruber/brace-expansion) -- buffer-crc32@0.2.13 (https://github.com/brianloveswords/buffer-crc32) -- codemirror@5.65.18 (https://github.com/codemirror/CodeMirror) -- colors@1.4.0 (https://github.com/Marak/colors.js) -- commander@8.3.0 (https://github.com/tj/commander.js) -- concat-map@0.0.1 (https://github.com/substack/node-concat-map) -- debug@4.3.4 (https://github.com/debug-js/debug) -- define-lazy-prop@2.0.0 (https://github.com/sindresorhus/define-lazy-prop) -- diff@7.0.0 (https://github.com/kpdecker/jsdiff) -- dotenv@16.4.5 (https://github.com/motdotla/dotenv) -- end-of-stream@1.4.4 (https://github.com/mafintosh/end-of-stream) -- escape-string-regexp@2.0.0 (https://github.com/sindresorhus/escape-string-regexp) -- extract-zip@2.0.1 (https://github.com/maxogden/extract-zip) -- fd-slicer@1.1.0 (https://github.com/andrewrk/node-fd-slicer) -- get-stream@5.2.0 (https://github.com/sindresorhus/get-stream) -- graceful-fs@4.2.10 (https://github.com/isaacs/node-graceful-fs) -- https-proxy-agent@7.0.5 (https://github.com/TooTallNate/proxy-agents) -- ip-address@9.0.5 (https://github.com/beaugunderson/ip-address) -- is-docker@2.2.1 (https://github.com/sindresorhus/is-docker) -- is-wsl@2.2.0 (https://github.com/sindresorhus/is-wsl) -- jpeg-js@0.4.4 (https://github.com/eugeneware/jpeg-js) -- jsbn@1.1.0 (https://github.com/andyperlitch/jsbn) -- mime@3.0.0 (https://github.com/broofa/mime) -- minimatch@3.1.2 (https://github.com/isaacs/minimatch) -- ms@2.1.2 (https://github.com/zeit/ms) -- once@1.4.0 (https://github.com/isaacs/once) -- open@8.4.0 (https://github.com/sindresorhus/open) -- pend@1.2.0 (https://github.com/andrewrk/node-pend) -- pngjs@6.0.0 (https://github.com/lukeapage/pngjs) -- progress@2.0.3 (https://github.com/visionmedia/node-progress) -- proxy-from-env@1.1.0 (https://github.com/Rob--W/proxy-from-env) -- pump@3.0.0 (https://github.com/mafintosh/pump) -- retry@0.12.0 (https://github.com/tim-kos/node-retry) -- signal-exit@3.0.7 (https://github.com/tapjs/signal-exit) -- smart-buffer@4.2.0 (https://github.com/JoshGlazebrook/smart-buffer) -- socks-proxy-agent@8.0.4 (https://github.com/TooTallNate/proxy-agents) -- socks@2.8.3 (https://github.com/JoshGlazebrook/socks) -- sprintf-js@1.1.3 (https://github.com/alexei/sprintf.js) -- stack-utils@2.0.5 (https://github.com/tapjs/stack-utils) -- wrappy@1.0.2 (https://github.com/npm/wrappy) -- ws@8.17.1 (https://github.com/websockets/ws) -- yaml@2.6.0 (https://github.com/eemeli/yaml) -- yauzl@2.10.0 (https://github.com/thejoshwolfe/yauzl) -- yazl@2.5.1 (https://github.com/thejoshwolfe/yazl) - -%% @types/node@17.0.24 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE -========================================= -END OF @types/node@17.0.24 AND INFORMATION - -%% @types/yauzl@2.10.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE -========================================= -END OF @types/yauzl@2.10.0 AND INFORMATION - -%% agent-base@7.1.1 NOTICES AND INFORMATION BEGIN HERE -========================================= -(The MIT License) - -Copyright (c) 2013 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF agent-base@7.1.1 AND INFORMATION - -%% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE -========================================= -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -========================================= -END OF balanced-match@1.0.2 AND INFORMATION - -%% brace-expansion@1.1.11 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Copyright (c) 2013 Julian Gruber - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -========================================= -END OF brace-expansion@1.1.11 AND INFORMATION - -%% buffer-crc32@0.2.13 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License - -Copyright (c) 2013 Brian J. Brennan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the -Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF buffer-crc32@0.2.13 AND INFORMATION - -%% codemirror@5.65.18 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Copyright (C) 2017 by Marijn Haverbeke and others - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -========================================= -END OF codemirror@5.65.18 AND INFORMATION - -%% colors@1.4.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Original Library - - Copyright (c) Marak Squires - -Additional Functionality - - Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -========================================= -END OF colors@1.4.0 AND INFORMATION - -%% commander@8.3.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF commander@8.3.0 AND INFORMATION - -%% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE -========================================= -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF concat-map@0.0.1 AND INFORMATION - -%% debug@4.3.4 NOTICES AND INFORMATION BEGIN HERE -========================================= -(The MIT License) - -Copyright (c) 2014-2017 TJ Holowaychuk -Copyright (c) 2018-2021 Josh Junon - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the 'Software'), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF debug@4.3.4 AND INFORMATION - -%% define-lazy-prop@2.0.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF define-lazy-prop@2.0.0 AND INFORMATION - -%% diff@7.0.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -BSD 3-Clause License - -Copyright (c) 2009-2015, Kevin Decker -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF diff@7.0.0 AND INFORMATION - -%% dotenv@16.4.5 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) 2015, Scott Motte -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF dotenv@16.4.5 AND INFORMATION - -%% end-of-stream@1.4.4 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -========================================= -END OF end-of-stream@1.4.4 AND INFORMATION - -%% escape-string-regexp@2.0.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF escape-string-regexp@2.0.0 AND INFORMATION - -%% extract-zip@2.0.1 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) 2014 Max Ogden and other contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF extract-zip@2.0.1 AND INFORMATION - -%% fd-slicer@1.1.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) 2014 Andrew Kelley - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation files -(the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -========================================= -END OF fd-slicer@1.1.0 AND INFORMATION - -%% get-stream@5.2.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF get-stream@5.2.0 AND INFORMATION - -%% graceful-fs@4.2.10 NOTICES AND INFORMATION BEGIN HERE -========================================= -The ISC License - -Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF graceful-fs@4.2.10 AND INFORMATION - -%% https-proxy-agent@7.0.5 NOTICES AND INFORMATION BEGIN HERE -========================================= -(The MIT License) - -Copyright (c) 2013 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF https-proxy-agent@7.0.5 AND INFORMATION - -%% ip-address@9.0.5 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (C) 2011 by Beau Gunderson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -========================================= -END OF ip-address@9.0.5 AND INFORMATION - -%% is-docker@2.2.1 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF is-docker@2.2.1 AND INFORMATION - -%% is-wsl@2.2.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF is-wsl@2.2.0 AND INFORMATION - -%% jpeg-js@0.4.4 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) 2014, Eugene Ware -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Eugene Ware nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY EUGENE WARE ''AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL EUGENE WARE BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF jpeg-js@0.4.4 AND INFORMATION - -%% jsbn@1.1.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -Licensing ---------- - -This software is covered under the following copyright: - -/* - * Copyright (c) 2003-2005 Tom Wu - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF - * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * In addition, the following condition applies: - * - * All redistributions must retain an intact copy of this copyright notice - * and disclaimer. - */ - -Address all questions regarding this license to: - - Tom Wu - tjw@cs.Stanford.EDU -========================================= -END OF jsbn@1.1.0 AND INFORMATION - -%% mime@3.0.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -========================================= -END OF mime@3.0.0 AND INFORMATION - -%% minimatch@3.1.2 NOTICES AND INFORMATION BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF minimatch@3.1.2 AND INFORMATION - -%% ms@2.1.2 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -========================================= -END OF ms@2.1.2 AND INFORMATION - -%% once@1.4.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF once@1.4.0 AND INFORMATION - -%% open@8.4.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF open@8.4.0 AND INFORMATION - -%% pend@1.2.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (Expat) - -Copyright (c) 2014 Andrew Kelley - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation files -(the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -========================================= -END OF pend@1.2.0 AND INFORMATION - -%% pngjs@6.0.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -pngjs2 original work Copyright (c) 2015 Luke Page & Original Contributors -pngjs derived work Copyright (c) 2012 Kuba Niegowski - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -========================================= -END OF pngjs@6.0.0 AND INFORMATION - -%% progress@2.0.3 NOTICES AND INFORMATION BEGIN HERE -========================================= -(The MIT License) - -Copyright (c) 2017 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF progress@2.0.3 AND INFORMATION - -%% proxy-from-env@1.1.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License - -Copyright (C) 2016-2018 Rob Wu - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF proxy-from-env@1.1.0 AND INFORMATION - -%% pump@3.0.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -========================================= -END OF pump@3.0.0 AND INFORMATION - -%% retry@0.12.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) 2011: -Tim Koschützki (tim@debuggable.com) -Felix Geisendörfer (felix@debuggable.com) - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -========================================= -END OF retry@0.12.0 AND INFORMATION - -%% signal-exit@3.0.7 NOTICES AND INFORMATION BEGIN HERE -========================================= -The ISC License - -Copyright (c) 2015, Contributors - -Permission to use, copy, modify, and/or distribute this software -for any purpose with or without fee is hereby granted, provided -that the above copyright notice and this permission notice -appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE -LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF signal-exit@3.0.7 AND INFORMATION - -%% smart-buffer@4.2.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2013-2017 Josh Glazebrook - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF smart-buffer@4.2.0 AND INFORMATION - -%% socks-proxy-agent@8.0.4 NOTICES AND INFORMATION BEGIN HERE -========================================= -(The MIT License) - -Copyright (c) 2013 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF socks-proxy-agent@8.0.4 AND INFORMATION - -%% socks@2.8.3 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2013 Josh Glazebrook - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF socks@2.8.3 AND INFORMATION - -%% sprintf-js@1.1.3 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) 2007-present, Alexandru Mărășteanu -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of this software nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF sprintf-js@1.1.3 AND INFORMATION - -%% stack-utils@2.0.5 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) Isaac Z. Schlueter , James Talmage (github.com/jamestalmage), and Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -========================================= -END OF stack-utils@2.0.5 AND INFORMATION - -%% wrappy@1.0.2 NOTICES AND INFORMATION BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF wrappy@1.0.2 AND INFORMATION - -%% ws@8.17.1 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) 2011 Einar Otto Stangvik -Copyright (c) 2013 Arnout Kazemier and contributors -Copyright (c) 2016 Luigi Pinca and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF ws@8.17.1 AND INFORMATION - -%% yaml@2.6.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright Eemeli Aro - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. -========================================= -END OF yaml@2.6.0 AND INFORMATION - -%% yauzl@2.10.0 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2014 Josh Wolfe - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -========================================= -END OF yauzl@2.10.0 AND INFORMATION - -%% yazl@2.5.1 NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2014 Josh Wolfe - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -========================================= -END OF yazl@2.5.1 AND INFORMATION - -SUMMARY BEGIN HERE -========================================= -Total Packages: 48 -========================================= -END OF SUMMARY \ No newline at end of file diff --git a/FinlyticNews/publish/.playwright/package/api.json b/FinlyticNews/publish/.playwright/package/api.json deleted file mode 100644 index 7e5ca89..0000000 --- a/FinlyticNews/publish/.playwright/package/api.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"Accessibility","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)."},{"type":"text","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."},{"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."}],"langs":{"only":["csharp","js","python"],"aliases":{},"types":{},"overrides":{}},"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","langs":{"types":{"java":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"csharp":{"name":"","union":[{"name":"null"},{"name":"JsonElement"}],"expression":"[null]|[JsonElement]"}}},"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":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"role","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The [role](https://www.w3.org/TR/wai-aria/#usage_intro)."}],"required":true,"comment":"The [role](https://www.w3.org/TR/wai-aria/#usage_intro).","async":false,"alias":"role","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A human readable name for the node."}],"required":true,"comment":"A human readable name for the node.","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"float"}],"expression":"[string]|[float]"},"spec":[{"type":"text","text":"The current value of the node, if applicable."}],"required":true,"comment":"The current value of the node, if applicable.","async":false,"alias":"value","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"description","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"An additional human readable description of the node, if applicable."}],"required":true,"comment":"An additional human readable description of the node, if applicable.","async":false,"alias":"description","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"keyshortcuts","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Keyboard shortcuts associated with this node, if applicable."}],"required":true,"comment":"Keyboard shortcuts associated with this node, if applicable.","async":false,"alias":"keyshortcuts","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"roledescription","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A human readable alternative to the role, if applicable."}],"required":true,"comment":"A human readable alternative to the role, if applicable.","async":false,"alias":"roledescription","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"valuetext","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A description of the current value, if applicable."}],"required":true,"comment":"A description of the current value, if applicable.","async":false,"alias":"valuetext","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"disabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is disabled, if applicable."}],"required":true,"comment":"Whether the node is disabled, if applicable.","async":false,"alias":"disabled","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"expanded","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is expanded or collapsed, if applicable."}],"required":true,"comment":"Whether the node is expanded or collapsed, if applicable.","async":false,"alias":"expanded","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"focused","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is focused, if applicable."}],"required":true,"comment":"Whether the node is focused, if applicable.","async":false,"alias":"focused","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"modal","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable."}],"required":true,"comment":"Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable.","async":false,"alias":"modal","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"multiline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node text input supports multiline, if applicable."}],"required":true,"comment":"Whether the node text input supports multiline, if applicable.","async":false,"alias":"multiline","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"multiselectable","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether more than one child can be selected, if applicable."}],"required":true,"comment":"Whether more than one child can be selected, if applicable.","async":false,"alias":"multiselectable","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"readonly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is read only, if applicable."}],"required":true,"comment":"Whether the node is read only, if applicable.","async":false,"alias":"readonly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"required","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is required, if applicable."}],"required":true,"comment":"Whether the node is required, if applicable.","async":false,"alias":"required","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"selected","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is selected in its parent node, if applicable."}],"required":true,"comment":"Whether the node is selected in its parent node, if applicable.","async":false,"alias":"selected","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"checked","type":{"name":"","union":[{"name":"boolean"},{"name":"\"mixed\""}],"expression":"[boolean]|\"mixed\""},"spec":[{"type":"text","text":"Whether the checkbox is checked, or \"mixed\", if applicable."}],"required":true,"comment":"Whether the checkbox is checked, or \"mixed\", if applicable.","async":false,"alias":"checked","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"pressed","type":{"name":"","union":[{"name":"boolean"},{"name":"\"mixed\""}],"expression":"[boolean]|\"mixed\""},"spec":[{"type":"text","text":"Whether the toggle button is checked, or \"mixed\", if applicable."}],"required":true,"comment":"Whether the toggle button is checked, or \"mixed\", if applicable.","async":false,"alias":"pressed","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"level","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The level of a heading, if applicable."}],"required":true,"comment":"The level of a heading, if applicable.","async":false,"alias":"level","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"valuemin","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The minimum value in a node, if applicable."}],"required":true,"comment":"The minimum value in a node, if applicable.","async":false,"alias":"valuemin","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"valuemax","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The maximum value in a node, if applicable."}],"required":true,"comment":"The maximum value in a node, if applicable.","async":false,"alias":"valuemax","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"autocomplete","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"What kind of autocomplete is supported by a control, if applicable."}],"required":true,"comment":"What kind of autocomplete is supported by a control, if applicable.","async":false,"alias":"autocomplete","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"haspopup","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"What kind of popup is currently being shown for a node, if applicable."}],"required":true,"comment":"What kind of popup is currently being shown for a node, if applicable.","async":false,"alias":"haspopup","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"invalid","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Whether and in what way this node's value is invalid, if applicable."}],"required":true,"comment":"Whether and in what way this node's value is invalid, if applicable.","async":false,"alias":"invalid","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"orientation","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Whether the node is oriented horizontally or vertically, if applicable."}],"required":true,"comment":"Whether the node is oriented horizontally or vertically, if applicable.","async":false,"alias":"orientation","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"children","type":{"name":"Array","templates":[{"name":"Object"}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Child nodes, if any, if applicable."}],"required":true,"comment":"Child nodes, if any, if applicable.","async":false,"alias":"children","overloadIndex":0}]}],"expression":"[null]|[Object]"},"spec":[{"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","children":[{"type":"text","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","text":"An example of dumping the entire accessibility tree:"},{"type":"code","lines":["const snapshot = await page.accessibility.snapshot();","console.log(snapshot);"],"codeLang":"js"},{"type":"code","lines":["String snapshot = page.accessibility().snapshot();","System.out.println(snapshot);"],"codeLang":"java"},{"type":"code","lines":["snapshot = await page.accessibility.snapshot()","print(snapshot)"],"codeLang":"python async"},{"type":"code","lines":["snapshot = page.accessibility.snapshot()","print(snapshot)"],"codeLang":"python sync"},{"type":"code","lines":["var accessibilitySnapshot = await page.Accessibility.SnapshotAsync();","Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));"],"codeLang":"csharp"},{"type":"text","text":"An example of logging the focused node's name:"},{"type":"code","lines":["const snapshot = await page.accessibility.snapshot();","const node = findFocusedNode(snapshot);","console.log(node && node.name);","","function findFocusedNode(node) {"," if (node.focused)"," return node;"," for (const child of node.children || []) {"," const foundNode = findFocusedNode(child);"," if (foundNode)"," return foundNode;"," }"," return null;","}"],"codeLang":"js"},{"type":"code","lines":["var accessibilitySnapshot = await page.Accessibility.SnapshotAsync();","Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));"],"codeLang":"csharp"},{"type":"code","lines":["// FIXME","String snapshot = page.accessibility().snapshot();"],"codeLang":"java"},{"type":"code","lines":["def find_focused_node(node):"," if node.get(\"focused\"):"," return node"," for child in (node.get(\"children\") or []):"," found_node = find_focused_node(child)"," if found_node:"," return found_node"," return None","","snapshot = await page.accessibility.snapshot()","node = find_focused_node(snapshot)","if node:"," print(node[\"name\"])"],"codeLang":"python async"},{"type":"code","lines":["def find_focused_node(node):"," if node.get(\"focused\"):"," return node"," for child in (node.get(\"children\") or []):"," found_node = find_focused_node(child)"," if found_node:"," return found_node"," return None","","snapshot = page.accessibility.snapshot()","node = find_focused_node(snapshot)","if node:"," print(node[\"name\"])"],"codeLang":"python sync"}],"required":true,"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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"interestingOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Prune uninteresting nodes from the tree. Defaults to `true`."}],"required":false,"comment":"Prune uninteresting nodes from the tree. Defaults to `true`.","async":false,"alias":"interestingOnly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"root","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"The root DOM element for the snapshot. Defaults to the whole page."}],"required":false,"comment":"The root DOM element for the snapshot. Defaults to the whole page.","async":false,"alias":"root","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]}]},{"name":"Android","spec":[{"type":"text","text":"Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView."},{"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","text":"An example of the Android automation script would be:"},{"type":"code","lines":["const { _android: android } = require('playwright');","","(async () => {"," // Connect to the device."," const [device] = await android.devices();"," console.log(`Model: ${device.model()}`);"," console.log(`Serial: ${device.serial()}`);"," // Take screenshot of the whole device."," await device.screenshot({ path: 'device.png' });",""," {"," // --------------------- WebView -----------------------",""," // Launch an application with WebView."," await device.shell('am force-stop org.chromium.webview_shell');"," await device.shell('am start org.chromium.webview_shell/.WebViewBrowserActivity');"," // Get the WebView."," 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');",""," // Work with WebView's page as usual."," const page = await webview.page();"," await page.waitForNavigation({ url: /.*microsoft\\/playwright.*/ });"," console.log(await page.title());"," }",""," {"," // --------------------- Browser -----------------------",""," // Launch Chrome browser."," await device.shell('am force-stop com.android.chrome');"," const context = await device.launchBrowser();",""," // Use BrowserContext as usual."," const page = await context.newPage();"," await page.goto('https://webkit.org/');"," console.log(await page.evaluate(() => window.location.href));"," await page.screenshot({ path: 'page.png' });",""," await context.close();"," }",""," // Close the device."," await device.close();","})();"],"codeLang":"js"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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","since":"v1.9","members":[{"kind":"method","langs":{},"since":"v1.28","name":"connect","type":{"name":"AndroidDevice","expression":"[AndroidDevice]"},"spec":[{"type":"text","text":"This methods attaches Playwright to an existing Android device.↵Use [`method: Android.launchServer`] to launch a new Android server instance."}],"required":true,"comment":"This methods attaches Playwright to an existing Android device. Use [`method: Android.launchServer`] to launch a\nnew Android server instance.","async":true,"alias":"connect","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.28","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},{"kind":"property","langs":{},"since":"v1.28","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.28","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},{"kind":"property","langs":{},"since":"v1.28","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},{"kind":"property","langs":{},"since":"v1.28","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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","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.","async":true,"alias":"devices","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.22","name":"host","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":"host","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.21","name":"omitDriverInstall","type":{"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},{"kind":"property","langs":{},"since":"v1.20","name":"port","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":"port","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.28","name":"launchServer","type":{"name":"BrowserServer","expression":"[BrowserServer]"},"spec":[{"type":"text","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":"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":"launchServer","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.28","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.45","name":"host","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Host to use for the web socket. It is optional and if it is omitted, the server will accept connections on the unspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise. Consider hardening it with picking a specific interface."}],"required":false,"comment":"Host to use for the web socket. It is optional and if it is omitted, the server will accept connections on the\nunspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise. Consider\nhardening it with picking a specific interface.","async":false,"alias":"host","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.28","name":"omitDriverInstall","type":{"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},{"kind":"property","langs":{},"since":"v1.28","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},{"kind":"property","langs":{},"since":"v1.28","name":"wsPath","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Path at which to serve the Android Server. For security, this defaults to an↵unguessable string."},{"type":"note","noteType":"warning","children":[{"type":"text","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 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.\n","async":false,"alias":"wsPath","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","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}]}]},{"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":{},"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,"args":[]},{"kind":"event","langs":{},"since":"v1.9","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.","async":false,"alias":"webView","overloadIndex":0,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Disconnects from the device."}],"required":true,"comment":"Disconnects from the device.","async":true,"alias":"close","overloadIndex":0,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to drag."}],"required":true,"comment":"Selector to drag.","async":false,"alias":"selector","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"dest","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}],"expression":"[Object]"},"spec":[{"type":"text","text":"Point to drag to."}],"required":true,"comment":"Point to drag to.","async":false,"alias":"dest","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the drag in pixels per second."}],"required":false,"comment":"Optional speed of the drag in pixels per second.","async":false,"alias":"speed","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the fling in pixels per second."}],"required":false,"comment":"Optional speed of the fling in pixels per second.","async":false,"alias":"speed","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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}]},{"kind":"property","langs":{},"since":"v1.9","name":"input","type":{"name":"AndroidInput","expression":"[AndroidInput]"},"spec":[],"required":true,"comment":"","async":false,"alias":"input","overloadIndex":0,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`."}],"required":false,"comment":"Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`.","async":false,"alias":"args","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.29","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"note","noteType":"warning","children":[{"type":"text","text":"Use custom browser args at your own risk, as some of them may break Playwright functionality."}]},{"type":"text","text":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](https://peter.sh/experiments/chromium-command-line-switches/)."}],"required":false,"comment":"**NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.\n\nAdditional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](https://peter.sh/experiments/chromium-command-line-switches/).","async":false,"alias":"args","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `null` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `'null'` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"command","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional package name to launch instead of default Chrome for Android."}],"required":false,"comment":"Optional package name to launch instead of default Chrome for Android.","async":false,"alias":"command","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0}],"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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.29","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.29","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},{"kind":"property","langs":{},"since":"v1.29","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},{"kind":"property","langs":{},"since":"v1.29","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},{"kind":"property","langs":{},"since":"v1.29","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}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_content"},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_mode"},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_url_filter"},"types":{},"overrides":{}},"since":"v1.9","name":"recordHarUrlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[],"required":false,"comment":"","async":false,"alias":"recordHarUrlFilter","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}],"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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.9","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}],"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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","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},{"kind":"property","langs":{"aliases":{"java":"screenSize","csharp":"screenSize"},"types":{},"overrides":{}},"since":"v1.9","name":"screen","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","deprecated":"Use `recordVideo` instead.","name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videoSize","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","deprecated":"Use `recordVideo` instead.","name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videosPath","overloadIndex":0},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize"},"types":{},"overrides":{}},"since":"v1.9","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}]}],"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","children":[{"type":"text","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.\n","async":false,"alias":"viewport","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"viewportSize"},"types":{},"overrides":{}},"since":"v1.9","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}]}],"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","children":[{"type":"text","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.\n","async":false,"alias":"viewport","overloadIndex":0},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}]}],"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","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`.","async":true,"alias":"longTap","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","name":"model","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Device model."}],"required":true,"comment":"Device model.","async":false,"alias":"model","overloadIndex":0,"args":[]},{"kind":"method","langs":{},"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":"open","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"command","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Shell command to execute."}],"required":true,"comment":"Shell command to execute.","async":false,"alias":"command","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","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.","async":true,"alias":"pinchClose","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the pinch in pixels per second."}],"required":false,"comment":"Optional speed of the pinch in pixels per second.","async":false,"alias":"speed","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","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.","async":true,"alias":"pinchOpen","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to pinch open."}],"required":true,"comment":"Selector to pinch open.","async":false,"alias":"selector","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the pinch in pixels per second."}],"required":false,"comment":"Optional speed of the pinch in pixels per second.","async":false,"alias":"speed","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","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.","async":false,"alias":"selector","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"key","type":{"name":"AndroidKey","expression":"[AndroidKey]"},"spec":[{"type":"text","text":"The key to press."}],"required":true,"comment":"The key to press.","async":false,"alias":"key","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","name":"push","type":{"name":"void"},"spec":[{"type":"text","text":"Copies a file to the device."}],"required":true,"comment":"Copies a file to the device.","async":true,"alias":"push","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"file","type":{"name":"","union":[{"name":"string"},{"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.","async":false,"alias":"file","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","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.","async":true,"alias":"screenshot","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"path","type":{"name":"path","expression":"[path]"},"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."}],"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":"path","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to scroll."}],"required":true,"comment":"Selector to scroll.","async":false,"alias":"selector","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"direction","type":{"name":"AndroidScrollDirection","union":[{"name":"\"down\""},{"name":"\"up\""},{"name":"\"left\""},{"name":"\"right\""}],"expression":"[AndroidScrollDirection]<\"down\"|\"up\"|\"left\"|\"right\">"},"spec":[{"type":"text","text":"Scroll direction."}],"required":true,"comment":"Scroll direction.","async":false,"alias":"direction","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","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.","async":false,"alias":"percent","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the scroll in pixels per second."}],"required":false,"comment":"Optional speed of the scroll in pixels per second.","async":false,"alias":"speed","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","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}]},{"kind":"method","langs":{},"since":"v1.9","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.","async":true,"alias":"shell","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"command","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Shell command to execute."}],"required":true,"comment":"Shell command to execute.","async":false,"alias":"command","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","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`.","async":true,"alias":"swipe","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","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`.","async":true,"alias":"tap","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","name":"wait","type":{"name":"void"},"spec":[{"type":"text","text":"Waits for the specific `selector` to either appear or disappear, depending on the `state`."}],"required":true,"comment":"Waits for the specific `selector` to either appear or disappear, depending on the `state`.","async":true,"alias":"wait","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to wait for."}],"required":true,"comment":"Selector to wait for.","async":false,"alias":"selector","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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."}],"required":true,"comment":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue.","async":true,"alias":"waitForEvent","overloadIndex":0,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.9","name":"optionsOrPredicate","type":{"name":"","union":[{"name":"function"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"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: 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}]}],"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}]},{"kind":"method","langs":{},"since":"v1.9","name":"webView","type":{"name":"AndroidWebView","expression":"[AndroidWebView]"},"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."}],"required":true,"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,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"since":"v1.9","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}],"expression":"[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"selector","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.9","name":"webViews","type":{"name":"Array","templates":[{"name":"AndroidWebView"}],"expression":"[Array]<[AndroidWebView]>"},"spec":[{"type":"text","text":"Currently open WebViews."}],"required":true,"comment":"Currently open WebViews.","async":false,"alias":"webViews","overloadIndex":0,"args":[]}]},{"name":"AndroidInput","spec":[],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","members":[{"kind":"method","langs":{},"since":"v1.9","name":"drag","type":{"name":"void"},"spec":[{"type":"text","text":"Performs a drag between `from` and `to` points."}],"required":true,"comment":"Performs a drag between `from` and `to` points.","async":true,"alias":"drag","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"from","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}],"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},{"kind":"property","langs":{},"since":"v1.9","name":"to","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}],"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"from","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}],"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},{"kind":"property","langs":{},"since":"v1.9","name":"segments","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}]}],"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"point","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.9","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}],"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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}]}]},{"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":{},"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,"args":[]},{"kind":"event","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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}]}]},{"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":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"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":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"baseURL","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","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":"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":"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":"baseURL","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"clientCertificates","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"1.46","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port."}],"required":true,"comment":"Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port.","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"certPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the file with the certificate in PEM format."}],"required":false,"comment":"Path to the file with the certificate in PEM format.","async":false,"alias":"certPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"cert","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the certificate in PEM format."}],"required":false,"comment":"Direct value of the certificate in PEM format.","async":false,"alias":"cert","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"keyPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the file with the private key in PEM format."}],"required":false,"comment":"Path to the file with the private key in PEM format.","async":false,"alias":"keyPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"key","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the private key in PEM format."}],"required":false,"comment":"Direct value of the private key in PEM format.","async":false,"alias":"key","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"pfxPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the PFX or PKCS12 encoded private key and certificate chain."}],"required":false,"comment":"Path to the PFX or PKCS12 encoded private key and certificate chain.","async":false,"alias":"pfxPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"pfx","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the PFX or PKCS12 encoded private key and certificate chain."}],"required":false,"comment":"Direct value of the PFX or PKCS12 encoded private key and certificate chain.","async":false,"alias":"pfx","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"passphrase","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Passphrase for the private key (PEM or PFX)."}],"required":false,"comment":"Passphrase for the private key (PEM or PFX).","async":false,"alias":"passphrase","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"TLS Client Authentication allows the server to request a client certificate and verify it."},{"type":"text","text":"**Details**"},{"type":"text","text":"An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for."},{"type":"note","noteType":"note","children":[{"type":"text","text":"When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`."}]}],"required":false,"comment":"TLS Client Authentication allows the server to request a client certificate and verify it.\n\n**Details**\n\nAn array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,\na single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,\n`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided\nwith an exact match to the request origin that the certificate is valid for.\n\n**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it\nwork by replacing `localhost` with `local.playwright`.\n","async":false,"alias":"clientCertificates","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","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},{"kind":"property","langs":{},"since":"v1.16","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","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},{"kind":"property","langs":{},"since":"v1.16","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.16","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","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},{"kind":"property","langs":{},"since":"v1.16","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},{"kind":"property","langs":{},"since":"v1.16","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},{"kind":"property","langs":{},"since":"v1.16","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}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"storageState","type":{"name":"","union":[{"name":"path"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"domain","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"path","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","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},{"kind":"property","langs":{},"since":"v1.16","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","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}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"cookies","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origins","overloadIndex":0}]}],"expression":"[path]|[Object]"},"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`] 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\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","overloadIndex":0},{"kind":"property","langs":{"only":["java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","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`] 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\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","overloadIndex":0},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","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},{"kind":"property","langs":{},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the response. Defaults to↵`30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Maximum time in milliseconds to wait for the response. Defaults to `30000` (30 seconds). Pass `0` to disable\ntimeout.","async":false,"alias":"timeout","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]}]},{"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":{}},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"form","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"FormData"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[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."}],"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.46","name":"maxRetries","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries."}],"required":false,"comment":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not\nretry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.","async":false,"alias":"maxRetries","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.17","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.17","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.17","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.17","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.17","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.17","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}]}],"expression":"[FormData]|[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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.17","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.17","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.17","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.17","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.17","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.17","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}],"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 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 as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","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 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 as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"URLSearchParams"},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[URLSearchParams]|[string]"},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[string]"},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"paramsString","type":{"name":"string","expression":"[string]"},"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":"paramsString","overloadIndex":0},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{},"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 its resources, calling any method on disposed `APIRequestContext` will throw an exception."}],"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 its resources, calling any method on\ndisposed `APIRequestContext` will throw an exception.","async":true,"alias":"dispose","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.45","name":"reason","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The reason to be reported to the operations interrupted by the context disposal."}],"required":false,"comment":"The reason to be reported to the operations interrupted by the context disposal.","async":false,"alias":"reason","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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."},{"type":"text","text":"**Usage**"},{"type":"text","text":"JSON objects can be passed directly to the request:"},{"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 upload them as form fields with `multipart/form-data` encoding, by specifiying the `multipart` parameter:"},{"type":"code","lines":["const form = new FormData();","form.set('name', 'John');","form.append('name', 'Doe');","// Send two file fields with the same name.","form.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' }));","form.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));","await request.fetch('https://example.com/api/uploadForm', {"," multipart: form","});"],"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/uploadScript\","," RequestOptions.create().setMethod(\"post\").setMultipart("," FormData.create().set(\"fileField\", filePayload)));"],"codeLang":"java"},{"type":"code","lines":["api_request_context.fetch("," \"https://example.com/api/uploadScript\", 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.\n\n**Usage**\n\nJSON objects can be passed directly to the request:\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 upload them as form fields with `multipart/form-data`\nencoding, by specifiying the `multipart` parameter:\n\n```js\nconst form = new FormData();\nform.set('name', 'John');\nform.append('name', 'Doe');\n// Send two file fields with the same name.\nform.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' }));\nform.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));\nawait request.fetch('https://example.com/api/uploadForm', {\n multipart: form\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/uploadScript\",\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/uploadScript\", 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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"FormData"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[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."}],"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.46","name":"maxRetries","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries."}],"required":false,"comment":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not\nretry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.","async":false,"alias":"maxRetries","overloadIndex":0},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}]}],"expression":"[FormData]|[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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}],"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 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 as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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 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 as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"URLSearchParams"},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[URLSearchParams]|[string]"},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[string]"},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"paramsString","type":{"name":"string","expression":"[string]"},"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":"paramsString","overloadIndex":0},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{},"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":["// Passing params as object","await request.get('https://example.com/api/getText', {"," params: {"," 'isbn': '1234',"," 'page': 23,"," }","});","","// Passing params as URLSearchParams","const searchParams = new URLSearchParams();","searchParams.set('isbn', '1234');","searchParams.append('page', 23);","searchParams.append('page', 24);","await request.get('https://example.com/api/getText', { params: searchParams });","","// Passing params as string","const queryString = 'isbn=1234&page=23&page=24';","await request.get('https://example.com/api/getText', { params: queryString });"],"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\n// Passing params as object\nawait request.get('https://example.com/api/getText', {\n params: {\n 'isbn': '1234',\n 'page': 23,\n }\n});\n\n// Passing params as URLSearchParams\nconst searchParams = new URLSearchParams();\nsearchParams.set('isbn', '1234');\nsearchParams.append('page', 23);\nsearchParams.append('page', 24);\nawait request.get('https://example.com/api/getText', { params: searchParams });\n\n// Passing params as string\nconst queryString = 'isbn=1234&page=23&page=24';\nawait request.get('https://example.com/api/getText', { params: queryString });\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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"form","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"FormData"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[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."}],"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.46","name":"maxRetries","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries."}],"required":false,"comment":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not\nretry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.","async":false,"alias":"maxRetries","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}]}],"expression":"[FormData]|[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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}],"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 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 as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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 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 as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"URLSearchParams"},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[URLSearchParams]|[string]"},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[string]"},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"paramsString","type":{"name":"string","expression":"[string]"},"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":"paramsString","overloadIndex":0},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{},"since":"v1.16","name":"head","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","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":"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":"head","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"form","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"FormData"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[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."}],"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.46","name":"maxRetries","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries."}],"required":false,"comment":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not\nretry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.","async":false,"alias":"maxRetries","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}]}],"expression":"[FormData]|[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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.26","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}],"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 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 as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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 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 as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"URLSearchParams"},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[URLSearchParams]|[string]"},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[string]"},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"paramsString","type":{"name":"string","expression":"[string]"},"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":"paramsString","overloadIndex":0},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"FormData"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[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."}],"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.46","name":"maxRetries","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries."}],"required":false,"comment":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not\nretry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.","async":false,"alias":"maxRetries","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}]}],"expression":"[FormData]|[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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}],"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 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 as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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 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 as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"URLSearchParams"},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[URLSearchParams]|[string]"},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[string]"},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"paramsString","type":{"name":"string","expression":"[string]"},"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":"paramsString","overloadIndex":0},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{},"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() {"," { \"firstName\", \"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. Use `FormData` to construct request body and pass it to the request as `multipart` parameter:"},{"type":"code","lines":["const form = new FormData();","form.set('name', 'John');","form.append('name', 'Doe');","// Send two file fields with the same name.","form.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' }));","form.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));","await request.post('https://example.com/api/uploadForm', {"," multipart: form","});"],"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 filePayload1 = new FilePayload(\"f1.js\", \"text/javascript\","," \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));","APIResponse response = request.post(\"https://example.com/api/uploadScript\","," RequestOptions.create().setMultipart("," FormData.create().set(\"fileField\", filePayload)));"],"codeLang":"java"},{"type":"code","lines":["api_request_context.post("," \"https://example.com/api/uploadScript'\","," 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 { \"firstName\", \"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. Use `FormData` to construct request body and pass it to the request as `multipart` parameter:\n\n```js\nconst form = new FormData();\nform.set('name', 'John');\nform.append('name', 'Doe');\n// Send two file fields with the same name.\nform.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' }));\nform.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));\nawait request.post('https://example.com/api/uploadForm', {\n multipart: form\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 filePayload1 = new FilePayload(\"f1.js\", \"text/javascript\",\n \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));\nAPIResponse response = request.post(\"https://example.com/api/uploadScript\",\n RequestOptions.create().setMultipart(\n FormData.create().set(\"fileField\", filePayload)));\n```\n\n```python\napi_request_context.post(\n \"https://example.com/api/uploadScript'\",\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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"FormData"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[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."}],"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.46","name":"maxRetries","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries."}],"required":false,"comment":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not\nretry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.","async":false,"alias":"maxRetries","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}]}],"expression":"[FormData]|[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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}],"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 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 as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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 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 as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"URLSearchParams"},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[URLSearchParams]|[string]"},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[string]"},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"paramsString","type":{"name":"string","expression":"[string]"},"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":"paramsString","overloadIndex":0},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"FormData"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[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."}],"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.46","name":"maxRetries","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries."}],"required":false,"comment":"Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not\nretry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.","async":false,"alias":"maxRetries","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}]}],"expression":"[FormData]|[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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0}]}]}],"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 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 as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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 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 as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"URLSearchParams"},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[URLSearchParams]|[string]"},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"","union":[{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}]},{"name":"string"}],"expression":"[Object]<[string], [string]|[float]|[boolean]>|[string]"},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"paramsString","type":{"name":"string","expression":"[string]"},"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":"paramsString","overloadIndex":0},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{"types":{"java":{"name":"string","expression":"[string]"},"csharp":{"name":"string","expression":"[string]"}}},"since":"v1.16","name":"storageState","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"domain","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"path","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","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},{"kind":"property","langs":{},"since":"v1.16","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","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}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"cookies","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.16","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origins","overloadIndex":0}],"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,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]}]},{"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":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"headersArray","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","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},{"kind":"property","langs":{},"since":"v1.16","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}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"An array with all the response 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 response HTTP headers associated with this response. Header names are not lower-cased.\nHeaders with multiple entries, such as `Set-Cookie`, appear in the array multiple times.","async":false,"alias":"headersArray","overloadIndex":0,"args":[]},{"kind":"method","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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,"args":[]},{"kind":"method","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"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":{}},"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,"args":[]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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,"args":[]},{"kind":"method","langs":{"aliases":{"java":"isOK"},"types":{},"overrides":{}},"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,"args":[]}]},{"name":"Browser","spec":[{"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"}],"langs":{},"comment":"A 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":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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","children":[{"type":"text","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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.40","name":"reason","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The reason to be reported to the operations interrupted by the browser closure."}],"required":false,"comment":"The reason to be reported to the operations interrupted by the browser closure.","async":false,"alias":"reason","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"since":"v1.11","name":"newBrowserCDPSession","type":{"name":"CDPSession","expression":"[CDPSession]"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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,"args":[]},{"kind":"method","langs":{},"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","children":[{"type":"text","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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"1.46","name":"clientCertificates","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"1.46","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port."}],"required":true,"comment":"Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port.","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"certPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the file with the certificate in PEM format."}],"required":false,"comment":"Path to the file with the certificate in PEM format.","async":false,"alias":"certPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"cert","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the certificate in PEM format."}],"required":false,"comment":"Direct value of the certificate in PEM format.","async":false,"alias":"cert","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"keyPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the file with the private key in PEM format."}],"required":false,"comment":"Path to the file with the private key in PEM format.","async":false,"alias":"keyPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"key","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the private key in PEM format."}],"required":false,"comment":"Direct value of the private key in PEM format.","async":false,"alias":"key","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"pfxPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the PFX or PKCS12 encoded private key and certificate chain."}],"required":false,"comment":"Path to the PFX or PKCS12 encoded private key and certificate chain.","async":false,"alias":"pfxPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"pfx","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the PFX or PKCS12 encoded private key and certificate chain."}],"required":false,"comment":"Direct value of the PFX or PKCS12 encoded private key and certificate chain.","async":false,"alias":"pfx","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"passphrase","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Passphrase for the private key (PEM or PFX)."}],"required":false,"comment":"Passphrase for the private key (PEM or PFX).","async":false,"alias":"passphrase","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"TLS Client Authentication allows the server to request a client certificate and verify it."},{"type":"text","text":"**Details**"},{"type":"text","text":"An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for."},{"type":"note","noteType":"note","children":[{"type":"text","text":"When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`."}]}],"required":false,"comment":"TLS Client Authentication allows the server to request a client certificate and verify it.\n\n**Details**\n\nAn array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,\na single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,\n`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided\nwith an exact match to the request origin that the certificate is valid for.\n\n**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it\nwork by replacing `localhost` with `local.playwright`.\n","async":false,"alias":"clientCertificates","overloadIndex":0},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `null` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `'null'` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.8","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings to use with this context. Defaults to none."}],"required":false,"comment":"Network proxy settings to use with this context. Defaults to none.","async":false,"alias":"proxy","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_content"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_mode"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_url_filter"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"aliases":{"java":"screenSize","csharp":"screenSize"},"types":{},"overrides":{}},"since":"v1.8","name":"screen","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"storageState","type":{"name":"","union":[{"name":"path"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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},{"kind":"property","langs":{},"since":"v1.8","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0}]}],"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}]}],"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videoSize","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videosPath","overloadIndex":0},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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","children":[{"type":"text","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.\n","async":false,"alias":"viewport","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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","children":[{"type":"text","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.\n","async":false,"alias":"viewport","overloadIndex":0},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"1.46","name":"clientCertificates","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"1.46","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port."}],"required":true,"comment":"Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port.","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"certPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the file with the certificate in PEM format."}],"required":false,"comment":"Path to the file with the certificate in PEM format.","async":false,"alias":"certPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"cert","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the certificate in PEM format."}],"required":false,"comment":"Direct value of the certificate in PEM format.","async":false,"alias":"cert","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"keyPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the file with the private key in PEM format."}],"required":false,"comment":"Path to the file with the private key in PEM format.","async":false,"alias":"keyPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"key","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the private key in PEM format."}],"required":false,"comment":"Direct value of the private key in PEM format.","async":false,"alias":"key","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"pfxPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the PFX or PKCS12 encoded private key and certificate chain."}],"required":false,"comment":"Path to the PFX or PKCS12 encoded private key and certificate chain.","async":false,"alias":"pfxPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"pfx","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the PFX or PKCS12 encoded private key and certificate chain."}],"required":false,"comment":"Direct value of the PFX or PKCS12 encoded private key and certificate chain.","async":false,"alias":"pfx","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"passphrase","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Passphrase for the private key (PEM or PFX)."}],"required":false,"comment":"Passphrase for the private key (PEM or PFX).","async":false,"alias":"passphrase","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"TLS Client Authentication allows the server to request a client certificate and verify it."},{"type":"text","text":"**Details**"},{"type":"text","text":"An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for."},{"type":"note","noteType":"note","children":[{"type":"text","text":"When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`."}]}],"required":false,"comment":"TLS Client Authentication allows the server to request a client certificate and verify it.\n\n**Details**\n\nAn array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,\na single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,\n`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided\nwith an exact match to the request origin that the certificate is valid for.\n\n**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it\nwork by replacing `localhost` with `local.playwright`.\n","async":false,"alias":"clientCertificates","overloadIndex":0},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `null` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `'null'` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.8","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings to use with this context. Defaults to none."}],"required":false,"comment":"Network proxy settings to use with this context. Defaults to none.","async":false,"alias":"proxy","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_content"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_mode"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_url_filter"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"aliases":{"java":"screenSize","csharp":"screenSize"},"types":{},"overrides":{}},"since":"v1.8","name":"screen","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"storageState","type":{"name":"","union":[{"name":"path"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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},{"kind":"property","langs":{},"since":"v1.8","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0}]}],"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}]}],"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videoSize","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videosPath","overloadIndex":0},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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","children":[{"type":"text","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.\n","async":false,"alias":"viewport","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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","children":[{"type":"text","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.\n","async":false,"alias":"viewport","overloadIndex":0},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"removeAllListeners","type":{"name":"void"},"spec":[{"type":"text","text":"Removes all the listeners of the given type (or all registered listeners if no type given).↵Allows to wait for async listeners to complete or to ignore subsequent errors from these listeners."}],"required":true,"comment":"Removes all the listeners of the given type (or all registered listeners if no type given). Allows to wait for\nasync listeners to complete or to ignore subsequent errors from these listeners.","async":true,"alias":"removeAllListeners","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.47","name":"type","type":{"name":"string","expression":"[string]"},"spec":[],"required":false,"comment":"","async":false,"alias":"type","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.47","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"behavior","type":{"name":"RemoveAllListenersBehavior","union":[{"name":"\"wait\""},{"name":"\"ignoreErrors\""},{"name":"\"default\""}],"expression":"[RemoveAllListenersBehavior]<\"wait\"|\"ignoreErrors\"|\"default\">"},"spec":[{"type":"text","text":"Specifies whether to wait for already running listeners and what to do if they throw errors:"},{"type":"li","text":"`'default'` - do not wait for current listener calls (if any) to finish, if the listener throws, it may result in unhandled error","liType":"bullet"},{"type":"li","text":"`'wait'` - wait for current listener calls (if any) to finish","liType":"bullet"},{"type":"li","text":"`'ignoreErrors'` - do not wait for current listener calls (if any) to finish, all errors thrown by the listeners after removal are silently caught","liType":"bullet"}],"required":false,"comment":"Specifies whether to wait for already running listeners and what to do if they throw errors:\n- `'default'` - do not wait for current listener calls (if any) to finish, if the listener throws, it may result\n in unhandled error\n- `'wait'` - wait for current listener calls (if any) to finish\n- `'ignoreErrors'` - do not wait for current listener calls (if any) to finish, all errors thrown by the\n listeners after removal are silently caught","async":false,"alias":"behavior","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{"only":["java","js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"startTracing","type":{"name":"void"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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.navigate(\"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.navigate(\"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.11","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{"only":["java","js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"stopTracing","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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,"args":[]},{"kind":"method","langs":{},"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,"args":[]}]},{"name":"BrowserContext","spec":[{"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 isolated non-persistent browser contexts with [`method: Browser.newContext`] method. Non-persistent 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"}],"langs":{},"comment":"BrowserContexts 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 isolated non-persistent browser contexts with [`method: Browser.newContext`] method.\nNon-persistent browser 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":{},"since":"v1.11","name":"backgroundPage","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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":["context.onBackgroundPage(backgroundPage -> {"," System.out.println(backgroundPage.url());","});"],"codeLang":"java"},{"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"},{"type":"code","lines":["context.BackgroundPage += (_, backgroundPage) =>","{"," Console.WriteLine(backgroundPage.Url);","};",""],"codeLang":"csharp"}],"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```java\ncontext.onBackgroundPage(backgroundPage -> {\n System.out.println(backgroundPage.url());\n});\n```\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\n```csharp\ncontext.BackgroundPage += (_, backgroundPage) =>\n{\n Console.WriteLine(backgroundPage.Url);\n};\n\n```\n","async":false,"alias":"backgroundPage","overloadIndex":0,"args":[]},{"kind":"property","langs":{},"since":"v1.45","name":"clock","type":{"name":"Clock","expression":"[Clock]"},"spec":[{"type":"text","text":"Playwright has ability to mock clock and passage of time."}],"required":true,"comment":"Playwright has ability to mock clock and passage of time.","async":false,"alias":"clock","overloadIndex":0,"args":[]},{"kind":"event","langs":{},"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,"args":[]},{"kind":"event","langs":{"aliases":{"java":"consoleMessage"},"types":{},"overrides":{}},"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`."},{"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`.\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,"args":[]},{"kind":"event","langs":{},"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 += async (_, dialog) =>","{"," await dialog.AcceptAsync();","};"],"codeLang":"csharp"},{"type":"note","noteType":"note","children":[{"type":"text","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 += async (_, dialog) =>\n{\n await dialog.AcceptAsync();\n};\n```\n\n**NOTE** When no [`event: Page.dialog`] or [`event: BrowserContext.dialog`] listeners are present, all dialogs are\nautomatically dismissed.\n","async":false,"alias":"dialog","overloadIndex":0,"args":[]},{"kind":"event","langs":{},"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. If you would like to route/listen to this network request, use [`method: BrowserContext.route`] and [`event: BrowserContext.request`] respectively instead of similar methods on the `Page`."},{"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","children":[{"type":"text","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. If you would like to route/listen\nto this network request, use [`method: BrowserContext.route`] and [`event: BrowserContext.request`] respectively\ninstead of similar methods on the `Page`.\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).\n","async":false,"alias":"page","overloadIndex":0,"args":[]},{"kind":"event","langs":{},"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,"args":[]},{"kind":"event","langs":{},"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,"args":[]},{"kind":"event","langs":{},"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","children":[{"type":"text","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`].\n","async":false,"alias":"requestFailed","overloadIndex":0,"args":[]},{"kind":"event","langs":{},"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,"args":[]},{"kind":"event","langs":{},"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,"args":[]},{"kind":"event","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"serviceWorker","type":{"name":"Worker","expression":"[Worker]"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\". Either url or domain / path are required. Optional."}],"required":false,"comment":"For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\". Either url\nor domain / path are required. Optional.","async":false,"alias":"domain","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional."}],"required":false,"comment":"Optional.","async":false,"alias":"httpOnly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional."}],"required":false,"comment":"Optional.","async":false,"alias":"secure","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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}]}],"expression":"[Array]<[Object]>"},"spec":[],"required":true,"comment":"","async":false,"alias":"cookies","overloadIndex":0}]},{"kind":"method","langs":{},"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","children":[{"type":"text","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.\n","async":true,"alias":"addInitScript","overloadIndex":0,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"","union":[{"name":"function"},{"name":"string"},{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{},"since":"v1.11","name":"backgroundPages","type":{"name":"Array","templates":[{"name":"Page"}],"expression":"[Array]<[Page]>"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"clearCookies","type":{"name":"void"},"spec":[{"type":"text","text":"Removes cookies from context. Accepts optional filter."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await context.clearCookies();","await context.clearCookies({ name: 'session-id' });","await context.clearCookies({ domain: 'my-origin.com' });","await context.clearCookies({ domain: /.*my-origin\\.com/ });","await context.clearCookies({ path: '/api/v1' });","await context.clearCookies({ name: 'session-id', domain: 'my-origin.com' });"],"codeLang":"js"},{"type":"code","lines":["context.clearCookies();","context.clearCookies(new BrowserContext.ClearCookiesOptions().setName(\"session-id\"));","context.clearCookies(new BrowserContext.ClearCookiesOptions().setDomain(\"my-origin.com\"));","context.clearCookies(new BrowserContext.ClearCookiesOptions().setPath(\"/api/v1\"));","context.clearCookies(new BrowserContext.ClearCookiesOptions()"," .setName(\"session-id\")"," .setDomain(\"my-origin.com\"));"],"codeLang":"java"},{"type":"code","lines":["await context.clear_cookies()","await context.clear_cookies(name=\"session-id\")","await context.clear_cookies(domain=\"my-origin.com\")","await context.clear_cookies(path=\"/api/v1\")","await context.clear_cookies(name=\"session-id\", domain=\"my-origin.com\")"],"codeLang":"python async"},{"type":"code","lines":["context.clear_cookies()","context.clear_cookies(name=\"session-id\")","context.clear_cookies(domain=\"my-origin.com\")","context.clear_cookies(path=\"/api/v1\")","context.clear_cookies(name=\"session-id\", domain=\"my-origin.com\")"],"codeLang":"python sync"},{"type":"code","lines":["await context.ClearCookiesAsync();","await context.ClearCookiesAsync(new() { Name = \"session-id\" });","await context.ClearCookiesAsync(new() { Domain = \"my-origin.com\" });","await context.ClearCookiesAsync(new() { Path = \"/api/v1\" });","await context.ClearCookiesAsync(new() { Name = \"session-id\", Domain = \"my-origin.com\" });"],"codeLang":"csharp"}],"required":true,"comment":"Removes cookies from context. Accepts optional filter.\n\n**Usage**\n\n```js\nawait context.clearCookies();\nawait context.clearCookies({ name: 'session-id' });\nawait context.clearCookies({ domain: 'my-origin.com' });\nawait context.clearCookies({ domain: /.*my-origin\\.com/ });\nawait context.clearCookies({ path: '/api/v1' });\nawait context.clearCookies({ name: 'session-id', domain: 'my-origin.com' });\n```\n\n```java\ncontext.clearCookies();\ncontext.clearCookies(new BrowserContext.ClearCookiesOptions().setName(\"session-id\"));\ncontext.clearCookies(new BrowserContext.ClearCookiesOptions().setDomain(\"my-origin.com\"));\ncontext.clearCookies(new BrowserContext.ClearCookiesOptions().setPath(\"/api/v1\"));\ncontext.clearCookies(new BrowserContext.ClearCookiesOptions()\n .setName(\"session-id\")\n .setDomain(\"my-origin.com\"));\n```\n\n```py\nawait context.clear_cookies()\nawait context.clear_cookies(name=\"session-id\")\nawait context.clear_cookies(domain=\"my-origin.com\")\nawait context.clear_cookies(path=\"/api/v1\")\nawait context.clear_cookies(name=\"session-id\", domain=\"my-origin.com\")\n```\n\n```py\ncontext.clear_cookies()\ncontext.clear_cookies(name=\"session-id\")\ncontext.clear_cookies(domain=\"my-origin.com\")\ncontext.clear_cookies(path=\"/api/v1\")\ncontext.clear_cookies(name=\"session-id\", domain=\"my-origin.com\")\n```\n\n```csharp\nawait context.ClearCookiesAsync();\nawait context.ClearCookiesAsync(new() { Name = \"session-id\" });\nawait context.ClearCookiesAsync(new() { Domain = \"my-origin.com\" });\nawait context.ClearCookiesAsync(new() { Path = \"/api/v1\" });\nawait context.ClearCookiesAsync(new() { Name = \"session-id\", Domain = \"my-origin.com\" });\n```\n","async":true,"alias":"clearCookies","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.43","name":"domain","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Only removes cookies with the given domain."}],"required":false,"comment":"Only removes cookies with the given domain.","async":false,"alias":"domain","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.43","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Only removes cookies with the given name."}],"required":false,"comment":"Only removes cookies with the given name.","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.43","name":"path","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Only removes cookies with the given path."}],"required":false,"comment":"Only removes cookies with the given path.","async":false,"alias":"path","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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","children":[{"type":"text","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.\n","async":true,"alias":"close","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.40","name":"reason","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The reason to be reported to the operations interrupted by the context closure."}],"required":false,"comment":"The reason to be reported to the operations interrupted by the context closure.","async":false,"alias":"reason","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.8","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"domain","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"path","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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"}],"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","async":true,"alias":"exposeBinding","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option will be removed in the future.","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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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));"," BrowserContext context = browser.newContext();"," 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 BrowserContext context = browser.newContext();\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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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":"`'accelerometer'`","liType":"bullet"},{"type":"li","text":"`'accessibility-events'`","liType":"bullet"},{"type":"li","text":"`'ambient-light-sensor'`","liType":"bullet"},{"type":"li","text":"`'background-sync'`","liType":"bullet"},{"type":"li","text":"`'camera'`","liType":"bullet"},{"type":"li","text":"`'clipboard-read'`","liType":"bullet"},{"type":"li","text":"`'clipboard-write'`","liType":"bullet"},{"type":"li","text":"`'geolocation'`","liType":"bullet"},{"type":"li","text":"`'gyroscope'`","liType":"bullet"},{"type":"li","text":"`'magnetometer'`","liType":"bullet"},{"type":"li","text":"`'microphone'`","liType":"bullet"},{"type":"li","text":"`'midi-sysex'` (system-exclusive midi)","liType":"bullet"},{"type":"li","text":"`'midi'`","liType":"bullet"},{"type":"li","text":"`'notifications'`","liType":"bullet"},{"type":"li","text":"`'payment-handler'`","liType":"bullet"},{"type":"li","text":"`'storage-access'`","liType":"bullet"}],"required":true,"comment":"A permission or an array of permissions to grant. Permissions can be one of the following values:\n- `'accelerometer'`\n- `'accessibility-events'`\n- `'ambient-light-sensor'`\n- `'background-sync'`\n- `'camera'`\n- `'clipboard-read'`\n- `'clipboard-write'`\n- `'geolocation'`\n- `'gyroscope'`\n- `'magnetometer'`\n- `'microphone'`\n- `'midi-sysex'` (system-exclusive midi)\n- `'midi'`\n- `'notifications'`\n- `'payment-handler'`\n- `'storage-access'`","async":false,"alias":"permissions","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.11","name":"newCDPSession","type":{"name":"CDPSession","expression":"[CDPSession]"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"removeAllListeners","type":{"name":"void"},"spec":[{"type":"text","text":"Removes all the listeners of the given type (or all registered listeners if no type given).↵Allows to wait for async listeners to complete or to ignore subsequent errors from these listeners."}],"required":true,"comment":"Removes all the listeners of the given type (or all registered listeners if no type given). Allows to wait for\nasync listeners to complete or to ignore subsequent errors from these listeners.","async":true,"alias":"removeAllListeners","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.47","name":"type","type":{"name":"string","expression":"[string]"},"spec":[],"required":false,"comment":"","async":false,"alias":"type","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.47","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.47","name":"behavior","type":{"name":"RemoveAllListenersBehavior","union":[{"name":"\"wait\""},{"name":"\"ignoreErrors\""},{"name":"\"default\""}],"expression":"[RemoveAllListenersBehavior]<\"wait\"|\"ignoreErrors\"|\"default\">"},"spec":[{"type":"text","text":"Specifies whether to wait for already running listeners and what to do if they throw errors:"},{"type":"li","text":"`'default'` - do not wait for current listener calls (if any) to finish, if the listener throws, it may result in unhandled error","liType":"bullet"},{"type":"li","text":"`'wait'` - wait for current listener calls (if any) to finish","liType":"bullet"},{"type":"li","text":"`'ignoreErrors'` - do not wait for current listener calls (if any) to finish, all errors thrown by the listeners after removal are silently caught","liType":"bullet"}],"required":false,"comment":"Specifies whether to wait for already running listeners and what to do if they throw errors:\n- `'default'` - do not wait for current listener calls (if any) to finish, if the listener throws, it may result\n in unhandled error\n- `'wait'` - wait for current listener calls (if any) to finish\n- `'ignoreErrors'` - do not wait for current listener calls (if any) to finish, all errors thrown by the\n listeners after removal are silently caught","async":false,"alias":"behavior","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"property","langs":{"aliases":{"csharp":"APIRequest"},"types":{},"overrides":{}},"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,"args":[]},{"kind":"method","langs":{},"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","children":[{"type":"text","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 `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/**', async route => {"," if (route.request().postData().includes('my-string'))"," await route.fulfill({ body: 'mocked-data' });"," else"," await 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":["async def handle_route(route: Route):"," if (\"my-string\" in route.request.post_data):"," await route.fulfill(body=\"mocked-data\")"," else:"," await route.continue_()","await context.route(\"/api/**\", handle_route)"],"codeLang":"python async"},{"type":"code","lines":["def handle_route(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(new() { 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","children":[{"type":"text","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 `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/**', async route => {\n if (route.request().postData().includes('my-string'))\n await route.fulfill({ body: 'mocked-data' });\n else\n await 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\nasync def handle_route(route: Route):\n if (\"my-string\" in route.request.post_data):\n await route.fulfill(body=\"mocked-data\")\n else:\n await route.continue_()\nawait context.route(\"/api/**\", handle_route)\n```\n\n```py\ndef handle_route(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(new() { 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.\n","async":true,"alias":"route","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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 `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 `serviceWorkers` to `'block'`.","async":true,"alias":"routeFromHAR","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.23","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.48","name":"routeWebSocket","type":{"name":"void"},"spec":[{"type":"text","text":"This method allows to modify websocket connections that are made by any page in the browser context."},{"type":"text","text":"Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before creating any pages."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Below is an example of a simple handler that blocks some websocket messages.↵See `WebSocketRoute` for more details and examples."},{"type":"code","lines":["await context.routeWebSocket('/ws', async ws => {"," ws.routeSend(message => {"," if (message === 'to-be-blocked')"," return;"," ws.send(message);"," });"," await ws.connect();","});"],"codeLang":"js"},{"type":"code","lines":["context.routeWebSocket(\"/ws\", ws -> {"," ws.routeSend(message -> {"," if (\"to-be-blocked\".equals(message))"," return;"," ws.send(message);"," });"," ws.connect();","});"],"codeLang":"java"},{"type":"code","lines":["def message_handler(ws: WebSocketRoute, message: Union[str, bytes]):"," if message == \"to-be-blocked\":"," return"," ws.send(message)","","async def handler(ws: WebSocketRoute):"," ws.route_send(lambda message: message_handler(ws, message))"," await ws.connect()","","await context.route_web_socket(\"/ws\", handler)"],"codeLang":"python async"},{"type":"code","lines":["def message_handler(ws: WebSocketRoute, message: Union[str, bytes]):"," if message == \"to-be-blocked\":"," return"," ws.send(message)","","def handler(ws: WebSocketRoute):"," ws.route_send(lambda message: message_handler(ws, message))"," ws.connect()","","context.route_web_socket(\"/ws\", handler)"],"codeLang":"python sync"},{"type":"code","lines":["await context.RouteWebSocketAsync(\"/ws\", async ws => {"," ws.RouteSend(message => {"," if (message == \"to-be-blocked\")"," return;"," ws.Send(message);"," });"," await ws.ConnectAsync();","});"],"codeLang":"csharp"}],"required":true,"comment":"This method allows to modify websocket connections that are made by any page in the browser context.\n\nNote that only `WebSocket`s created after this method was called will be routed. It is recommended to call this\nmethod before creating any pages.\n\n**Usage**\n\nBelow is an example of a simple handler that blocks some websocket messages. See `WebSocketRoute` for more details\nand examples.\n\n```js\nawait context.routeWebSocket('/ws', async ws => {\n ws.routeSend(message => {\n if (message === 'to-be-blocked')\n return;\n ws.send(message);\n });\n await ws.connect();\n});\n```\n\n```java\ncontext.routeWebSocket(\"/ws\", ws -> {\n ws.routeSend(message -> {\n if (\"to-be-blocked\".equals(message))\n return;\n ws.send(message);\n });\n ws.connect();\n});\n```\n\n```py\ndef message_handler(ws: WebSocketRoute, message: Union[str, bytes]):\n if message == \"to-be-blocked\":\n return\n ws.send(message)\n\nasync def handler(ws: WebSocketRoute):\n ws.route_send(lambda message: message_handler(ws, message))\n await ws.connect()\n\nawait context.route_web_socket(\"/ws\", handler)\n```\n\n```py\ndef message_handler(ws: WebSocketRoute, message: Union[str, bytes]):\n if message == \"to-be-blocked\":\n return\n ws.send(message)\n\ndef handler(ws: WebSocketRoute):\n ws.route_send(lambda message: message_handler(ws, message))\n ws.connect()\n\ncontext.route_web_socket(\"/ws\", handler)\n```\n\n```csharp\nawait context.RouteWebSocketAsync(\"/ws\", async ws => {\n ws.RouteSend(message => {\n if (message == \"to-be-blocked\")\n return;\n ws.Send(message);\n });\n await ws.ConnectAsync();\n});\n```\n","async":true,"alias":"routeWebSocket","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.48","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":"Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `baseURL` context option."}],"required":true,"comment":"Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the\n`baseURL` context option.","async":false,"alias":"url","overloadIndex":0},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.48","name":"handler","type":{"name":"function","args":[{"name":"WebSocketRoute"}],"returnType":{"name":"","union":[{"name":"Promise","templates":[{"name":"any"}]},{"name":"any"}]},"expression":"[function]([WebSocketRoute]): [Promise|any]"},"spec":[{"type":"text","text":"Handler function to route the WebSocket."}],"required":true,"comment":"Handler function to route the WebSocket.","async":false,"alias":"handler","overloadIndex":0},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.48","name":"handler","type":{"name":"function","args":[{"name":"WebSocketRoute"}],"expression":"[function]([WebSocketRoute])"},"spec":[{"type":"text","text":"Handler function to route the WebSocket."}],"required":true,"comment":"Handler function to route the WebSocket.","async":false,"alias":"handler","overloadIndex":0}]},{"kind":"method","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"serviceWorkers","type":{"name":"Array","templates":[{"name":"Worker"}],"expression":"[Array]<[Worker]>"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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,"args":[]},{"kind":"method","langs":{},"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","children":[{"type":"text","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`].\n","async":false,"alias":"setDefaultNavigationTimeout","overloadIndex":0,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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","children":[{"type":"text","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`].\n","async":false,"alias":"setDefaultTimeout","overloadIndex":0,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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","children":[{"type":"text","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.\n","async":true,"alias":"setExtraHTTPHeaders","overloadIndex":0,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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","children":[{"type":"text","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.\n","async":true,"alias":"setGeolocation","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"geolocation","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"expression":"[null]|[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"geolocation","overloadIndex":0}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"httpCredentials","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0}]}],"expression":"[null]|[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"httpCredentials","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.8","name":"setOffline","type":{"name":"void"},"spec":[],"required":true,"comment":"","async":true,"alias":"setOffline","overloadIndex":0,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{"types":{"csharp":{"name":"string","expression":"[string]"},"java":{"name":"string","expression":"[string]"}}},"since":"v1.8","name":"storageState","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"domain","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"path","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"cookies","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origins","overloadIndex":0}],"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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"property","langs":{},"since":"v1.12","name":"tracing","type":{"name":"Tracing","expression":"[Tracing]"},"spec":[],"required":true,"comment":"","async":false,"alias":"tracing","overloadIndex":0,"args":[]},{"kind":"method","langs":{},"since":"v1.41","name":"unrouteAll","type":{"name":"void"},"spec":[{"type":"text","text":"Removes all routes created with [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`]."}],"required":true,"comment":"Removes all routes created with [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`].","async":true,"alias":"unrouteAll","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.41","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.41","name":"behavior","type":{"name":"UnrouteBehavior","union":[{"name":"\"wait\""},{"name":"\"ignoreErrors\""},{"name":"\"default\""}],"expression":"[UnrouteBehavior]<\"wait\"|\"ignoreErrors\"|\"default\">"},"spec":[{"type":"text","text":"Specifies whether to wait for already running handlers and what to do if they throw errors:"},{"type":"li","text":"`'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may result in unhandled error","liType":"bullet"},{"type":"li","text":"`'wait'` - wait for current handler calls (if any) to finish","liType":"bullet"},{"type":"li","text":"`'ignoreErrors'` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers after unrouting are silently caught","liType":"bullet"}],"required":false,"comment":"Specifies whether to wait for already running handlers and what to do if they throw errors:\n- `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may\n result in unhandled error\n- `'wait'` - wait for current handler calls (if any) to finish\n- `'ignoreErrors'` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers\n after unrouting are silently caught","async":false,"alias":"behavior","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.32","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"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":{}},"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,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.34","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{"only":["js","python"],"aliases":{"python":"expect_event"},"types":{"python":{"name":"EventContextManager","expression":"[EventContextManager]"}},"overrides":{}},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"optionsOrPredicate","type":{"name":"","union":[{"name":"function"},{"name":"Object","properties":[{"kind":"property","langs":{},"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":true,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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},{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_page","csharp":"RunAndWaitForPage"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Page"}],"expression":"[EventContextManager]<[Page]>"}},"overrides":{}},"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,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{"only":["python"],"aliases":{"python":"wait_for_event"},"types":{},"overrides":{}},"since":"v1.8","name":"waitForEvent2","type":{"name":"any","expression":"[any]"},"spec":[{"type":"note","noteType":"note","children":[{"type":"text","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,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]}]},{"name":"BrowserServer","spec":[],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","members":[{"kind":"event","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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."},{"type":"text","text":"Note that if the listen `host` option in `launchServer` options is not specified, localhost will be output anyway, even if the actual listening address is an unspecified address."}],"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.\n\nNote that if the listen `host` option in `launchServer` options is not specified, localhost will be output anyway,\neven if the actual listening address is an unspecified address.","async":false,"alias":"wsEndpoint","overloadIndex":0,"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":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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","children":[{"type":"text","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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"note","noteType":"warning","children":[{"type":"text","text":"Use custom browser args at your own risk, as some of them may break Playwright functionality."}]},{"type":"text","text":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](https://peter.sh/experiments/chromium-command-line-switches/)."}],"required":false,"comment":"**NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.\n\nAdditional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](https://peter.sh/experiments/chromium-command-line-switches/).","async":false,"alias":"args","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","deprecated":"Use [debugging tools](../debug.md) instead.","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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"note","noteType":"warning","children":[{"type":"text","text":"Use custom browser args at your own risk, as some of them may break Playwright functionality."}]},{"type":"text","text":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](https://peter.sh/experiments/chromium-command-line-switches/)."}],"required":false,"comment":"**NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.\n\nAdditional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](https://peter.sh/experiments/chromium-command-line-switches/).","async":false,"alias":"args","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"1.46","name":"clientCertificates","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"1.46","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port."}],"required":true,"comment":"Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port.","async":false,"alias":"origin","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"certPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the file with the certificate in PEM format."}],"required":false,"comment":"Path to the file with the certificate in PEM format.","async":false,"alias":"certPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"cert","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the certificate in PEM format."}],"required":false,"comment":"Direct value of the certificate in PEM format.","async":false,"alias":"cert","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"keyPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the file with the private key in PEM format."}],"required":false,"comment":"Path to the file with the private key in PEM format.","async":false,"alias":"keyPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"key","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the private key in PEM format."}],"required":false,"comment":"Direct value of the private key in PEM format.","async":false,"alias":"key","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"pfxPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the PFX or PKCS12 encoded private key and certificate chain."}],"required":false,"comment":"Path to the PFX or PKCS12 encoded private key and certificate chain.","async":false,"alias":"pfxPath","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"pfx","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Direct value of the PFX or PKCS12 encoded private key and certificate chain."}],"required":false,"comment":"Direct value of the PFX or PKCS12 encoded private key and certificate chain.","async":false,"alias":"pfx","overloadIndex":0},{"kind":"property","langs":{},"since":"1.46","name":"passphrase","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Passphrase for the private key (PEM or PFX)."}],"required":false,"comment":"Passphrase for the private key (PEM or PFX).","async":false,"alias":"passphrase","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"TLS Client Authentication allows the server to request a client certificate and verify it."},{"type":"text","text":"**Details**"},{"type":"text","text":"An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for."},{"type":"note","noteType":"note","children":[{"type":"text","text":"When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`."}]}],"required":false,"comment":"TLS Client Authentication allows the server to request a client certificate and verify it.\n\n**Details**\n\nAn array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`,\na single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally,\n`passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided\nwith an exact match to the request origin that the certificate is valid for.\n\n**NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it\nwork by replacing `localhost` with `local.playwright`.\n","async":false,"alias":"clientCertificates","overloadIndex":0},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `null` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `'null'` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","deprecated":"Use [debugging tools](../debug.md) instead.","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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.40","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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.40","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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"since":"v1.8","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0}],"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_content"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_mode"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_url_filter"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"aliases":{"java":"screenSize","csharp":"screenSize"},"types":{},"overrides":{}},"since":"v1.8","name":"screen","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videoSize","overloadIndex":0},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videosPath","overloadIndex":0},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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","children":[{"type":"text","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.\n","async":false,"alias":"viewport","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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","children":[{"type":"text","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.\n","async":false,"alias":"viewport","overloadIndex":0},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"note","noteType":"warning","children":[{"type":"text","text":"Use custom browser args at your own risk, as some of them may break Playwright functionality."}]},{"type":"text","text":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](https://peter.sh/experiments/chromium-command-line-switches/)."}],"required":false,"comment":"**NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.\n\nAdditional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](https://peter.sh/experiments/chromium-command-line-switches/).","async":false,"alias":"args","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","deprecated":"Use [debugging tools](../debug.md) instead.","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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.45","name":"host","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Host to use for the web socket. It is optional and if it is omitted, the server will accept connections on the unspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise. Consider hardening it with picking a specific interface."}],"required":false,"comment":"Host to use for the web socket. It is optional and if it is omitted, the server will accept connections on the\nunspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise. Consider\nhardening it with picking a specific interface.","async":false,"alias":"host","overloadIndex":0},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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","children":[{"type":"text","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.\n","async":false,"alias":"wsPath","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[]}]},{"name":"CDPSession","spec":[{"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"}],"langs":{},"comment":"The `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":{},"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,"args":[]},{"kind":"method","langs":{"types":{"csharp":{"name":"JsonElement?","expression":"[JsonElement?]"},"java":{"name":"JsonObject","expression":"[JsonObject]"}}},"since":"v1.8","name":"send","type":{"name":"Object","expression":"[Object]"},"spec":[],"required":true,"comment":"","async":true,"alias":"send","overloadIndex":0,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"args"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["java"],"aliases":{"java":"args"},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"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}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]}]},{"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":{}},"since":"v1.30","name":"onEvent","type":{"name":"JsonElement?","expression":"[JsonElement?]"},"spec":[],"required":true,"comment":"","async":false,"alias":"onEvent","overloadIndex":0,"args":[]},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"1.30","name":"eventName","type":{"name":"string","expression":"[string]"},"spec":[],"required":true,"comment":"","async":false,"alias":"eventName","overloadIndex":0,"args":[]}]},{"name":"Clock","spec":[{"type":"text","text":"Accurately simulating time-dependent behavior is essential for verifying the correctness of applications. Learn more about [clock emulation](../clock.md)."},{"type":"text","text":"Note that clock is installed for the entire `BrowserContext`, so the time↵in all the pages and iframes is controlled by the same clock."}],"langs":{},"comment":"Accurately simulating time-dependent behavior is essential for verifying the correctness of applications. Learn\nmore about [clock emulation](../clock.md).\n\nNote that clock is installed for the entire `BrowserContext`, so the time in all the pages and iframes is\ncontrolled by the same clock.","since":"v1.45","members":[{"kind":"method","langs":{},"since":"v1.45","name":"fastForward","type":{"name":"void"},"spec":[{"type":"text","text":"Advance the clock by jumping forward in time. Only fires due timers at most once. This is equivalent to user closing the laptop lid for a while and↵reopening it later, after given time."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.fastForward(1000);","await page.clock.fastForward('30:00');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.fast_forward(1000)","await page.clock.fast_forward(\"30:00\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.fast_forward(1000)","page.clock.fast_forward(\"30:00\")"],"codeLang":"python sync"},{"type":"code","lines":["page.clock().fastForward(1000);","page.clock().fastForward(\"30:00\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.FastForwardAsync(1000);","await page.Clock.FastForwardAsync(\"30:00\");"],"codeLang":"csharp"}],"required":true,"comment":"Advance the clock by jumping forward in time. Only fires due timers at most once. This is equivalent to user\nclosing the laptop lid for a while and reopening it later, after given time.\n\n**Usage**\n\n```js\nawait page.clock.fastForward(1000);\nawait page.clock.fastForward('30:00');\n```\n\n```py\nawait page.clock.fast_forward(1000)\nawait page.clock.fast_forward(\"30:00\")\n```\n\n```py\npage.clock.fast_forward(1000)\npage.clock.fast_forward(\"30:00\")\n```\n\n```java\npage.clock().fastForward(1000);\npage.clock().fastForward(\"30:00\");\n```\n\n```csharp\nawait page.Clock.FastForwardAsync(1000);\nawait page.Clock.FastForwardAsync(\"30:00\");\n```\n","async":true,"alias":"fastForward","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.45","name":"ticks","type":{"name":"","union":[{"name":"long"},{"name":"string"}],"expression":"[long]|[string]"},"spec":[{"type":"text","text":"Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are \"08\" for eight seconds, \"01:00\" for one minute and \"02:34:10\" for two hours, 34 minutes and ten seconds."}],"required":true,"comment":"Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are\n\"08\" for eight seconds, \"01:00\" for one minute and \"02:34:10\" for two hours, 34 minutes and ten seconds.","async":false,"alias":"ticks","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.45","name":"install","type":{"name":"void"},"spec":[{"type":"text","text":"Install fake implementations for the following time-related functions:"},{"type":"li","text":"`Date`","liType":"bullet"},{"type":"li","text":"`setTimeout`","liType":"bullet"},{"type":"li","text":"`clearTimeout`","liType":"bullet"},{"type":"li","text":"`setInterval`","liType":"bullet"},{"type":"li","text":"`clearInterval`","liType":"bullet"},{"type":"li","text":"`requestAnimationFrame`","liType":"bullet"},{"type":"li","text":"`cancelAnimationFrame`","liType":"bullet"},{"type":"li","text":"`requestIdleCallback`","liType":"bullet"},{"type":"li","text":"`cancelIdleCallback`","liType":"bullet"},{"type":"li","text":"`performance`","liType":"bullet"},{"type":"text","text":"Fake timers are used to manually control the flow of time in tests. They allow you to advance time, fire timers, and control the behavior of time-dependent functions. See [`method: Clock.runFor`] and [`method: Clock.fastForward`] for more information."}],"required":true,"comment":"Install fake implementations for the following time-related functions:\n- `Date`\n- `setTimeout`\n- `clearTimeout`\n- `setInterval`\n- `clearInterval`\n- `requestAnimationFrame`\n- `cancelAnimationFrame`\n- `requestIdleCallback`\n- `cancelIdleCallback`\n- `performance`\n\nFake timers are used to manually control the flow of time in tests. They allow you to advance time, fire timers,\nand control the behavior of time-dependent functions. See [`method: Clock.runFor`] and\n[`method: Clock.fastForward`] for more information.","async":true,"alias":"install","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.45","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"long"},{"name":"string"},{"name":"Date"}],"expression":"[long]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to initialize with, current system time by default."}],"required":false,"comment":"Time to initialize with, current system time by default.","async":false,"alias":"time","overloadIndex":0},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"float"},{"name":"string"},{"name":"Date"}],"expression":"[float]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to initialize with, current system time by default."}],"required":false,"comment":"Time to initialize with, current system time by default.","async":false,"alias":"time","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"string"},{"name":"Date"}],"expression":"[string]|[Date]"},"spec":[{"type":"text","text":"Time to initialize with, current system time by default."}],"required":false,"comment":"Time to initialize with, current system time by default.","async":false,"alias":"time","overloadIndex":0}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.45","name":"runFor","type":{"name":"void"},"spec":[{"type":"text","text":"Advance the clock, firing all the time-related callbacks."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.runFor(1000);","await page.clock.runFor('30:00');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.run_for(1000);","await page.clock.run_for(\"30:00\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.run_for(1000);","page.clock.run_for(\"30:00\")"],"codeLang":"python sync"},{"type":"code","lines":["page.clock().runFor(1000);","page.clock().runFor(\"30:00\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.RunForAsync(1000);","await page.Clock.RunForAsync(\"30:00\");"],"codeLang":"csharp"}],"required":true,"comment":"Advance the clock, firing all the time-related callbacks.\n\n**Usage**\n\n```js\nawait page.clock.runFor(1000);\nawait page.clock.runFor('30:00');\n```\n\n```py\nawait page.clock.run_for(1000);\nawait page.clock.run_for(\"30:00\")\n```\n\n```py\npage.clock.run_for(1000);\npage.clock.run_for(\"30:00\")\n```\n\n```java\npage.clock().runFor(1000);\npage.clock().runFor(\"30:00\");\n```\n\n```csharp\nawait page.Clock.RunForAsync(1000);\nawait page.Clock.RunForAsync(\"30:00\");\n```\n","async":true,"alias":"runFor","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.45","name":"ticks","type":{"name":"","union":[{"name":"long"},{"name":"string"}],"expression":"[long]|[string]"},"spec":[{"type":"text","text":"Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are \"08\" for eight seconds, \"01:00\" for one minute and \"02:34:10\" for two hours, 34 minutes and ten seconds."}],"required":true,"comment":"Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are\n\"08\" for eight seconds, \"01:00\" for one minute and \"02:34:10\" for two hours, 34 minutes and ten seconds.","async":false,"alias":"ticks","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.45","name":"pauseAt","type":{"name":"void"},"spec":[{"type":"text","text":"Advance the clock by jumping forward in time and pause the time. Once this method is called, no timers↵are fired unless [`method: Clock.runFor`], [`method: Clock.fastForward`], [`method: Clock.pauseAt`] or [`method: Clock.resume`] is called."},{"type":"text","text":"Only fires due timers at most once.↵This is equivalent to user closing the laptop lid for a while and reopening it at the specified time and↵pausing."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.pauseAt(new Date('2020-02-02'));","await page.clock.pauseAt('2020-02-02');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.pause_at(datetime.datetime(2020, 2, 2))","await page.clock.pause_at(\"2020-02-02\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.pause_at(datetime.datetime(2020, 2, 2))","page.clock.pause_at(\"2020-02-02\")"],"codeLang":"python sync"},{"type":"code","lines":["SimpleDateFormat format = new SimpleDateFormat(\"yyy-MM-dd\");","page.clock().pauseAt(format.parse(\"2020-02-02\"));","page.clock().pauseAt(\"2020-02-02\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.PauseAtAsync(DateTime.Parse(\"2020-02-02\"));","await page.Clock.PauseAtAsync(\"2020-02-02\");"],"codeLang":"csharp"}],"required":true,"comment":"Advance the clock by jumping forward in time and pause the time. Once this method is called, no timers are fired\nunless [`method: Clock.runFor`], [`method: Clock.fastForward`], [`method: Clock.pauseAt`] or\n[`method: Clock.resume`] is called.\n\nOnly fires due timers at most once. This is equivalent to user closing the laptop lid for a while and reopening it\nat the specified time and pausing.\n\n**Usage**\n\n```js\nawait page.clock.pauseAt(new Date('2020-02-02'));\nawait page.clock.pauseAt('2020-02-02');\n```\n\n```py\nawait page.clock.pause_at(datetime.datetime(2020, 2, 2))\nawait page.clock.pause_at(\"2020-02-02\")\n```\n\n```py\npage.clock.pause_at(datetime.datetime(2020, 2, 2))\npage.clock.pause_at(\"2020-02-02\")\n```\n\n```java\nSimpleDateFormat format = new SimpleDateFormat(\"yyy-MM-dd\");\npage.clock().pauseAt(format.parse(\"2020-02-02\"));\npage.clock().pauseAt(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.PauseAtAsync(DateTime.Parse(\"2020-02-02\"));\nawait page.Clock.PauseAtAsync(\"2020-02-02\");\n```\n","async":true,"alias":"pauseAt","overloadIndex":0,"args":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"long"},{"name":"string"},{"name":"Date"}],"expression":"[long]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to pause at."}],"required":true,"comment":"Time to pause at.","async":false,"alias":"time","overloadIndex":0},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"float"},{"name":"string"},{"name":"Date"}],"expression":"[float]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to pause at."}],"required":true,"comment":"Time to pause at.","async":false,"alias":"time","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"Date"},{"name":"string"}],"expression":"[Date]|[string]"},"spec":[{"type":"text","text":"Time to pause at."}],"required":true,"comment":"Time to pause at.","async":false,"alias":"time","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.45","name":"resume","type":{"name":"void"},"spec":[{"type":"text","text":"Resumes timers. Once this method is called, time resumes flowing, timers are fired as usual."}],"required":true,"comment":"Resumes timers. Once this method is called, time resumes flowing, timers are fired as usual.","async":true,"alias":"resume","overloadIndex":0,"args":[]},{"kind":"method","langs":{},"since":"v1.45","name":"setFixedTime","type":{"name":"void"},"spec":[{"type":"text","text":"Makes `Date.now` and `new Date()` return fixed fake time at all times,↵keeps all the timers running."},{"type":"text","text":"Use this method for simple scenarios where you only need to test with a predefined time. For more advanced scenarios, use [`method: Clock.install`] instead. Read docs on [clock emulation](../clock.md) to learn more."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.setFixedTime(Date.now());","await page.clock.setFixedTime(new Date('2020-02-02'));","await page.clock.setFixedTime('2020-02-02');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.set_fixed_time(datetime.datetime.now())","await page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))","await page.clock.set_fixed_time(\"2020-02-02\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.set_fixed_time(datetime.datetime.now())","page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))","page.clock.set_fixed_time(\"2020-02-02\")"],"codeLang":"python sync"},{"type":"code","lines":["page.clock().setFixedTime(new Date());","page.clock().setFixedTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));","page.clock().setFixedTime(\"2020-02-02\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.SetFixedTimeAsync(DateTime.Now);","await page.Clock.SetFixedTimeAsync(new DateTime(2020, 2, 2));","await page.Clock.SetFixedTimeAsync(\"2020-02-02\");"],"codeLang":"csharp"}],"required":true,"comment":"Makes `Date.now` and `new Date()` return fixed fake time at all times, keeps all the timers running.\n\nUse this method for simple scenarios where you only need to test with a predefined time. For more advanced\nscenarios, use [`method: Clock.install`] instead. Read docs on [clock emulation](../clock.md) to learn more.\n\n**Usage**\n\n```js\nawait page.clock.setFixedTime(Date.now());\nawait page.clock.setFixedTime(new Date('2020-02-02'));\nawait page.clock.setFixedTime('2020-02-02');\n```\n\n```py\nawait page.clock.set_fixed_time(datetime.datetime.now())\nawait page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))\nawait page.clock.set_fixed_time(\"2020-02-02\")\n```\n\n```py\npage.clock.set_fixed_time(datetime.datetime.now())\npage.clock.set_fixed_time(datetime.datetime(2020, 2, 2))\npage.clock.set_fixed_time(\"2020-02-02\")\n```\n\n```java\npage.clock().setFixedTime(new Date());\npage.clock().setFixedTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));\npage.clock().setFixedTime(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.SetFixedTimeAsync(DateTime.Now);\nawait page.Clock.SetFixedTimeAsync(new DateTime(2020, 2, 2));\nawait page.Clock.SetFixedTimeAsync(\"2020-02-02\");\n```\n","async":true,"alias":"setFixedTime","overloadIndex":0,"args":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"long"},{"name":"string"},{"name":"Date"}],"expression":"[long]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set in milliseconds."}],"required":true,"comment":"Time to be set in milliseconds.","async":false,"alias":"time","overloadIndex":0},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"float"},{"name":"string"},{"name":"Date"}],"expression":"[float]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set."}],"required":true,"comment":"Time to be set.","async":false,"alias":"time","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"string"},{"name":"Date"}],"expression":"[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set."}],"required":true,"comment":"Time to be set.","async":false,"alias":"time","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.45","name":"setSystemTime","type":{"name":"void"},"spec":[{"type":"text","text":"Sets system time, but does not trigger any timers. Use this to test how the web page reacts to a time shift, for example switching from summer to winter time, or changing time zones."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.setSystemTime(Date.now());","await page.clock.setSystemTime(new Date('2020-02-02'));","await page.clock.setSystemTime('2020-02-02');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.set_system_time(datetime.datetime.now())","await page.clock.set_system_time(datetime.datetime(2020, 2, 2))","await page.clock.set_system_time(\"2020-02-02\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.set_system_time(datetime.datetime.now())","page.clock.set_system_time(datetime.datetime(2020, 2, 2))","page.clock.set_system_time(\"2020-02-02\")"],"codeLang":"python sync"},{"type":"code","lines":["page.clock().setSystemTime(new Date());","page.clock().setSystemTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));","page.clock().setSystemTime(\"2020-02-02\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.SetSystemTimeAsync(DateTime.Now);","await page.Clock.SetSystemTimeAsync(new DateTime(2020, 2, 2));","await page.Clock.SetSystemTimeAsync(\"2020-02-02\");"],"codeLang":"csharp"}],"required":true,"comment":"Sets system time, but does not trigger any timers. Use this to test how the web page reacts to a time shift, for\nexample switching from summer to winter time, or changing time zones.\n\n**Usage**\n\n```js\nawait page.clock.setSystemTime(Date.now());\nawait page.clock.setSystemTime(new Date('2020-02-02'));\nawait page.clock.setSystemTime('2020-02-02');\n```\n\n```py\nawait page.clock.set_system_time(datetime.datetime.now())\nawait page.clock.set_system_time(datetime.datetime(2020, 2, 2))\nawait page.clock.set_system_time(\"2020-02-02\")\n```\n\n```py\npage.clock.set_system_time(datetime.datetime.now())\npage.clock.set_system_time(datetime.datetime(2020, 2, 2))\npage.clock.set_system_time(\"2020-02-02\")\n```\n\n```java\npage.clock().setSystemTime(new Date());\npage.clock().setSystemTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));\npage.clock().setSystemTime(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.SetSystemTimeAsync(DateTime.Now);\nawait page.Clock.SetSystemTimeAsync(new DateTime(2020, 2, 2));\nawait page.Clock.SetSystemTimeAsync(\"2020-02-02\");\n```\n","async":true,"alias":"setSystemTime","overloadIndex":0,"args":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"long"},{"name":"string"},{"name":"Date"}],"expression":"[long]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set in milliseconds."}],"required":true,"comment":"Time to be set in milliseconds.","async":false,"alias":"time","overloadIndex":0},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"float"},{"name":"string"},{"name":"Date"}],"expression":"[float]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set."}],"required":true,"comment":"Time to be set.","async":false,"alias":"time","overloadIndex":0},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"string"},{"name":"Date"}],"expression":"[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set."}],"required":true,"comment":"Time to be set.","async":false,"alias":"time","overloadIndex":0}]}]},{"name":"ConsoleMessage","spec":[{"type":"text","text":"`ConsoleMessage` objects are dispatched by page via the [`event: Page.console`] event.↵For each console message 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 message\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":{},"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,"args":[]},{"kind":"method","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"location","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}],"expression":"[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"location","overloadIndex":0,"args":[]},{"kind":"method","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"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","children":[{"type":"text","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":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.11","name":"startJSCoverage","type":{"name":"void"},"spec":[{"type":"text","text":"Returns coverage is started"},{"type":"note","noteType":"note","children":[{"type":"text","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.\n","async":true,"alias":"startJSCoverage","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.11","name":"stopCSSCoverage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"StyleSheet URL"}],"required":true,"comment":"StyleSheet URL","async":false,"alias":"url","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","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},{"kind":"property","langs":{},"since":"v1.11","name":"ranges","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","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},{"kind":"property","langs":{},"since":"v1.11","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}]}],"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}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Returns the array of coverage reports for all stylesheets"},{"type":"note","noteType":"note","children":[{"type":"text","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.\n","async":true,"alias":"stopCSSCoverage","overloadIndex":0,"args":[]},{"kind":"method","langs":{},"since":"v1.11","name":"stopJSCoverage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script URL"}],"required":true,"comment":"Script URL","async":false,"alias":"url","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","name":"scriptId","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script ID"}],"required":true,"comment":"Script ID","async":false,"alias":"scriptId","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","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},{"kind":"property","langs":{},"since":"v1.11","name":"functions","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","name":"functionName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"functionName","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","name":"isBlockCoverage","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"isBlockCoverage","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","name":"ranges","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","name":"count","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"count","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","name":"startOffset","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"startOffset","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","name":"endOffset","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"endOffset","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"ranges","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"V8-specific coverage format."}],"required":true,"comment":"V8-specific coverage format.","async":false,"alias":"functions","overloadIndex":0}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Returns the array of coverage reports for all scripts"},{"type":"note","noteType":"note","children":[{"type":"text","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.\n","async":true,"alias":"stopJSCoverage","overloadIndex":0,"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","children":[{"type":"text","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.\n","since":"v1.8","members":[{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"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":{},"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,"args":[]},{"kind":"method","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"createReadStream","type":{"name":"Readable","expression":"[Readable]"},"spec":[{"type":"text","text":"Returns a readable stream for a successful download, or throws for a failed/canceled download."}],"required":true,"comment":"Returns a readable stream for a successful download, or throws for a failed/canceled download.","async":true,"alias":"createReadStream","overloadIndex":0,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Returns path to the downloaded file for a successful download, or throws for a failed/canceled 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 for a successful download, or throws for a failed/canceled download. The method\nwill wait for the download to finish if 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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"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":"**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\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":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"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](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See [`method: Page.emulateMedia`] for more details.\nPassing `null` resets emulation to system defaults. Defaults to `'light'`.","async":false,"alias":"colorScheme","overloadIndex":0},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.12","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","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}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.12","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.12","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","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}],"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}],"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.12","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","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},{"kind":"property","langs":{},"since":"v1.12","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}],"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]}]},{"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":{},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"This event is issued when the application process has been terminated."}],"required":true,"comment":"This event is issued when the application process has been terminated.","async":false,"alias":"close","overloadIndex":0,"args":[]},{"kind":"event","langs":{},"since":"v1.42","name":"console","type":{"name":"ConsoleMessage","expression":"[ConsoleMessage]"},"spec":[{"type":"text","text":"Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or `console.dir`."},{"type":"text","text":"The arguments passed into `console.log` are available on the `ConsoleMessage` event handler argument."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["electronApp.on('console', async msg => {"," const values = [];"," for (const arg of msg.args())"," values.push(await arg.jsonValue());"," console.log(...values);","});","await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));"],"codeLang":"js"}],"required":true,"comment":"Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or\n`console.dir`.\n\nThe arguments passed into `console.log` are available on the `ConsoleMessage` event handler argument.\n\n**Usage**\n\n```js\nelectronApp.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 electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));\n```\n","async":false,"alias":"console","overloadIndex":0,"args":[]},{"kind":"event","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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":"Function to be evaluated in the main Electron process.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0}}},"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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":"Function to be evaluated in the main Electron process.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0}}},"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{},"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,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"optionsOrPredicate","type":{"name":"","union":[{"name":"function"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","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},{"kind":"property","langs":{},"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}]}],"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}]},{"kind":"method","langs":{},"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,"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":"warning[Discouraged]","children":[{"type":"text","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":{},"since":"v1.8","name":"boundingBox","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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},{"kind":"property","langs":{},"since":"v1.8","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}]}],"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,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.check`] instead. Read more about [locators](../locators.md).","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":"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. 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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option has no effect.","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"This option has no effect."}],"required":false,"comment":"This option has no effect.","async":false,"alias":"noWaitAfter","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.11","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}],"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},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.click`] instead. Read more about [locators](../locators.md).","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,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"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. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"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. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option will default to `true` in the future.","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},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}],"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},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"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,"args":[]},{"kind":"method","langs":{"aliases":{"csharp":"DblClickAsync"},"types":{},"overrides":{}},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.dblclick`] instead. Read more about [locators](../locators.md).","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":"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","children":[{"type":"text","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`.\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.\n","async":true,"alias":"dblclick","overloadIndex":0,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"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. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"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. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option has no effect.","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"This option has no effect."}],"required":false,"comment":"This option has no effect.","async":false,"alias":"noWaitAfter","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0},{"kind":"property","langs":{},"since":"v1.8","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0}],"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},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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},{"kind":"property","langs":{},"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}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md).","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":"[DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)","liType":"bullet"},{"type":"li","text":"[DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)","liType":"bullet"},{"type":"li","text":"[DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)","liType":"bullet"},{"type":"li","text":"[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)","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":"[WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)","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- [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)\n- [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)\n- [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)\n- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)\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- [WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)\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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{"aliases":{"python":"eval_on_selector","js":"$eval"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"This method does not wait for the element to pass actionability↵checks and therefore can lead to the flaky tests. Use [`method: Locator.evaluate`],↵other `Locator` helper methods or web-first assertions instead.","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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0}}},"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{"aliases":{"python":"eval_on_selector_all","js":"$$eval"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"In most cases, [`method: Locator.evaluateAll`],↵other `Locator` helper methods and web-first assertions do a better job.","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,"args":[{"kind":"property","langs":{},"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},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0}}},"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},{"kind":"property","langs":{},"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}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.fill`] instead. Read more about [locators](../locators.md).","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 ``, `