api.json 307 KB

1
  1. {"Browser":{"name":"Browser","extends":"EventEmitter","members":{"disconnected":{"kind":"event","name":"disconnected","type":null,"comment":"","returnComment":"","required":true,"args":{}},"close":{"kind":"method","name":"close","type":{"name":"Promise"},"comment":"In case this browser is obtained using browserType.launch, closes the browser and all of its pages (if any were opened).\nIn case this browser is obtained using browserType.connect, clears all created contexts belonging to this browser and disconnects from the browser server.\nThe Browser object itself is considered to be disposed and cannot be used anymore.","returnComment":"","required":true,"args":{}},"contexts":{"kind":"method","name":"contexts","type":{"name":"Array<BrowserContext>"},"comment":"Returns an array of all open browser contexts. In a newly created browser, this will return zero\nbrowser contexts.\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```","returnComment":"","required":true,"args":{}},"isConnected":{"kind":"method","name":"isConnected","type":{"name":"boolean"},"comment":"Indicates that the browser is connected.","returnComment":"","required":true,"args":{}},"newContext":{"kind":"method","name":"newContext","type":{"name":"Promise<BrowserContext>"},"comment":"Creates a new browser context. It won't share cookies/cache with other browser contexts.\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```","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"acceptDownloads":{"kind":"property","name":"acceptDownloads","type":{"name":"boolean"},"comment":"Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.","returnComment":"","required":false},"ignoreHTTPSErrors":{"kind":"property","name":"ignoreHTTPSErrors","type":{"name":"boolean"},"comment":"Whether to ignore HTTPS errors during navigation. Defaults to `false`.","returnComment":"","required":false},"bypassCSP":{"kind":"property","name":"bypassCSP","type":{"name":"boolean"},"comment":"Toggles bypassing page's Content-Security-Policy.","returnComment":"","required":false},"viewport":{"kind":"property","name":"viewport","type":{"name":"null|Object","properties":{"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"page width in pixels.","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"page height in pixels.","returnComment":"","required":true}}},"comment":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.","returnComment":"","required":false},"userAgent":{"kind":"property","name":"userAgent","type":{"name":"string"},"comment":"Specific user agent to use in this context.","returnComment":"","required":false},"deviceScaleFactor":{"kind":"property","name":"deviceScaleFactor","type":{"name":"number"},"comment":"Specify device scale factor (can be thought of as dpr). Defaults to `1`.","returnComment":"","required":false},"isMobile":{"kind":"property","name":"isMobile","type":{"name":"boolean"},"comment":"Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox.","returnComment":"","required":false},"hasTouch":{"kind":"property","name":"hasTouch","type":{"name":"boolean"},"comment":"Specifies if viewport supports touch events. Defaults to false.","returnComment":"","required":false},"javaScriptEnabled":{"kind":"property","name":"javaScriptEnabled","type":{"name":"boolean"},"comment":"Whether or not to enable JavaScript in the context. Defaults to true.","returnComment":"","required":false},"timezoneId":{"kind":"property","name":"timezoneId","type":{"name":"string"},"comment":"Changes the timezone of the context. See ICU’s `metaZones.txt` for a list of supported timezone IDs.","returnComment":"","required":false},"geolocation":{"kind":"property","name":"geolocation","type":{"name":"Object","properties":{"latitude":{"kind":"property","name":"latitude","type":{"name":"number"},"comment":"Latitude between -90 and 90.","returnComment":"","required":true},"longitude":{"kind":"property","name":"longitude","type":{"name":"number"},"comment":"Longitude between -180 and 180.","returnComment":"","required":true},"accuracy":{"kind":"property","name":"accuracy","type":{"name":"number"},"comment":"Non-negative accuracy value. Defaults to `0`.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false},"locale":{"kind":"property","name":"locale","type":{"name":"string"},"comment":"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.","returnComment":"","required":false},"permissions":{"kind":"property","name":"permissions","type":{"name":"Array<string>"},"comment":"A list of permissions to grant to all pages in this context. See browserContext.grantPermissions for more details.","returnComment":"","required":false},"extraHTTPHeaders":{"kind":"property","name":"extraHTTPHeaders","type":{"name":"Object<string, string>"},"comment":"An object containing additional HTTP headers to be sent with every request. All header values must be strings.","returnComment":"","required":false},"offline":{"kind":"property","name":"offline","type":{"name":"boolean"},"comment":"Whether to emulate network being offline. Defaults to `false`.","returnComment":"","required":false},"httpCredentials":{"kind":"property","name":"httpCredentials","type":{"name":"Object","properties":{"username":{"kind":"property","name":"username","type":{"name":"string"},"comment":"","returnComment":"","required":true},"password":{"kind":"property","name":"password","type":{"name":"string"},"comment":"","returnComment":"","required":true}}},"comment":"Credentials for HTTP authentication.","returnComment":"","required":false},"colorScheme":{"kind":"property","name":"colorScheme","type":{"name":"\"dark\"|\"light\"|\"no-preference\""},"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See page.emulateMedia(options) for more details. Defaults to '`light`'.","returnComment":"","required":false},"logger":{"kind":"property","name":"logger","type":{"name":"Logger"},"comment":"Logger sink for Playwright logging.","returnComment":"","required":false},"videosPath":{"kind":"property","name":"videosPath","type":{"name":"string"},"comment":"Enables video recording for all pages to `videosPath` folder. If not specified, videos are not recorded.","returnComment":"","required":false},"videoSize":{"kind":"property","name":"videoSize","type":{"name":"Object","properties":{"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"Video frame width.","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"Video frame height.","returnComment":"","required":true}}},"comment":"Specifies dimensions of the automatically recorded video. Can only be used if `videosPath` is set. If not specified the size will be equal to `viewport`. If `viewport` is not configured explicitly the video size defaults to 1280x720. Actual picture of the page will be scaled down if necessary to fit specified size.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"newPage":{"kind":"method","name":"newPage","type":{"name":"Promise<Page>"},"comment":"Creates a new page in a new browser context. Closing this page will close the context as well.\nThis 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 browser.newContext followed by the browserContext.newPage to control their exact life times.","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"acceptDownloads":{"kind":"property","name":"acceptDownloads","type":{"name":"boolean"},"comment":"Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.","returnComment":"","required":false},"ignoreHTTPSErrors":{"kind":"property","name":"ignoreHTTPSErrors","type":{"name":"boolean"},"comment":"Whether to ignore HTTPS errors during navigation. Defaults to `false`.","returnComment":"","required":false},"bypassCSP":{"kind":"property","name":"bypassCSP","type":{"name":"boolean"},"comment":"Toggles bypassing page's Content-Security-Policy.","returnComment":"","required":false},"viewport":{"kind":"property","name":"viewport","type":{"name":"null|Object","properties":{"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"page width in pixels.","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"page height in pixels.","returnComment":"","required":true}}},"comment":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.","returnComment":"","required":false},"userAgent":{"kind":"property","name":"userAgent","type":{"name":"string"},"comment":"Specific user agent to use in this context.","returnComment":"","required":false},"deviceScaleFactor":{"kind":"property","name":"deviceScaleFactor","type":{"name":"number"},"comment":"Specify device scale factor (can be thought of as dpr). Defaults to `1`.","returnComment":"","required":false},"isMobile":{"kind":"property","name":"isMobile","type":{"name":"boolean"},"comment":"Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox.","returnComment":"","required":false},"hasTouch":{"kind":"property","name":"hasTouch","type":{"name":"boolean"},"comment":"Specifies if viewport supports touch events. Defaults to false.","returnComment":"","required":false},"javaScriptEnabled":{"kind":"property","name":"javaScriptEnabled","type":{"name":"boolean"},"comment":"Whether or not to enable JavaScript in the context. Defaults to `true`.","returnComment":"","required":false},"timezoneId":{"kind":"property","name":"timezoneId","type":{"name":"string"},"comment":"Changes the timezone of the context. See ICU’s `metaZones.txt` for a list of supported timezone IDs.","returnComment":"","required":false},"geolocation":{"kind":"property","name":"geolocation","type":{"name":"Object","properties":{"latitude":{"kind":"property","name":"latitude","type":{"name":"number"},"comment":"Latitude between -90 and 90.","returnComment":"","required":true},"longitude":{"kind":"property","name":"longitude","type":{"name":"number"},"comment":"Longitude between -180 and 180.","returnComment":"","required":true},"accuracy":{"kind":"property","name":"accuracy","type":{"name":"number"},"comment":"Non-negative accuracy value. Defaults to `0`.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false},"locale":{"kind":"property","name":"locale","type":{"name":"string"},"comment":"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.","returnComment":"","required":false},"permissions":{"kind":"property","name":"permissions","type":{"name":"Array<string>"},"comment":"A list of permissions to grant to all pages in this context. See browserContext.grantPermissions for more details.","returnComment":"","required":false},"extraHTTPHeaders":{"kind":"property","name":"extraHTTPHeaders","type":{"name":"Object<string, string>"},"comment":"An object containing additional HTTP headers to be sent with every request. All header values must be strings.","returnComment":"","required":false},"offline":{"kind":"property","name":"offline","type":{"name":"boolean"},"comment":"Whether to emulate network being offline. Defaults to `false`.","returnComment":"","required":false},"httpCredentials":{"kind":"property","name":"httpCredentials","type":{"name":"Object","properties":{"username":{"kind":"property","name":"username","type":{"name":"string"},"comment":"","returnComment":"","required":true},"password":{"kind":"property","name":"password","type":{"name":"string"},"comment":"","returnComment":"","required":true}}},"comment":"Credentials for HTTP authentication.","returnComment":"","required":false},"colorScheme":{"kind":"property","name":"colorScheme","type":{"name":"\"dark\"|\"light\"|\"no-preference\""},"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See page.emulateMedia(options) for more details. Defaults to '`light`'.","returnComment":"","required":false},"logger":{"kind":"property","name":"logger","type":{"name":"Logger"},"comment":"Logger sink for Playwright logging.","returnComment":"","required":false},"videosPath":{"kind":"property","name":"videosPath","type":{"name":"string"},"comment":"Enables video recording for all pages to `videosPath` folder. If not specified, videos are not recorded.","returnComment":"","required":false},"videoSize":{"kind":"property","name":"videoSize","type":{"name":"Object","properties":{"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"Video frame width.","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"Video frame height.","returnComment":"","required":true}}},"comment":"Specifies dimensions of the automatically recorded video. Can only be used if `videosPath` is set. If not specified the size will be equal to `viewport`. If `viewport` is not configured explicitly the video size defaults to 1280x720. Actual picture of the page will be scaled down if necessary to fit specified size.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"version":{"kind":"method","name":"version","type":{"name":"string"},"comment":"Returns the browser version.","returnComment":"","required":true,"args":{}}}},"BrowserContext":{"name":"BrowserContext","extends":"EventEmitter","members":{"close":{"kind":"method","name":"close","type":{"name":"Promise"},"comment":"Closes the browser context. All the pages that belong to the browser context\nwill be closed.\n\n**NOTE** the default browser context cannot be closed.","returnComment":"","required":true,"args":{}},"page":{"kind":"event","name":"page","type":{"name":"Page"},"comment":"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 `Page.on('popup')` to receive events about popups relevant to a specific page.\nThe 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.\n```js\nconst [page] = await Promise.all([\n context.waitForEvent('page'),\n page.click('a[target=_blank]'),\n]);\nconsole.log(await page.evaluate('location.href'));\n```\n\n**NOTE** Use `page.waitForLoadState([state[, options]])` to wait until the page gets to a particular state (you should not need it in most cases).","returnComment":"","required":true,"args":{}},"addCookies":{"kind":"method","name":"addCookies","type":{"name":"Promise"},"comment":"```js\nawait browserContext.addCookies([cookieObject1, cookieObject2]);\n```","returnComment":"","required":true,"args":{"cookies":{"kind":"property","name":"cookies","type":{"name":"Array<Object>","properties":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"**required**","returnComment":"","required":true},"value":{"kind":"property","name":"value","type":{"name":"string"},"comment":"**required**","returnComment":"","required":true},"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"either url or domain / path are required","returnComment":"","required":false},"domain":{"kind":"property","name":"domain","type":{"name":"string"},"comment":"either url or domain / path are required","returnComment":"","required":false},"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"either url or domain / path are required","returnComment":"","required":false},"expires":{"kind":"property","name":"expires","type":{"name":"number"},"comment":"Unix time in seconds.","returnComment":"","required":false},"httpOnly":{"kind":"property","name":"httpOnly","type":{"name":"boolean"},"comment":"","returnComment":"","required":false},"secure":{"kind":"property","name":"secure","type":{"name":"boolean"},"comment":"","returnComment":"","required":false},"sameSite":{"kind":"property","name":"sameSite","type":{"name":"\"Lax\"|\"None\"|\"Strict\""},"comment":"","returnComment":"","required":false}}},"comment":"","returnComment":"","required":true,"order":0}}},"addInitScript":{"kind":"method","name":"addInitScript","type":{"name":"Promise"},"comment":"Adds a script which would be evaluated in one of the following scenarios:\n\nWhenever a page is created in the browser context or is navigated.\nWhenever 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.\n\nThe 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`.\nAn example of overriding `Math.random` before the page loads:\n```js\n// preload.js\nMath.random = () => 42;\n```\n```js\n// In your playwright script, assuming the preload.js file is in same folder.\nawait browserContext.addInitScript({\n path: 'preload.js'\n});\n```\n\n**NOTE** The order of evaluation of multiple scripts installed via browserContext.addInitScript(script[, arg]) and page.addInitScript(script[, arg]) is not defined.","returnComment":"","required":true,"args":{"script":{"kind":"property","name":"script","type":{"name":"function|string|Object","properties":{"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to current working directory.","returnComment":"","required":false},"content":{"kind":"property","name":"content","type":{"name":"string"},"comment":"Raw script content.","returnComment":"","required":false}}},"comment":"Script to be evaluated in all pages in the browser context.","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"Serializable"},"comment":"Optional argument to pass to `script` (only supported when passing a function).","returnComment":"","required":false,"order":1}}},"browser":{"kind":"method","name":"browser","type":{"name":"null|Browser"},"comment":"","returnComment":"Returns the browser instance of the context. If it was launched as a persistent context null gets returned.","required":true,"args":{}},"clearCookies":{"kind":"method","name":"clearCookies","type":{"name":"Promise"},"comment":"Clears context cookies.","returnComment":"","required":true,"args":{}},"clearPermissions":{"kind":"method","name":"clearPermissions","type":{"name":"Promise"},"comment":"Clears all permission overrides for the browser context.\n```js\nconst context = await browser.newContext();\nawait context.grantPermissions(['clipboard-read']);\n// do stuff ..\ncontext.clearPermissions();\n```","returnComment":"","required":true,"args":{}},"cookies":{"kind":"method","name":"cookies","type":{"name":"Promise<Array<Object>>","properties":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"","returnComment":"","required":true},"value":{"kind":"property","name":"value","type":{"name":"string"},"comment":"","returnComment":"","required":true},"domain":{"kind":"property","name":"domain","type":{"name":"string"},"comment":"","returnComment":"","required":true},"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"","returnComment":"","required":true},"expires":{"kind":"property","name":"expires","type":{"name":"number"},"comment":"Unix time in seconds.","returnComment":"","required":true},"httpOnly":{"kind":"property","name":"httpOnly","type":{"name":"boolean"},"comment":"","returnComment":"","required":true},"secure":{"kind":"property","name":"secure","type":{"name":"boolean"},"comment":"","returnComment":"","required":true},"sameSite":{"kind":"property","name":"sameSite","type":{"name":"\"Lax\"|\"None\"|\"Strict\""},"comment":"","returnComment":"","required":true}}},"comment":"If no URLs are specified, this method returns all cookies.\nIf URLs are specified, only cookies that affect those URLs are returned.","returnComment":"","required":true,"args":{"urls":{"kind":"property","name":"urls","type":{"name":"string|Array<string>"},"comment":"","returnComment":"","required":false,"order":0}}},"exposeBinding":{"kind":"method","name":"exposeBinding","type":{"name":"Promise"},"comment":"The method adds a function called `name` on the `window` object of every frame in every page in the context.\nWhen called, the function executes `playwrightBinding` in Node.js and returns a Promise which resolves to the return value of `playwrightBinding`.\nIf the `playwrightBinding` returns a Promise, it will be awaited.\nThe first argument of the `playwrightBinding` function contains information about the caller:\n`{ browserContext: BrowserContext, page: Page, frame: Frame }`.\nSee page.exposeBinding(name, playwrightBinding) for page-only version.\nAn example of exposing page URL to all frames in all pages in the context:\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 <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.pageURL();\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n `);\n await page.click('button');\n})();\n```\nAn example of passing an element handle:\n```js\nawait context.exposeBinding('clicked', async (source, element) => {\n console.log(await element.textContent());\n}, { handle: true });\nawait page.setContent(`\n <script>\n document.addEventListener('click', event => window.clicked(event.target));\n </script>\n <div>Click me</div>\n <div>Or click me</div>\n`);\n```","returnComment":"","required":true,"args":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"Name of the function on the window object.","returnComment":"","required":true,"order":0},"playwrightBinding":{"kind":"property","name":"playwrightBinding","type":{"name":"function"},"comment":"Callback function that will be called in the Playwright's context.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"handle":{"kind":"property","name":"handle","type":{"name":"boolean"},"comment":"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.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"exposeFunction":{"kind":"method","name":"exposeFunction","type":{"name":"Promise"},"comment":"The method adds a function called `name` on the `window` object of every frame in every page in the context.\nWhen called, the function executes `playwrightFunction` in Node.js and returns a Promise which resolves to the return value of `playwrightFunction`.\nIf the `playwrightFunction` returns a Promise, it will be awaited.\nSee page.exposeFunction(name, playwrightFunction) for page-only version.\nAn example of adding an `md5` function to all pages in the context:\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('md5', text => crypto.createHash('md5').update(text).digest('hex'));\n const page = await context.newPage();\n await page.setContent(`\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.md5('PLAYWRIGHT');\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n `);\n await page.click('button');\n})();\n```","returnComment":"","required":true,"args":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"Name of the function on the window object.","returnComment":"","required":true,"order":0},"playwrightFunction":{"kind":"property","name":"playwrightFunction","type":{"name":"function"},"comment":"Callback function that will be called in the Playwright's context.","returnComment":"","required":true,"order":1}}},"grantPermissions":{"kind":"method","name":"grantPermissions","type":{"name":"Promise"},"comment":"Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if specified.","returnComment":"","required":true,"args":{"permissions":{"kind":"property","name":"permissions","type":{"name":"Array<string>"},"comment":"A permission or an array of permissions to grant. Permissions can be one of the following values:\n - `'*'`\n - `'geolocation'`\n - `'midi'`\n - `'midi-sysex'` (system-exclusive midi)\n - `'notifications'`\n - `'push'`\n - `'camera'`\n - `'microphone'`\n - `'background-sync'`\n - `'ambient-light-sensor'`\n - `'accelerometer'`\n - `'gyroscope'`\n - `'magnetometer'`\n - `'accessibility-events'`\n - `'clipboard-read'`\n - `'clipboard-write'`\n - `'payment-handler'`","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"origin":{"kind":"property","name":"origin","type":{"name":"string"},"comment":"The origin to grant permissions to, e.g. \"https://example.com\".","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"newPage":{"kind":"method","name":"newPage","type":{"name":"Promise<Page>"},"comment":"Creates a new page in the browser context.","returnComment":"","required":true,"args":{}},"pages":{"kind":"method","name":"pages","type":{"name":"Array<Page>"},"comment":"","returnComment":"All open pages in the context. Non visible pages, such as `\"background_page\"`, will not be listed here. You can find them using chromiumBrowserContext.backgroundPages().","required":true,"args":{}},"route":{"kind":"method","name":"route","type":{"name":"Promise"},"comment":"Routing provides the capability to modify network requests that are made by any page in the browser context.\nOnce route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted.\nAn example of a naïve handler that aborts all image requests:\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```\nor the same snippet using a regex pattern instead:\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```\nPage routes (set up with page.route(url, handler)) take precedence over browser context routes when request matches both handlers.\n\n**NOTE** Enabling routing disables http cache.","returnComment":"","required":true,"args":{"url":{"kind":"property","name":"url","type":{"name":"string|RegExp|function(URL):boolean"},"comment":"A glob pattern, regex pattern or predicate receiving URL to match while routing.","returnComment":"","required":true,"order":0},"handler":{"kind":"property","name":"handler","type":{"name":"function(Route, Request)"},"comment":"handler function to route the request.","returnComment":"","required":true,"order":1}}},"setDefaultNavigationTimeout":{"kind":"method","name":"setDefaultNavigationTimeout","type":null,"comment":"This setting will change the default maximum navigation time for the following methods and related shortcuts:\n\npage.goBack([options])\npage.goForward([options])\npage.goto(url[, options])\npage.reload([options])\npage.setContent(html[, options])\npage.waitForNavigation([options])\n\n\n**NOTE** `page.setDefaultNavigationTimeout` and `page.setDefaultTimeout` take priority over `browserContext.setDefaultNavigationTimeout`.","returnComment":"","required":true,"args":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds","returnComment":"","required":true,"order":0}}},"setDefaultTimeout":{"kind":"method","name":"setDefaultTimeout","type":null,"comment":"This setting will change the default maximum time for all the methods accepting `timeout` option.\n\n**NOTE** `page.setDefaultNavigationTimeout`, `page.setDefaultTimeout` and `browserContext.setDefaultNavigationTimeout` take priority over `browserContext.setDefaultTimeout`.","returnComment":"","required":true,"args":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds","returnComment":"","required":true,"order":0}}},"setExtraHTTPHeaders":{"kind":"method","name":"setExtraHTTPHeaders","type":{"name":"Promise"},"comment":"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 page.setExtraHTTPHeaders(). If page overrides a particular header, page-specific header value will be used instead of the browser context header value.\n\n**NOTE** `browserContext.setExtraHTTPHeaders` does not guarantee the order of headers in the outgoing requests.","returnComment":"","required":true,"args":{"headers":{"kind":"property","name":"headers","type":{"name":"Object<string, string>"},"comment":"An object containing additional HTTP headers to be sent with every request. All header values must be strings.","returnComment":"","required":true,"order":0}}},"setGeolocation":{"kind":"method","name":"setGeolocation","type":{"name":"Promise"},"comment":"Sets the context's geolocation. Passing `null` or `undefined` emulates position unavailable.\n```js\nawait browserContext.setGeolocation({latitude: 59.95, longitude: 30.31667});\n```\n\n**NOTE** Consider using browserContext.grantPermissions to grant permissions for the browser context pages to read its geolocation.","returnComment":"","required":true,"args":{"geolocation":{"kind":"property","name":"geolocation","type":{"name":"null|Object","properties":{"latitude":{"kind":"property","name":"latitude","type":{"name":"number"},"comment":"Latitude between -90 and 90. **required**","returnComment":"","required":true},"longitude":{"kind":"property","name":"longitude","type":{"name":"number"},"comment":"Longitude between -180 and 180. **required**","returnComment":"","required":true},"accuracy":{"kind":"property","name":"accuracy","type":{"name":"number"},"comment":"Non-negative accuracy value. Defaults to `0`.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":true,"order":0}}},"setHTTPCredentials":{"kind":"method","name":"setHTTPCredentials","type":{"name":"Promise"},"comment":"Provide credentials for HTTP authentication.\n\n**NOTE** Browsers may cache credentials after successful authentication. Passing different credentials or passing `null` to disable authentication will be unreliable. To remove or replace credentials, create a new browser context instead.","returnComment":"","required":true,"args":{"httpCredentials":{"kind":"property","name":"httpCredentials","type":{"name":"null|Object","properties":{"username":{"kind":"property","name":"username","type":{"name":"string"},"comment":"**required**","returnComment":"","required":true},"password":{"kind":"property","name":"password","type":{"name":"string"},"comment":"**required**","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true,"order":0}}},"setOffline":{"kind":"method","name":"setOffline","type":{"name":"Promise"},"comment":"","returnComment":"","required":true,"args":{"offline":{"kind":"property","name":"offline","type":{"name":"boolean"},"comment":"Whether to emulate network being offline for the browser context.","returnComment":"","required":true,"order":0}}},"unroute":{"kind":"method","name":"unroute","type":{"name":"Promise"},"comment":"Removes a route created with browserContext.route(url, handler). When `handler` is not specified, removes all routes for the `url`.","returnComment":"","required":true,"args":{"url":{"kind":"property","name":"url","type":{"name":"string|RegExp|function(URL):boolean"},"comment":"A glob pattern, regex pattern or predicate receiving URL used to register a routing with browserContext.route(url, handler).","returnComment":"","required":true,"order":0},"handler":{"kind":"property","name":"handler","type":{"name":"function(Route, Request)"},"comment":"Handler function used to register a routing with browserContext.route(url, handler).","returnComment":"","required":false,"order":1}}},"waitForEvent":{"kind":"method","name":"waitForEvent","type":{"name":"Promise<Object>"},"comment":"Waits for event to fire and passes its value into the predicate function. Resolves when the predicate returns truthy value. Will throw an error if the context closes before the event\nis fired.\n```js\nconst context = await browser.newContext();\nawait context.grantPermissions(['geolocation']);\n```","returnComment":"Promise which resolves to the event data value.","required":true,"args":{"event":{"kind":"property","name":"event","type":{"name":"string"},"comment":"Event name, same one would pass into `browserContext.on(event)`.","returnComment":"","required":true,"order":0},"optionsOrPredicate":{"kind":"property","name":"optionsOrPredicate","type":{"name":"Function|Object","properties":{"predicate":{"kind":"property","name":"predicate","type":{"name":"Function"},"comment":"receives the event data and resolves to truthy value when the waiting should resolve.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"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 browserContext.setDefaultTimeout(timeout).","returnComment":"","required":false}}},"comment":"Either a predicate that receives an event or an options object.","returnComment":"","required":false,"order":1}}}}},"Page":{"name":"Page","extends":"EventEmitter","members":{"close":{"kind":"method","name":"close","type":{"name":"Promise"},"comment":"If `runBeforeUnload` is `false` the result will resolve only after the page has been closed.\nIf `runBeforeUnload` is `true` the method will **not** wait for the page to close.\nBy default, `page.close()` **does not** run beforeunload handlers.\n\n**NOTE** if `runBeforeUnload` is passed as true, a `beforeunload` dialog might be summoned\nand should be handled manually via page's 'dialog' event.","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"runBeforeUnload":{"kind":"property","name":"runBeforeUnload","type":{"name":"boolean"},"comment":"Defaults to `false`. Whether to run the\nbefore unload\npage handlers.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"console":{"kind":"event","name":"console","type":{"name":"ConsoleMessage"},"comment":"Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also emitted if the page throws an error or a warning.\nThe arguments passed into `console.log` appear as arguments on the event handler.\nAn example of handling `console` event:\n```js\npage.on('console', msg => {\n for (let i = 0; i < msg.args().length; ++i)\n console.log(`${i}: ${msg.args()[i]}`);\n});\npage.evaluate(() => console.log('hello', 5, {foo: 'bar'}));\n```","returnComment":"","required":true,"args":{}},"crash":{"kind":"event","name":"crash","type":null,"comment":"Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page crashes, ongoing and subsequent operations will throw.\nThe most common way to deal with crashes is to catch an exception:\n```js\ntry {\n // Crash might happen during a click.\n await page.click('button');\n // Or while waiting for an event.\n await page.waitForEvent('popup');\n} catch (e) {\n // When the page crashes, exception message contains 'crash'.\n}\n```\nHowever, when manually listening to events, it might be useful to avoid stalling when the page crashes. In this case, handling `crash` event helps:\n```js\nawait new Promise((resolve, reject) => {\n page.on('requestfinished', async request => {\n if (await someProcessing(request))\n resolve(request);\n });\n page.on('crash', error => reject(error));\n});\n```","returnComment":"","required":true,"args":{}},"dialog":{"kind":"event","name":"dialog","type":{"name":"Dialog"},"comment":"Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Playwright can respond to the dialog via Dialog's accept or dismiss methods.","returnComment":"","required":true,"args":{}},"domcontentloaded":{"kind":"event","name":"domcontentloaded","type":null,"comment":"Emitted when the JavaScript `DOMContentLoaded` event is dispatched.","returnComment":"","required":true,"args":{}},"download":{"kind":"event","name":"download","type":{"name":"Download"},"comment":"Emitted when attachment download started. User can access basic file operations on downloaded content via the passed Download instance.\n\n**NOTE** Browser context **must** be created with the `acceptDownloads` set to `true` when user needs access to the downloaded content. If `acceptDownloads` is not set or set to `false`, download events are emitted, but the actual download is not performed and user has no access to the downloaded files.","returnComment":"","required":true,"args":{}},"filechooser":{"kind":"event","name":"filechooser","type":{"name":"FileChooser"},"comment":"Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can respond to it via setting the input files using `fileChooser.setFiles` that can be uploaded after that.\n```js\npage.on('filechooser', async (fileChooser) => {\n await fileChooser.setFiles('/tmp/myfile.pdf');\n});\n```","returnComment":"","required":true,"args":{}},"frameattached":{"kind":"event","name":"frameattached","type":{"name":"Frame"},"comment":"Emitted when a frame is attached.","returnComment":"","required":true,"args":{}},"framedetached":{"kind":"event","name":"framedetached","type":{"name":"Frame"},"comment":"Emitted when a frame is detached.","returnComment":"","required":true,"args":{}},"framenavigated":{"kind":"event","name":"framenavigated","type":{"name":"Frame"},"comment":"Emitted when a frame is navigated to a new url.","returnComment":"","required":true,"args":{}},"load":{"kind":"event","name":"load","type":null,"comment":"Emitted when the JavaScript `load` event is dispatched.","returnComment":"","required":true,"args":{}},"pageerror":{"kind":"event","name":"pageerror","type":{"name":"Error"},"comment":"Emitted when an uncaught exception happens within the page.","returnComment":"","required":true,"args":{}},"popup":{"kind":"event","name":"popup","type":{"name":"Page"},"comment":"Emitted when the page opens a new tab or window. This event is emitted in addition to the `browserContext.on('page')`, but only for popups relevant to this page.\nThe 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.\n```js\nconst [popup] = await Promise.all([\n page.waitForEvent('popup'),\n page.evaluate(() => window.open('https://example.com')),\n]);\nconsole.log(await popup.evaluate('location.href'));\n```\n\n**NOTE** Use `page.waitForLoadState([state[, options]])` to wait until the page gets to a particular state (you should not need it in most cases).","returnComment":"","required":true,"args":{}},"request":{"kind":"event","name":"request","type":{"name":"Request"},"comment":"Emitted when a page issues a request. The request object is read-only.\nIn order to intercept and mutate requests, see `page.route()` or `browserContext.route()`.","returnComment":"","required":true,"args":{}},"requestfailed":{"kind":"event","name":"requestfailed","type":{"name":"Request"},"comment":"Emitted when a request fails, for example by timing out.\n\n**NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with `'requestfinished'` event and not with `'requestfailed'`.","returnComment":"","required":true,"args":{}},"requestfinished":{"kind":"event","name":"requestfinished","type":{"name":"Request"},"comment":"Emitted when a request finishes successfully after downloading the response body. For a successful response, the sequence of events is `request`, `response` and `requestfinished`.","returnComment":"","required":true,"args":{}},"response":{"kind":"event","name":"response","type":{"name":"Response"},"comment":"Emitted when response status and headers are received for a request. For a successful response, the sequence of events is `request`, `response` and `requestfinished`.","returnComment":"","required":true,"args":{}},"worker":{"kind":"event","name":"worker","type":{"name":"Worker"},"comment":"Emitted when a dedicated WebWorker is spawned by the page.","returnComment":"","required":true,"args":{}},"$":{"kind":"method","name":"$","type":{"name":"Promise<null|ElementHandle>"},"comment":"The method finds an element matching the specified selector within the page. If no elements match the selector, the return value resolves to `null`.\nShortcut for page.mainFrame().$(selector).","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query page for. See working with selectors for more details.","returnComment":"","required":true,"order":0}}},"$$":{"kind":"method","name":"$$","type":{"name":"Promise<Array<ElementHandle>>"},"comment":"The method finds all elements matching the specified selector within the page. If no elements match the selector, the return value resolves to `[]`.\nShortcut for page.mainFrame().$$(selector).","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query page for. See working with selectors for more details.","returnComment":"","required":true,"order":0}}},"$eval":{"kind":"method","name":"$eval","type":{"name":"Promise<Serializable>"},"comment":"The method finds an element matching the specified selector within the page and passes it as a first argument to `pageFunction`. If no elements match the selector, the method throws an error.\nIf `pageFunction` returns a Promise, then `page.$eval` would wait for the promise to resolve and return its value.\nExamples:\n```js\nconst searchValue = await page.$eval('#search', el => el.value);\nconst preloadHref = await page.$eval('link[rel=preload]', el => el.href);\nconst html = await page.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');\n```\nShortcut for page.mainFrame().$eval(selector, pageFunction).","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query page for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function(Element)"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":1},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":2}}},"$$eval":{"kind":"method","name":"$$eval","type":{"name":"Promise<Serializable>"},"comment":"The method finds all elements matching the specified selector within the page and passes an array of matched elements as a first argument to `pageFunction`.\nIf `pageFunction` returns a Promise, then `page.$$eval` would wait for the promise to resolve and return its value.\nExamples:\n```js\nconst divsCounts = await page.$$eval('div', (divs, min) => divs.length >= min, 10);\n```","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query page for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function(Array<Element>)"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":1},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":2}}},"accessibility":{"kind":"property","name":"accessibility","type":{"name":"Accessibility"},"comment":"","returnComment":"","required":true,"args":{}},"addInitScript":{"kind":"method","name":"addInitScript","type":{"name":"Promise"},"comment":"Adds a script which would be evaluated in one of the following scenarios:\n\nWhenever the page is navigated.\nWhenever the child frame is attached or navigated. In this case, the script is 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 amend the JavaScript environment, e.g. to seed `Math.random`.\nAn example of overriding `Math.random` before the page loads:\n```js\n// preload.js\nMath.random = () => 42;\n\n// In your playwright script, assuming the preload.js file is in same folder\nconst preloadFile = fs.readFileSync('./preload.js', 'utf8');\nawait page.addInitScript(preloadFile);\n```\n\n**NOTE** The order of evaluation of multiple scripts installed via browserContext.addInitScript(script[, arg]) and page.addInitScript(script[, arg]) is not defined.","returnComment":"","required":true,"args":{"script":{"kind":"property","name":"script","type":{"name":"function|string|Object","properties":{"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to current working directory.","returnComment":"","required":false},"content":{"kind":"property","name":"content","type":{"name":"string"},"comment":"Raw script content.","returnComment":"","required":false}}},"comment":"Script to be evaluated in the page.","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"Serializable"},"comment":"Optional argument to pass to `script` (only supported when passing a function).","returnComment":"","required":false,"order":1}}},"addScriptTag":{"kind":"method","name":"addScriptTag","type":{"name":"Promise<ElementHandle>"},"comment":"Adds a `<script>` tag into the page with the desired url or content.\nShortcut for page.mainFrame().addScriptTag(options).","returnComment":"which resolves to the added tag when the script's onload fires or when the script content was injected into frame.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"URL of a script to be added.","returnComment":"","required":false},"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to current working directory.","returnComment":"","required":false},"content":{"kind":"property","name":"content","type":{"name":"string"},"comment":"Raw JavaScript content to be injected into frame.","returnComment":"","required":false},"type":{"kind":"property","name":"type","type":{"name":"string"},"comment":"Script type. Use 'module' in order to load a Javascript ES6 module. See script for more details.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":true,"order":0}}},"addStyleTag":{"kind":"method","name":"addStyleTag","type":{"name":"Promise<ElementHandle>"},"comment":"Adds a `<link rel=\"stylesheet\">` tag into the page with the desired url or a `<style type=\"text/css\">` tag with the content.\nShortcut for page.mainFrame().addStyleTag(options).","returnComment":"which resolves to the added tag when the stylesheet's onload fires or when the CSS content was injected into frame.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"URL of the `<link>` tag.","returnComment":"","required":false},"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to current working directory.","returnComment":"","required":false},"content":{"kind":"property","name":"content","type":{"name":"string"},"comment":"Raw CSS content to be injected into frame.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":true,"order":0}}},"bringToFront":{"kind":"method","name":"bringToFront","type":{"name":"Promise"},"comment":"Brings page to front (activates tab).","returnComment":"","required":true,"args":{}},"check":{"kind":"method","name":"check","type":{"name":"Promise"},"comment":"This method checks an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nEnsure that matched element is a checkbox or a radio input. If not, this method rejects. If the element is already checked, this method returns immediately.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\nEnsure that the element is now checked. If not, this method rejects.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.\nShortcut for page.mainFrame().check(selector[, options]).","returnComment":"Promise that resolves when the element matching `selector` is successfully checked.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for checkbox or radio button to check. If there are multiple elements satisfying the selector, the first will be checked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"click":{"kind":"method","name":"click","type":{"name":"Promise"},"comment":"This method clicks an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element, or the specified `position`.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.\nShortcut for page.mainFrame().click(selector[, options]).","returnComment":"Promise that resolves when the element matching `selector` is successfully clicked.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"clickCount":{"kind":"property","name":"clickCount","type":{"name":"number"},"comment":"defaults to 1. See UIEvent.detail.","returnComment":"","required":false},"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"content":{"kind":"method","name":"content","type":{"name":"Promise<string>"},"comment":"Gets the full HTML contents of the page, including the doctype.","returnComment":"","required":true,"args":{}},"context":{"kind":"method","name":"context","type":{"name":"BrowserContext"},"comment":"Get the browser context that the page belongs to.","returnComment":"","required":true,"args":{}},"coverage":{"kind":"property","name":"coverage","type":{"name":"null|ChromiumCoverage"},"comment":"Browser-specific Coverage implementation, only available for Chromium atm. See ChromiumCoverage for more details.","returnComment":"","required":true,"args":{}},"dblclick":{"kind":"method","name":"dblclick","type":{"name":"Promise"},"comment":"This method double clicks an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to double click in the center of the element, or the specified `position`.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the first click of the `dblclick()` triggers a navigation event, this method will reject.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.\n\n**NOTE** `page.dblclick()` dispatches two `click` events and a single `dblclick` event.\n\nShortcut for page.mainFrame().dblclick(selector[, options]).","returnComment":"Promise that resolves when the element matching `selector` is successfully double clicked.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to double click. If there are multiple elements satisfying the selector, the first will be double clicked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"dispatchEvent":{"kind":"method","name":"dispatchEvent","type":{"name":"Promise"},"comment":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the elment, `click` is dispatched. This is equivalend to calling `element.click()`.\n```js\nawait page.dispatchEvent('button#submit', 'click');\n```\nUnder 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.\nSince `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:\n\nDragEvent\nFocusEvent\nKeyboardEvent\nMouseEvent\nPointerEvent\nTouchEvent\nEvent\n\nYou can also specify `JSHandle` as the property value if you want live objects to be passed into the event:\n```js\n// Note you can only create DataTransfer in Chromium and Firefox\nconst dataTransfer = await page.evaluateHandle(() => new DataTransfer());\nawait page.dispatchEvent('#source', 'dragstart', { dataTransfer });\n```","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to use. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.","returnComment":"","required":true,"order":0},"type":{"kind":"property","name":"type","type":{"name":"string"},"comment":"DOM event type: `\"click\"`, `\"dragstart\"`, etc.","returnComment":"","required":true,"order":1},"eventInit":{"kind":"property","name":"eventInit","type":{"name":"EvaluationArgument"},"comment":"event-specific initialization properties.","returnComment":"","required":false,"order":2},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":3}}},"emulateMedia":{"kind":"method","name":"emulateMedia","type":{"name":"Promise"},"comment":"```js\nawait page.evaluate(() => matchMedia('screen').matches);\n// → true\nawait page.evaluate(() => matchMedia('print').matches);\n// → false\n\nawait page.emulateMedia({ media: 'print' });\nawait page.evaluate(() => matchMedia('screen').matches);\n// → false\nawait page.evaluate(() => matchMedia('print').matches);\n// → true\n\nawait page.emulateMedia({});\nawait page.evaluate(() => matchMedia('screen').matches);\n// → true\nawait page.evaluate(() => matchMedia('print').matches);\n// → false\n```\n```js\nawait page.emulateMedia({ colorScheme: 'dark' }] });\nawait page.evaluate(() => matchMedia('(prefers-color-scheme: dark)').matches);\n// → true\nawait page.evaluate(() => matchMedia('(prefers-color-scheme: light)').matches);\n// → false\nawait page.evaluate(() => matchMedia('(prefers-color-scheme: no-preference)').matches);\n// → false\n```","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"media":{"kind":"property","name":"media","type":{"name":"null|\"print\"|\"screen\""},"comment":"Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`. Passing `null` disables CSS media emulation. Omitting `media` or passing `undefined` does not change the emulated value.","returnComment":"","required":false},"colorScheme":{"kind":"property","name":"colorScheme","type":{"name":"null|\"dark\"|\"light\"|\"no-preference\""},"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. Passing `null` disables color scheme emulation. Omitting `colorScheme` or passing `undefined` does not change the emulated value.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":true,"order":0}}},"evaluate":{"kind":"method","name":"evaluate","type":{"name":"Promise<Serializable>"},"comment":"If the function passed to the `page.evaluate` returns a Promise, then `page.evaluate` would wait for the promise to resolve and return its value.\nIf the function passed to the `page.evaluate` returns a non-Serializable value, then `page.evaluate` resolves to `undefined`. DevTools Protocol also supports transferring some additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`, and bigint literals.\nPassing argument to `pageFunction`:\n```js\nconst result = await page.evaluate(([x, y]) => {\n return Promise.resolve(x * y);\n}, [7, 8]);\nconsole.log(result); // prints \"56\"\n```\nA string can also be passed in instead of a function:\n```js\nconsole.log(await page.evaluate('1 + 2')); // prints \"3\"\nconst x = 10;\nconsole.log(await page.evaluate(`1 + ${x}`)); // prints \"11\"\n```\nElementHandle instances can be passed as an argument to the `page.evaluate`:\n```js\nconst bodyHandle = await page.$('body');\nconst html = await page.evaluate(([body, suffix]) => body.innerHTML + suffix, [bodyHandle, 'hello']);\nawait bodyHandle.dispose();\n```\nShortcut for page.mainFrame().evaluate(pageFunction[, arg]).","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated in the page context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1}}},"evaluateHandle":{"kind":"method","name":"evaluateHandle","type":{"name":"Promise<JSHandle>"},"comment":"The only difference between `page.evaluate` and `page.evaluateHandle` is that `page.evaluateHandle` returns in-page object (JSHandle).\nIf the function passed to the `page.evaluateHandle` returns a Promise, then `page.evaluateHandle` would wait for the promise to resolve and return its value.\nA string can also be passed in instead of a function:\n```js\nconst aHandle = await page.evaluateHandle('document'); // Handle for the 'document'\n```\nJSHandle instances can be passed as an argument to the `page.evaluateHandle`:\n```js\nconst aHandle = await page.evaluateHandle(() => document.body);\nconst resultHandle = await page.evaluateHandle(body => body.innerHTML, aHandle);\nconsole.log(await resultHandle.jsonValue());\nawait resultHandle.dispose();\n```","returnComment":"Promise which resolves to the return value of `pageFunction` as in-page object (JSHandle)","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated in the page context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1}}},"exposeBinding":{"kind":"method","name":"exposeBinding","type":{"name":"Promise"},"comment":"The method adds a function called `name` on the `window` object of every frame in this page.\nWhen called, the function executes `playwrightBinding` in Node.js and returns a Promise which resolves to the return value of `playwrightBinding`.\nIf the `playwrightBinding` returns a Promise, it will be awaited.\nThe first argument of the `playwrightBinding` function contains information about the caller:\n`{ browserContext: BrowserContext, page: Page, frame: Frame }`.\nSee browserContext.exposeBinding(name, playwrightBinding) for the context-wide version.\n\n**NOTE** Functions installed via `page.exposeBinding` survive navigations.\n\nAn example of exposing page URL to all frames in a page:\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 const page = await context.newPage();\n await page.exposeBinding('pageURL', ({ page }) => page.url());\n await page.setContent(`\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.pageURL();\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n `);\n await page.click('button');\n})();\n```\nAn example of passing an element handle:\n```js\nawait page.exposeBinding('clicked', async (source, element) => {\n console.log(await element.textContent());\n}, { handle: true });\nawait page.setContent(`\n <script>\n document.addEventListener('click', event => window.clicked(event.target));\n </script>\n <div>Click me</div>\n <div>Or click me</div>\n`);\n```","returnComment":"","required":true,"args":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"Name of the function on the window object.","returnComment":"","required":true,"order":0},"playwrightBinding":{"kind":"property","name":"playwrightBinding","type":{"name":"function"},"comment":"Callback function that will be called in the Playwright's context.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"handle":{"kind":"property","name":"handle","type":{"name":"boolean"},"comment":"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.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"exposeFunction":{"kind":"method","name":"exposeFunction","type":{"name":"Promise"},"comment":"The method adds a function called `name` on the `window` object of every frame in the page.\nWhen called, the function executes `playwrightFunction` in Node.js and returns a Promise which resolves to the return value of `playwrightFunction`.\nIf the `playwrightFunction` returns a Promise, it will be awaited.\nSee browserContext.exposeFunction(name, playwrightFunction) for context-wide exposed function.\n\n**NOTE** Functions installed via `page.exposeFunction` survive navigations.\n\nAn example of adding an `md5` function to the page:\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 page = await browser.newPage();\n await page.exposeFunction('md5', text => crypto.createHash('md5').update(text).digest('hex'));\n await page.setContent(`\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.md5('PLAYWRIGHT');\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n `);\n await page.click('button');\n})();\n```\nAn example of adding a `window.readfile` function to the page:\n```js\nconst { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\nconst fs = require('fs');\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n page.on('console', msg => console.log(msg.text()));\n await page.exposeFunction('readfile', async filePath => {\n return new Promise((resolve, reject) => {\n fs.readFile(filePath, 'utf8', (err, text) => {\n if (err)\n reject(err);\n else\n resolve(text);\n });\n });\n });\n await page.evaluate(async () => {\n // use window.readfile to read contents of a file\n const content = await window.readfile('/etc/hosts');\n console.log(content);\n });\n await browser.close();\n})();\n```","returnComment":"","required":true,"args":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"Name of the function on the window object","returnComment":"","required":true,"order":0},"playwrightFunction":{"kind":"property","name":"playwrightFunction","type":{"name":"function"},"comment":"Callback function which will be called in Playwright's context.","returnComment":"","required":true,"order":1}}},"fill":{"kind":"method","name":"fill","type":{"name":"Promise"},"comment":"This method waits for an element matching `selector`, waits for actionability checks, focuses the element, fills it and triggers an `input` event after filling.\nIf the element matching `selector` is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.\nNote that you can pass an empty string to clear the input field.\nTo send fine-grained keyboard events, use `page.type`.\nShortcut for page.mainFrame().fill()","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query page for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"value":{"kind":"property","name":"value","type":{"name":"string"},"comment":"Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"focus":{"kind":"method","name":"focus","type":{"name":"Promise"},"comment":"This method fetches an element with `selector` and focuses it.\nIf there's no element matching `selector`, the method waits until a matching element appears in the DOM.\nShortcut for page.mainFrame().focus(selector).","returnComment":"Promise which resolves when the element matching `selector` is successfully focused. The promise will be rejected if there is no element matching `selector`.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to focus. If there are multiple elements satisfying the selector, the first will be focused. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"frame":{"kind":"method","name":"frame","type":{"name":"null|Frame"},"comment":"```js\nconst frame = page.frame('frame-name');\n```\n```js\nconst frame = page.frame({ url: /.*domain.*/ });\n```\nReturns frame matching the specified criteria. Either `name` or `url` must be specified.","returnComment":"frame matching the criteria. Returns `null` if no frame matches.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"string|Object","properties":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"frame name specified in the `iframe`'s `name` attribute","returnComment":"","required":false},"url":{"kind":"property","name":"url","type":{"name":"string|RegExp|Function"},"comment":"A glob pattern, regex pattern or predicate receiving frame's `url` as a URL object.","returnComment":"","required":false}}},"comment":"Frame name or other frame lookup options.","returnComment":"","required":true,"order":0}}},"frames":{"kind":"method","name":"frames","type":{"name":"Array<Frame>"},"comment":"","returnComment":"An array of all frames attached to the page.","required":true,"args":{}},"getAttribute":{"kind":"method","name":"getAttribute","type":{"name":"Promise<null|string>"},"comment":"Returns element attribute value.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be picked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"Attribute name to get the value for.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"goBack":{"kind":"method","name":"goBack","type":{"name":"Promise<null|Response>"},"comment":"Navigate to the previous page in history.","returnComment":"Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. If\ncan not go back, resolves to `null`.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider navigation succeeded, defaults to `load`. Events can be either:\n - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.\n - `'load'` - consider navigation to be finished when the `load` event is fired.\n - `'networkidle'` - consider navigation to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false}}},"comment":"Navigation parameters which might have the following properties:","returnComment":"","required":false,"order":0}}},"goForward":{"kind":"method","name":"goForward","type":{"name":"Promise<null|Response>"},"comment":"Navigate to the next page in history.","returnComment":"Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. If\ncan not go forward, resolves to `null`.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider navigation succeeded, defaults to `load`. Events can be either:\n - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.\n - `'load'` - consider navigation to be finished when the `load` event is fired.\n - `'networkidle'` - consider navigation to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false}}},"comment":"Navigation parameters which might have the following properties:","returnComment":"","required":false,"order":0}}},"goto":{"kind":"method","name":"goto","type":{"name":"Promise<null|Response>"},"comment":"`page.goto` will throw an error if:\n\nthere's an SSL error (e.g. in case of self-signed certificates).\ntarget URL is invalid.\nthe `timeout` is exceeded during navigation.\nthe remote server does not respond or is unreachable.\nthe main resource failed to load.\n\n`page.goto` will not throw an error when any valid HTTP status code is returned by the remote server, including 404 \"Not Found\" and 500 \"Internal Server Error\". The status code for such responses can be retrieved by calling response.status().\n\n**NOTE** `page.goto` either throws an error or returns a main resource response. The only exceptions are navigation to `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.\n\n\n**NOTE** Headless mode doesn't support navigation to a PDF document. See the upstream issue.\n\nShortcut for page.mainFrame().goto(url[, options])","returnComment":"Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.","required":true,"args":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"URL to navigate page to. The url should include scheme, e.g. `https://`.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider navigation succeeded, defaults to `load`. Events can be either:\n - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.\n - `'load'` - consider navigation to be finished when the `load` event is fired.\n - `'networkidle'` - consider navigation to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false},"referer":{"kind":"property","name":"referer","type":{"name":"string"},"comment":"Referer header value. If provided it will take preference over the referer header value set by page.setExtraHTTPHeaders().","returnComment":"","required":false}}},"comment":"Navigation parameters which might have the following properties:","returnComment":"","required":false,"order":1}}},"hover":{"kind":"method","name":"hover","type":{"name":"Promise"},"comment":"This method hovers over an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to hover over the center of the element, or the specified `position`.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.\nShortcut for page.mainFrame().hover(selector[, options]).","returnComment":"Promise that resolves when the element matching `selector` is successfully hovered.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to hover. If there are multiple elements satisfying the selector, the first will be hovered. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"innerHTML":{"kind":"method","name":"innerHTML","type":{"name":"Promise<string>"},"comment":"Resolves to the `element.innerHTML`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be picked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"innerText":{"kind":"method","name":"innerText","type":{"name":"Promise<string>"},"comment":"Resolves to the `element.innerText`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be picked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"isClosed":{"kind":"method","name":"isClosed","type":{"name":"boolean"},"comment":"Indicates that the page has been closed.","returnComment":"","required":true,"args":{}},"keyboard":{"kind":"property","name":"keyboard","type":{"name":"Keyboard"},"comment":"","returnComment":"","required":true,"args":{}},"mainFrame":{"kind":"method","name":"mainFrame","type":{"name":"Frame"},"comment":"Page is guaranteed to have a main frame which persists during navigations.","returnComment":"The page's main frame.","required":true,"args":{}},"mouse":{"kind":"property","name":"mouse","type":{"name":"Mouse"},"comment":"","returnComment":"","required":true,"args":{}},"opener":{"kind":"method","name":"opener","type":{"name":"Promise<null|Page>"},"comment":"","returnComment":"Promise which resolves to the opener for popup pages and `null` for others. If the opener has been closed already the promise may resolve to `null`.","required":true,"args":{}},"pdf":{"kind":"method","name":"pdf","type":{"name":"Promise<Buffer>"},"comment":"**NOTE** Generating a pdf is currently only supported in Chromium headless.\n\n`page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call page.emulateMedia({ media: 'screen' }) before calling `page.pdf()`:\n\n**NOTE** By default, `page.pdf()` generates a pdf with modified colors for printing. Use the `-webkit-print-color-adjust` property to force rendering of exact colors.\n\n```js\n// Generates a PDF with 'screen' media type.\nawait page.emulateMedia({media: 'screen'});\nawait page.pdf({path: 'page.pdf'});\n```\nThe `width`, `height`, and `margin` options accept values labeled with units. Unlabeled values are treated as pixels.\nA few examples:\n\n`page.pdf({width: 100})` - prints with width set to 100 pixels\n`page.pdf({width: '100px'})` - prints with width set to 100 pixels\n`page.pdf({width: '10cm'})` - prints with width set to 10 centimeters.\n\nAll possible units are:\n\n`px` - pixel\n`in` - inch\n`cm` - centimeter\n`mm` - millimeter\n\nThe `format` options are:\n\n`Letter`: 8.5in x 11in\n`Legal`: 8.5in x 14in\n`Tabloid`: 11in x 17in\n`Ledger`: 17in x 11in\n`A0`: 33.1in x 46.8in\n`A1`: 23.4in x 33.1in\n`A2`: 16.54in x 23.4in\n`A3`: 11.7in x 16.54in\n`A4`: 8.27in x 11.7in\n`A5`: 5.83in x 8.27in\n`A6`: 4.13in x 5.83in\n\n\n**NOTE** `headerTemplate` and `footerTemplate` markup have the following limitations:\n\nScript tags inside templates are not evaluated.\nPage styles are not visible inside templates.","returnComment":"Promise which resolves with PDF buffer.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"The file path to save the PDF to. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, the PDF won't be saved to the disk.","returnComment":"","required":false},"scale":{"kind":"property","name":"scale","type":{"name":"number"},"comment":"Scale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2.","returnComment":"","required":false},"displayHeaderFooter":{"kind":"property","name":"displayHeaderFooter","type":{"name":"boolean"},"comment":"Display header and footer. Defaults to `false`.","returnComment":"","required":false},"headerTemplate":{"kind":"property","name":"headerTemplate","type":{"name":"string"},"comment":"HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:\n - `'date'` formatted print date\n - `'title'` document title\n - `'url'` document location\n - `'pageNumber'` current page number\n - `'totalPages'` total pages in the document","returnComment":"","required":false},"footerTemplate":{"kind":"property","name":"footerTemplate","type":{"name":"string"},"comment":"HTML template for the print footer. Should use the same format as the `headerTemplate`.","returnComment":"","required":false},"printBackground":{"kind":"property","name":"printBackground","type":{"name":"boolean"},"comment":"Print background graphics. Defaults to `false`.","returnComment":"","required":false},"landscape":{"kind":"property","name":"landscape","type":{"name":"boolean"},"comment":"Paper orientation. Defaults to `false`.","returnComment":"","required":false},"pageRanges":{"kind":"property","name":"pageRanges","type":{"name":"string"},"comment":"Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.","returnComment":"","required":false},"format":{"kind":"property","name":"format","type":{"name":"string"},"comment":"Paper format. If set, takes priority over `width` or `height` options. Defaults to 'Letter'.","returnComment":"","required":false},"width":{"kind":"property","name":"width","type":{"name":"string|number"},"comment":"Paper width, accepts values labeled with units.","returnComment":"","required":false},"height":{"kind":"property","name":"height","type":{"name":"string|number"},"comment":"Paper height, accepts values labeled with units.","returnComment":"","required":false},"margin":{"kind":"property","name":"margin","type":{"name":"Object","properties":{"top":{"kind":"property","name":"top","type":{"name":"string|number"},"comment":"Top margin, accepts values labeled with units. Defaults to `0`.","returnComment":"","required":false},"right":{"kind":"property","name":"right","type":{"name":"string|number"},"comment":"Right margin, accepts values labeled with units. Defaults to `0`.","returnComment":"","required":false},"bottom":{"kind":"property","name":"bottom","type":{"name":"string|number"},"comment":"Bottom margin, accepts values labeled with units. Defaults to `0`.","returnComment":"","required":false},"left":{"kind":"property","name":"left","type":{"name":"string|number"},"comment":"Left margin, accepts values labeled with units. Defaults to `0`.","returnComment":"","required":false}}},"comment":"Paper margins, defaults to none.","returnComment":"","required":false},"preferCSSPageSize":{"kind":"property","name":"preferCSSPageSize","type":{"name":"boolean"},"comment":"Give any CSS `@page` size declared in the page priority over what is declared in `width` and `height` or `format` options. Defaults to `false`, which will scale the content to fit the paper size.","returnComment":"","required":false}}},"comment":"Options object which might have the following properties:","returnComment":"","required":false,"order":0}}},"press":{"kind":"method","name":"press","type":{"name":"Promise"},"comment":"Focuses the element, and then uses `keyboard.down` and `keyboard.up`.\n`key` can specify the intended keyboardEvent.key value or a single character to generate the text for. A superset of the `key` values can be found here. Examples of the keys are:\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`, `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.\nFollowing modification shortcuts are also suported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective texts.\nShortcuts such as `key: \"Control+o\"` or `key: \"Control+Shift+T\"` are supported as well. When speficied with the modifier, modifier is pressed and being held while the subsequent key is being pressed.\n```js\nconst page = await browser.newPage();\nawait page.goto('https://keycode.info');\nawait page.press('body', 'A');\nawait page.screenshot({ path: 'A.png' });\nawait page.press('body', 'ArrowLeft');\nawait page.screenshot({ path: 'ArrowLeft.png' });\nawait page.press('body', 'Shift+O');\nawait page.screenshot({ path: 'O.png' });\nawait browser.close();\n```","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to type into. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.","returnComment":"","required":true,"order":0},"key":{"kind":"property","name":"key","type":{"name":"string"},"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"reload":{"kind":"method","name":"reload","type":{"name":"Promise<null|Response>"},"comment":"","returnComment":"Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider navigation succeeded, defaults to `load`. Events can be either:\n - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.\n - `'load'` - consider navigation to be finished when the `load` event is fired.\n - `'networkidle'` - consider navigation to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false}}},"comment":"Navigation parameters which might have the following properties:","returnComment":"","required":false,"order":0}}},"route":{"kind":"method","name":"route","type":{"name":"Promise"},"comment":"Routing provides the capability to modify network requests that are made by a page.\nOnce routing is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted.\n\n**NOTE** The handler will only be called for the first url if the response is a redirect.\n\nAn example of a naïve handler that aborts all image requests:\n```js\nconst page = await browser.newPage();\nawait page.route('**/*.{png,jpg,jpeg}', route => route.abort());\nawait page.goto('https://example.com');\nawait browser.close();\n```\nor the same snippet using a regex pattern instead:\n```js\nconst page = await browser.newPage();\nawait page.route(/(\\.png$)|(\\.jpg$)/, route => route.abort());\nawait page.goto('https://example.com');\nawait browser.close();\n```\nPage routes take precedence over browser context routes (set up with browserContext.route(url, handler)) when request matches both handlers.\n\n**NOTE** Enabling routing disables http cache.","returnComment":".","required":true,"args":{"url":{"kind":"property","name":"url","type":{"name":"string|RegExp|function(URL):boolean"},"comment":"A glob pattern, regex pattern or predicate receiving URL to match while routing.","returnComment":"","required":true,"order":0},"handler":{"kind":"property","name":"handler","type":{"name":"function(Route, Request)"},"comment":"handler function to route the request.","returnComment":"","required":true,"order":1}}},"screenshot":{"kind":"method","name":"screenshot","type":{"name":"Promise<Buffer>"},"comment":"**NOTE** Screenshots take at least 1/6 second on Chromium OS X and Chromium Windows. See https://crbug.com/741689 for discussion.","returnComment":"Promise which resolves to buffer with the captured screenshot.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.","returnComment":"","required":false},"type":{"kind":"property","name":"type","type":{"name":"\"jpeg\"|\"png\""},"comment":"Specify screenshot type, defaults to `png`.","returnComment":"","required":false},"quality":{"kind":"property","name":"quality","type":{"name":"number"},"comment":"The quality of the image, between 0-100. Not applicable to `png` images.","returnComment":"","required":false},"fullPage":{"kind":"property","name":"fullPage","type":{"name":"boolean"},"comment":"When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to `false`.","returnComment":"","required":false},"clip":{"kind":"property","name":"clip","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"x-coordinate of top-left corner of clip area","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"y-coordinate of top-left corner of clip area","returnComment":"","required":true},"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"width of clipping area","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"height of clipping area","returnComment":"","required":true}}},"comment":"An object which specifies clipping of the resulting image. Should have the following fields:","returnComment":"","required":false},"omitBackground":{"kind":"property","name":"omitBackground","type":{"name":"boolean"},"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"Options object which might have the following properties:","returnComment":"","required":false,"order":0}}},"selectOption":{"kind":"method","name":"selectOption","type":{"name":"Promise<Array<string>>"},"comment":"Triggers a `change` and `input` event once all the provided options have been selected.\nIf there's no `<select>` element matching `selector`, the method throws an error.\n```js\n// single selection matching the value\npage.selectOption('select#colors', 'blue');\n\n// single selection matching both the value and the label\npage.selectOption('select#colors', { label: 'Blue' });\n\n// multiple selection\npage.selectOption('select#colors', ['red', 'green', 'blue']);\n\n```\nShortcut for page.mainFrame().selectOption()","returnComment":"An array of option values that have been successfully selected.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query page for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"values":{"kind":"property","name":"values","type":{"name":"null|string|ElementHandle|Array<string>|Object|Array<ElementHandle>|Array<Object>","properties":{"value":{"kind":"property","name":"value","type":{"name":"string"},"comment":"Matches by `option.value`.","returnComment":"","required":false},"label":{"kind":"property","name":"label","type":{"name":"string"},"comment":"Matches by `option.label`.","returnComment":"","required":false},"index":{"kind":"property","name":"index","type":{"name":"number"},"comment":"Matches by the index.","returnComment":"","required":false}}},"comment":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option is considered matching if all specified properties match.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"setContent":{"kind":"method","name":"setContent","type":{"name":"Promise"},"comment":"","returnComment":"","required":true,"args":{"html":{"kind":"property","name":"html","type":{"name":"string"},"comment":"HTML markup to assign to the page.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds for resources to load, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider setting markup succeeded, defaults to `load`. Given an array of event strings, setting content is considered to be successful after all events have been fired. Events can be either:\n - `'load'` - consider setting content to be finished when the `load` event is fired.\n - `'domcontentloaded'` - consider setting content to be finished when the `DOMContentLoaded` event is fired.\n - `'networkidle'` - consider setting content to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false}}},"comment":"Parameters which might have the following properties:","returnComment":"","required":false,"order":1}}},"setDefaultNavigationTimeout":{"kind":"method","name":"setDefaultNavigationTimeout","type":null,"comment":"This setting will change the default maximum navigation time for the following methods and related shortcuts:\n\npage.goBack([options])\npage.goForward([options])\npage.goto(url[, options])\npage.reload([options])\npage.setContent(html[, options])\npage.waitForNavigation([options])\n\n\n**NOTE** `page.setDefaultNavigationTimeout` takes priority over `page.setDefaultTimeout`, `browserContext.setDefaultTimeout` and `browserContext.setDefaultNavigationTimeout`.","returnComment":"","required":true,"args":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds","returnComment":"","required":true,"order":0}}},"setDefaultTimeout":{"kind":"method","name":"setDefaultTimeout","type":null,"comment":"This setting will change the default maximum time for all the methods accepting `timeout` option.\n\n**NOTE** `page.setDefaultNavigationTimeout` takes priority over `page.setDefaultTimeout`.","returnComment":"","required":true,"args":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds","returnComment":"","required":true,"order":0}}},"setExtraHTTPHeaders":{"kind":"method","name":"setExtraHTTPHeaders","type":{"name":"Promise"},"comment":"The extra HTTP headers will be sent with every request the page initiates.\n\n**NOTE** page.setExtraHTTPHeaders does not guarantee the order of headers in the outgoing requests.","returnComment":"","required":true,"args":{"headers":{"kind":"property","name":"headers","type":{"name":"Object<string, string>"},"comment":"An object containing additional HTTP headers to be sent with every request. All header values must be strings.","returnComment":"","required":true,"order":0}}},"setInputFiles":{"kind":"method","name":"setInputFiles","type":{"name":"Promise"},"comment":"This method expects `selector` to point to an input element.\nSets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"files":{"kind":"property","name":"files","type":{"name":"string|Array<string>|Object|Array<Object>","properties":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"File name **required**","returnComment":"","required":true},"mimeType":{"kind":"property","name":"mimeType","type":{"name":"string"},"comment":"File type **required**","returnComment":"","required":true},"buffer":{"kind":"property","name":"buffer","type":{"name":"Buffer"},"comment":"File content **required**","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"setViewportSize":{"kind":"method","name":"setViewportSize","type":{"name":"Promise"},"comment":"In the case of multiple pages in a single browser, each page can have its own viewport size. However, browser.newContext([options]) allows to set viewport size (and more) for all pages in the context at once.\n`page.setViewportSize` will resize the page. A lot of websites don't expect phones to change size, so you should set the viewport size before navigating to the page.\n```js\nconst page = await browser.newPage();\nawait page.setViewportSize({\n width: 640,\n height: 480,\n});\nawait page.goto('https://example.com');\n```","returnComment":"","required":true,"args":{"viewportSize":{"kind":"property","name":"viewportSize","type":{"name":"Object","properties":{"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"page width in pixels. **required**","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"page height in pixels. **required**","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true,"order":0}}},"textContent":{"kind":"method","name":"textContent","type":{"name":"Promise<null|string>"},"comment":"Resolves to the `element.textContent`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be picked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"title":{"kind":"method","name":"title","type":{"name":"Promise<string>"},"comment":"Shortcut for page.mainFrame().title().","returnComment":"The page's title.","required":true,"args":{}},"type":{"kind":"method","name":"type","type":{"name":"Promise"},"comment":"Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `page.type` can be used to send fine-grained keyboard events. To fill values in form fields, use `page.fill`.\nTo press a special key, like `Control` or `ArrowDown`, use `keyboard.press`.\n```js\nawait page.type('#mytextarea', 'Hello'); // Types instantly\nawait page.type('#mytextarea', 'World', {delay: 100}); // Types slower, like a user\n```\nShortcut for page.mainFrame().type(selector, text[, options]).","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to type into. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.","returnComment":"","required":true,"order":0},"text":{"kind":"property","name":"text","type":{"name":"string"},"comment":"A text to type into a focused element.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"uncheck":{"kind":"method","name":"uncheck","type":{"name":"Promise"},"comment":"This method unchecks an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nEnsure that matched element is a checkbox or a radio input. If not, this method rejects. If the element is already unchecked, this method returns immediately.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\nEnsure that the element is now unchecked. If not, this method rejects.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.\nShortcut for page.mainFrame().uncheck(selector[, options]).","returnComment":"Promise that resolves when the element matching `selector` is successfully unchecked.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for uncheckbox to check. If there are multiple elements satisfying the selector, the first will be checked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"unroute":{"kind":"method","name":"unroute","type":{"name":"Promise"},"comment":"Removes a route created with page.route(url, handler). When `handler` is not specified, removes all routes for the `url`.","returnComment":"","required":true,"args":{"url":{"kind":"property","name":"url","type":{"name":"string|RegExp|function(URL):boolean"},"comment":"A glob pattern, regex pattern or predicate receiving URL to match while routing.","returnComment":"","required":true,"order":0},"handler":{"kind":"property","name":"handler","type":{"name":"function(Route, Request)"},"comment":"Handler function to route the request.","returnComment":"","required":false,"order":1}}},"url":{"kind":"method","name":"url","type":{"name":"string"},"comment":"This is a shortcut for page.mainFrame().url()","returnComment":"","required":true,"args":{}},"video":{"kind":"method","name":"video","type":{"name":"null|Video"},"comment":"Video object associated with this page.","returnComment":"","required":true,"args":{}},"viewportSize":{"kind":"method","name":"viewportSize","type":{"name":"null|Object","properties":{"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"page width in pixels.","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"page height in pixels.","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true,"args":{}},"waitForEvent":{"kind":"method","name":"waitForEvent","type":{"name":"Promise<Object>"},"comment":"Waits for event to fire and passes its value into the predicate function. Resolves when the predicate returns truthy value. Will throw an error if the page is closed before the event\nis fired.","returnComment":"Promise which resolves to the event data value.","required":true,"args":{"event":{"kind":"property","name":"event","type":{"name":"string"},"comment":"Event name, same one would pass into `page.on(event)`.","returnComment":"","required":true,"order":0},"optionsOrPredicate":{"kind":"property","name":"optionsOrPredicate","type":{"name":"Function|Object","properties":{"predicate":{"kind":"property","name":"predicate","type":{"name":"Function"},"comment":"receives the event data and resolves to truthy value when the waiting should resolve.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"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 browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"Either a predicate that receives an event or an options object.","returnComment":"","required":false,"order":1}}},"waitForFunction":{"kind":"method","name":"waitForFunction","type":{"name":"Promise<JSHandle>"},"comment":"The `waitForFunction` can be used to observe viewport size change:\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\n\n(async () => {\n const browser = await webkit.launch();\n const page = await browser.newPage();\n const watchDog = page.waitForFunction('window.innerWidth < 100');\n await page.setViewportSize({width: 50, height: 50});\n await watchDog;\n await browser.close();\n})();\n```\nTo pass an argument from Node.js to the predicate of `page.waitForFunction` function:\n```js\nconst selector = '.foo';\nawait page.waitForFunction(selector => !!document.querySelector(selector), selector);\n```\nShortcut for page.mainFrame().waitForFunction(pageFunction[, arg, options]).","returnComment":"Promise which resolves when the `pageFunction` returns a truthy value. It resolves to a JSHandle of the truthy value.","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"polling":{"kind":"property","name":"polling","type":{"name":"number|\"raf\""},"comment":"If `polling` is `'raf'`, then `pageFunction` is constantly executed in `requestAnimationFrame` callback. If `polling` is a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to `raf`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"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 page.setDefaultTimeout(timeout) method.","returnComment":"","required":false}}},"comment":"Optional waiting parameters","returnComment":"","required":false,"order":2}}},"waitForLoadState":{"kind":"method","name":"waitForLoadState","type":{"name":"Promise"},"comment":"This resolves when the page reaches a required load state, `load` by default. The navigation must have been committed when this method is called. If current document has already reached the required state, resolves immediately.\n```js\nawait page.click('button'); // Click triggers navigation.\nawait page.waitForLoadState(); // The promise resolves after 'load' event.\n```\n```js\nconst [popup] = await Promise.all([\n page.waitForEvent('popup'),\n page.click('button'), // Click triggers a popup.\n])\nawait popup.waitForLoadState('domcontentloaded'); // The promise resolves after 'domcontentloaded' event.\nconsole.log(await popup.title()); // Popup is ready to use.\n```\nShortcut for page.mainFrame().waitForLoadState([options]).","returnComment":"Promise which resolves when the required load state has been reached.","required":true,"args":{"state":{"kind":"property","name":"state","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"Load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the method resolves immediately.\n - `'load'` - wait for the `load` event to be fired.\n - `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.\n - `'networkidle'` - wait until there are no network connections for at least `500` ms.","returnComment":"","required":false,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum waiting time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"waitForNavigation":{"kind":"method","name":"waitForNavigation","type":{"name":"Promise<null|Response>"},"comment":"This resolves when the page navigates to a new URL or reloads. It is useful for when you run code\nwhich will indirectly cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`. Consider this example:\n```js\nconst [response] = await Promise.all([\n page.waitForNavigation(), // The promise resolves after navigation has finished\n page.click('a.delayed-navigation'), // Clicking the link will indirectly cause a navigation\n]);\n```\n**NOTE** Usage of the History API to change the URL is considered a navigation.\nShortcut for page.mainFrame().waitForNavigation(options).","returnComment":"Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. In case of navigation to a different anchor or navigation due to History API usage, the navigation will resolve with `null`.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"url":{"kind":"property","name":"url","type":{"name":"string|RegExp|Function"},"comment":"A glob pattern, regex pattern or predicate receiving URL to match while waiting for the navigation.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider navigation succeeded, defaults to `load`. Events can be either:\n - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.\n - `'load'` - consider navigation to be finished when the `load` event is fired.\n - `'networkidle'` - consider navigation to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false}}},"comment":"Navigation parameters which might have the following properties:","returnComment":"","required":false,"order":0}}},"waitForRequest":{"kind":"method","name":"waitForRequest","type":{"name":"Promise<Request>"},"comment":"```js\nconst firstRequest = await page.waitForRequest('http://example.com/resource');\nconst finalRequest = await page.waitForRequest(request => request.url() === 'http://example.com' && request.method() === 'GET');\nreturn firstRequest.url();\n```\n```js\nawait page.waitForRequest(request => request.url().searchParams.get('foo') === 'bar' && request.url().searchParams.get('foo2') === 'bar2');\n```","returnComment":"Promise which resolves to the matched request.","required":true,"args":{"urlOrPredicate":{"kind":"property","name":"urlOrPredicate","type":{"name":"string|RegExp|Function"},"comment":"Request URL string, regex or predicate receiving Request object.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be changed by using the page.setDefaultTimeout(timeout) method.","returnComment":"","required":false}}},"comment":"Optional waiting parameters","returnComment":"","required":false,"order":1}}},"waitForResponse":{"kind":"method","name":"waitForResponse","type":{"name":"Promise<Response>"},"comment":"```js\nconst firstResponse = await page.waitForResponse('https://example.com/resource');\nconst finalResponse = await page.waitForResponse(response => response.url() === 'https://example.com' && response.status() === 200);\nreturn finalResponse.ok();\n```","returnComment":"Promise which resolves to the matched response.","required":true,"args":{"urlOrPredicate":{"kind":"property","name":"urlOrPredicate","type":{"name":"string|RegExp|Function"},"comment":"Request URL string, regex or predicate receiving Response object.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"Optional waiting parameters","returnComment":"","required":false,"order":1}}},"waitForSelector":{"kind":"method","name":"waitForSelector","type":{"name":"Promise<null|ElementHandle>"},"comment":"Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.\nThis method works across navigations:\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 let currentURL;\n page\n .waitForSelector('img')\n .then(() => console.log('First URL with image: ' + currentURL));\n for (currentURL of ['https://example.com', 'https://google.com', 'https://bbc.com']) {\n await page.goto(currentURL);\n }\n await browser.close();\n})();\n```\nShortcut for page.mainFrame().waitForSelector(selector[, options]).","returnComment":"Promise which resolves when element specified by selector satisfies `state` option. Resolves to `null` if waiting for `hidden` or `detached`.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to wait for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"state":{"kind":"property","name":"state","type":{"name":"\"attached\"|\"detached\"|\"hidden\"|\"visible\""},"comment":"Defaults to `'visible'`. Can be either:\n - `'attached'` - wait for element to be present in DOM.\n - `'detached'` - wait for element to not be present in DOM.\n - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without any content or with `display:none` has an empty bounding box and is not considered visible.\n - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`. This is opposite to the `'visible'` option.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"waitForTimeout":{"kind":"method","name":"waitForTimeout","type":{"name":"Promise"},"comment":"Returns a promise that resolves after the timeout.\nNote that `page.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going to be flaky. Use signals such as network events, selectors becoming visible and others instead.\n```js\n// wait for 1 second\nawait page.waitForTimeout(1000);\n```\nShortcut for page.mainFrame().waitForTimeout(timeout).","returnComment":"","required":true,"args":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"A timeout to wait for","returnComment":"","required":true,"order":0}}},"workers":{"kind":"method","name":"workers","type":{"name":"Array<Worker>"},"comment":"**NOTE** This does not contain ServiceWorkers","returnComment":"This method returns all of the dedicated WebWorkers associated with the page.","required":true,"args":{}}}},"Frame":{"name":"Frame","members":{"$":{"kind":"method","name":"$","type":{"name":"Promise<null|ElementHandle>"},"comment":"The method finds an element matching the specified selector within the frame. See Working with selectors for more details. If no elements match the selector, the return value resolves to `null`.","returnComment":"Promise which resolves to ElementHandle pointing to the frame element.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query frame for. See working with selectors for more details.","returnComment":"","required":true,"order":0}}},"$$":{"kind":"method","name":"$$","type":{"name":"Promise<Array<ElementHandle>>"},"comment":"The method finds all elements matching the specified selector within the frame. See Working with selectors for more details. If no elements match the selector, the return value resolves to `[]`.","returnComment":"Promise which resolves to ElementHandles pointing to the frame elements.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query frame for. See working with selectors for more details.","returnComment":"","required":true,"order":0}}},"$eval":{"kind":"method","name":"$eval","type":{"name":"Promise<Serializable>"},"comment":"The method finds an element matching the specified selector within the frame and passes it as a first argument to `pageFunction`. See Working with selectors for more details. If no elements match the selector, the method throws an error.\nIf `pageFunction` returns a Promise, then `frame.$eval` would wait for the promise to resolve and return its value.\nExamples:\n```js\nconst searchValue = await frame.$eval('#search', el => el.value);\nconst preloadHref = await frame.$eval('link[rel=preload]', el => el.href);\nconst html = await frame.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');\n```","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query frame for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function(Element)"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":1},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":2}}},"$$eval":{"kind":"method","name":"$$eval","type":{"name":"Promise<Serializable>"},"comment":"The method finds all elements matching the specified selector within the frame and passes an array of matched elements as a first argument to `pageFunction`. See Working with selectors for more details.\nIf `pageFunction` returns a Promise, then `frame.$$eval` would wait for the promise to resolve and return its value.\nExamples:\n```js\nconst divsCounts = await frame.$$eval('div', (divs, min) => divs.length >= min, 10);\n```","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query frame for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function(Array<Element>)"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":1},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":2}}},"addScriptTag":{"kind":"method","name":"addScriptTag","type":{"name":"Promise<ElementHandle>"},"comment":"Adds a `<script>` tag into the page with the desired url or content.","returnComment":"which resolves to the added tag when the script's onload fires or when the script content was injected into frame.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"URL of a script to be added.","returnComment":"","required":false},"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to current working directory.","returnComment":"","required":false},"content":{"kind":"property","name":"content","type":{"name":"string"},"comment":"Raw JavaScript content to be injected into frame.","returnComment":"","required":false},"type":{"kind":"property","name":"type","type":{"name":"string"},"comment":"Script type. Use 'module' in order to load a Javascript ES6 module. See script for more details.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":true,"order":0}}},"addStyleTag":{"kind":"method","name":"addStyleTag","type":{"name":"Promise<ElementHandle>"},"comment":"Adds a `<link rel=\"stylesheet\">` tag into the page with the desired url or a `<style type=\"text/css\">` tag with the content.","returnComment":"which resolves to the added tag when the stylesheet's onload fires or when the CSS content was injected into frame.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"URL of the `<link>` tag.","returnComment":"","required":false},"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to current working directory.","returnComment":"","required":false},"content":{"kind":"property","name":"content","type":{"name":"string"},"comment":"Raw CSS content to be injected into frame.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":true,"order":0}}},"check":{"kind":"method","name":"check","type":{"name":"Promise"},"comment":"This method checks an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nEnsure that matched element is a checkbox or a radio input. If not, this method rejects. If the element is already checked, this method returns immediately.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\nEnsure that the element is now checked. If not, this method rejects.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.","returnComment":"Promise that resolves when the element matching `selector` is successfully checked.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for checkbox to check. If there are multiple elements satisfying the selector, the first will be checked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"childFrames":{"kind":"method","name":"childFrames","type":{"name":"Array<Frame>"},"comment":"","returnComment":"","required":true,"args":{}},"click":{"kind":"method","name":"click","type":{"name":"Promise"},"comment":"This method clicks an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element, or the specified `position`.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.","returnComment":"Promise that resolves when the element matching `selector` is successfully clicked.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"clickCount":{"kind":"property","name":"clickCount","type":{"name":"number"},"comment":"defaults to 1. See UIEvent.detail.","returnComment":"","required":false},"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"content":{"kind":"method","name":"content","type":{"name":"Promise<string>"},"comment":"Gets the full HTML contents of the frame, including the doctype.","returnComment":"","required":true,"args":{}},"dblclick":{"kind":"method","name":"dblclick","type":{"name":"Promise"},"comment":"This method double clicks an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to double click in the center of the element, or the specified `position`.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the first click of the `dblclick()` triggers a navigation event, this method will reject.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.\n\n**NOTE** `frame.dblclick()` dispatches two `click` events and a single `dblclick` event.","returnComment":"Promise that resolves when the element matching `selector` is successfully double clicked.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to double click. If there are multiple elements satisfying the selector, the first will be double clicked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"dispatchEvent":{"kind":"method","name":"dispatchEvent","type":{"name":"Promise"},"comment":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the elment, `click` is dispatched. This is equivalend to calling `element.click()`.\n```js\nawait frame.dispatchEvent('button#submit', 'click');\n```\nUnder 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.\nSince `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:\n\nDragEvent\nFocusEvent\nKeyboardEvent\nMouseEvent\nPointerEvent\nTouchEvent\nEvent\n\nYou can also specify `JSHandle` as the property value if you want live objects to be passed into the event:\n```js\n// Note you can only create DataTransfer in Chromium and Firefox\nconst dataTransfer = await frame.evaluateHandle(() => new DataTransfer());\nawait frame.dispatchEvent('#source', 'dragstart', { dataTransfer });\n```","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to use. If there are multiple elements satisfying the selector, the first will be double clicked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"type":{"kind":"property","name":"type","type":{"name":"string"},"comment":"DOM event type: `\"click\"`, `\"dragstart\"`, etc.","returnComment":"","required":true,"order":1},"eventInit":{"kind":"property","name":"eventInit","type":{"name":"EvaluationArgument"},"comment":"event-specific initialization properties.","returnComment":"","required":false,"order":2},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":3}}},"evaluate":{"kind":"method","name":"evaluate","type":{"name":"Promise<Serializable>"},"comment":"If the function passed to the `frame.evaluate` returns a Promise, then `frame.evaluate` would wait for the promise to resolve and return its value.\nIf the function passed to the `frame.evaluate` returns a non-Serializable value, then `frame.evaluate` resolves to `undefined`. DevTools Protocol also supports transferring some additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`, and bigint literals.\n```js\nconst result = await frame.evaluate(([x, y]) => {\n return Promise.resolve(x * y);\n}, [7, 8]);\nconsole.log(result); // prints \"56\"\n```\nA string can also be passed in instead of a function.\n```js\nconsole.log(await frame.evaluate('1 + 2')); // prints \"3\"\n```\nElementHandle instances can be passed as an argument to the `frame.evaluate`:\n```js\nconst bodyHandle = await frame.$('body');\nconst html = await frame.evaluate(([body, suffix]) => body.innerHTML + suffix, [bodyHandle, 'hello']);\nawait bodyHandle.dispose();\n```","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1}}},"evaluateHandle":{"kind":"method","name":"evaluateHandle","type":{"name":"Promise<JSHandle>"},"comment":"The only difference between `frame.evaluate` and `frame.evaluateHandle` is that `frame.evaluateHandle` returns in-page object (JSHandle).\nIf the function, passed to the `frame.evaluateHandle`, returns a Promise, then `frame.evaluateHandle` would wait for the promise to resolve and return its value.\n```js\nconst aWindowHandle = await frame.evaluateHandle(() => Promise.resolve(window));\naWindowHandle; // Handle for the window object.\n```\nA string can also be passed in instead of a function.\n```js\nconst aHandle = await frame.evaluateHandle('document'); // Handle for the 'document'.\n```\nJSHandle instances can be passed as an argument to the `frame.evaluateHandle`:\n```js\nconst aHandle = await frame.evaluateHandle(() => document.body);\nconst resultHandle = await frame.evaluateHandle(([body, suffix]) => body.innerHTML + suffix, [aHandle, 'hello']);\nconsole.log(await resultHandle.jsonValue());\nawait resultHandle.dispose();\n```","returnComment":"Promise which resolves to the return value of `pageFunction` as in-page object (JSHandle)","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated in the page context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1}}},"fill":{"kind":"method","name":"fill","type":{"name":"Promise"},"comment":"This method waits for an element matching `selector`, waits for actionability checks, focuses the element, fills it and triggers an `input` event after filling.\nIf the element matching `selector` is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.\nNote that you can pass an empty string to clear the input field.\nTo send fine-grained keyboard events, use `frame.type`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query page for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"value":{"kind":"property","name":"value","type":{"name":"string"},"comment":"Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"focus":{"kind":"method","name":"focus","type":{"name":"Promise"},"comment":"This method fetches an element with `selector` and focuses it.\nIf there's no element matching `selector`, the method waits until a matching element appears in the DOM.","returnComment":"Promise which resolves when the element matching `selector` is successfully focused. The promise will be rejected if there is no element matching `selector`.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to focus. If there are multiple elements satisfying the selector, the first will be focused. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"frameElement":{"kind":"method","name":"frameElement","type":{"name":"Promise<ElementHandle>"},"comment":"This is an inverse of elementHandle.contentFrame(). Note that returned handle actually belongs to the parent frame.\nThis method throws an error if the frame has been detached before `frameElement()` returns.\n```js\nconst frameElement = await frame.frameElement();\nconst contentFrame = await frameElement.contentFrame();\nconsole.log(frame === contentFrame); // -> true\n```","returnComment":"Promise that resolves with a `frame` or `iframe` element handle which corresponds to this frame.","required":true,"args":{}},"getAttribute":{"kind":"method","name":"getAttribute","type":{"name":"Promise<null|string>"},"comment":"Returns element attribute value.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be picked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"Attribute name to get the value for.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"goto":{"kind":"method","name":"goto","type":{"name":"Promise<null|Response>"},"comment":"`frame.goto` will throw an error if:\n\nthere's an SSL error (e.g. in case of self-signed certificates).\ntarget URL is invalid.\nthe `timeout` is exceeded during navigation.\nthe remote server does not respond or is unreachable.\nthe main resource failed to load.\n\n`frame.goto` will not throw an error when any valid HTTP status code is returned by the remote server, including 404 \"Not Found\" and 500 \"Internal Server Error\". The status code for such responses can be retrieved by calling response.status().\n\n**NOTE** `frame.goto` either throws an error or returns a main resource response. The only exceptions are navigation to `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.\n\n\n**NOTE** Headless mode doesn't support navigation to a PDF document. See the upstream issue.","returnComment":"Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.","required":true,"args":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"URL to navigate frame to. The url should include scheme, e.g. `https://`.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider navigation succeeded, defaults to `load`. Events can be either:\n - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.\n - `'load'` - consider navigation to be finished when the `load` event is fired.\n - `'networkidle'` - consider navigation to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false},"referer":{"kind":"property","name":"referer","type":{"name":"string"},"comment":"Referer header value. If provided it will take preference over the referer header value set by page.setExtraHTTPHeaders().","returnComment":"","required":false}}},"comment":"Navigation parameters which might have the following properties:","returnComment":"","required":false,"order":1}}},"hover":{"kind":"method","name":"hover","type":{"name":"Promise"},"comment":"This method hovers over an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to hover over the center of the element, or the specified `position`.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.","returnComment":"Promise that resolves when the element matching `selector` is successfully hovered.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to hover. If there are multiple elements satisfying the selector, the first will be hovered. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"innerHTML":{"kind":"method","name":"innerHTML","type":{"name":"Promise<string>"},"comment":"Resolves to the `element.innerHTML`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be picked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"innerText":{"kind":"method","name":"innerText","type":{"name":"Promise<string>"},"comment":"Resolves to the `element.innerText`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be picked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"isDetached":{"kind":"method","name":"isDetached","type":{"name":"boolean"},"comment":"Returns `true` if the frame has been detached, or `false` otherwise.","returnComment":"","required":true,"args":{}},"name":{"kind":"method","name":"name","type":{"name":"string"},"comment":"Returns frame's name attribute as specified in the tag.\nIf the name is empty, returns the id attribute instead.\n\n**NOTE** This value is calculated once when the frame is created, and will not update if the attribute is changed later.","returnComment":"","required":true,"args":{}},"page":{"kind":"method","name":"page","type":{"name":"Page"},"comment":"Returns the page containing this frame.","returnComment":"","required":true,"args":{}},"parentFrame":{"kind":"method","name":"parentFrame","type":{"name":"null|Frame"},"comment":"","returnComment":"Parent frame, if any. Detached frames and main frames return `null`.","required":true,"args":{}},"press":{"kind":"method","name":"press","type":{"name":"Promise"},"comment":"`key` can specify the intended keyboardEvent.key value or a single character to generate the text for. A superset of the `key` values can be found here. Examples of the keys are:\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`, `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.\nFollowing modification shortcuts are also suported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective texts.\nShortcuts such as `key: \"Control+o\"` or `key: \"Control+Shift+T\"` are supported as well. When speficied with the modifier, modifier is pressed and being held while the subsequent key is being pressed.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to type into. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.","returnComment":"","required":true,"order":0},"key":{"kind":"property","name":"key","type":{"name":"string"},"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"selectOption":{"kind":"method","name":"selectOption","type":{"name":"Promise<Array<string>>"},"comment":"Triggers a `change` and `input` event once all the provided options have been selected.\nIf there's no `<select>` element matching `selector`, the method throws an error.\n```js\n// single selection matching the value\nframe.selectOption('select#colors', 'blue');\n\n// single selection matching both the value and the label\nframe.selectOption('select#colors', { label: 'Blue' });\n\n// multiple selection\nframe.selectOption('select#colors', 'red', 'green', 'blue');\n```","returnComment":"An array of option values that have been successfully selected.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query frame for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"values":{"kind":"property","name":"values","type":{"name":"null|string|ElementHandle|Array<string>|Object|Array<ElementHandle>|Array<Object>","properties":{"value":{"kind":"property","name":"value","type":{"name":"string"},"comment":"Matches by `option.value`.","returnComment":"","required":false},"label":{"kind":"property","name":"label","type":{"name":"string"},"comment":"Matches by `option.label`.","returnComment":"","required":false},"index":{"kind":"property","name":"index","type":{"name":"number"},"comment":"Matches by the index.","returnComment":"","required":false}}},"comment":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option is considered matching if all specified properties match.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"setContent":{"kind":"method","name":"setContent","type":{"name":"Promise"},"comment":"","returnComment":"","required":true,"args":{"html":{"kind":"property","name":"html","type":{"name":"string"},"comment":"HTML markup to assign to the page.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds for resources to load, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider navigation succeeded, defaults to `load`. Events can be either:\n - `'domcontentloaded'` - consider setting content to be finished when the `DOMContentLoaded` event is fired.\n - `'load'` - consider setting content to be finished when the `load` event is fired.\n - `'networkidle'` - consider setting content to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false}}},"comment":"Parameters which might have the following properties:","returnComment":"","required":false,"order":1}}},"setInputFiles":{"kind":"method","name":"setInputFiles","type":{"name":"Promise"},"comment":"This method expects `selector` to point to an input element.\nSets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"files":{"kind":"property","name":"files","type":{"name":"string|Array<string>|Object|Array<Object>","properties":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"File name **required**","returnComment":"","required":true},"mimeType":{"kind":"property","name":"mimeType","type":{"name":"string"},"comment":"File type **required**","returnComment":"","required":true},"buffer":{"kind":"property","name":"buffer","type":{"name":"Buffer"},"comment":"File content **required**","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"textContent":{"kind":"method","name":"textContent","type":{"name":"Promise<null|string>"},"comment":"Resolves to the `element.textContent`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be picked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"title":{"kind":"method","name":"title","type":{"name":"Promise<string>"},"comment":"","returnComment":"The page's title.","required":true,"args":{}},"type":{"kind":"method","name":"type","type":{"name":"Promise"},"comment":"Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `frame.type` can be used to send fine-grained keyboard events. To fill values in form fields, use `frame.fill`.\nTo press a special key, like `Control` or `ArrowDown`, use `keyboard.press`.\n```js\nawait frame.type('#mytextarea', 'Hello'); // Types instantly\nawait frame.type('#mytextarea', 'World', {delay: 100}); // Types slower, like a user\n```","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to type into. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.","returnComment":"","required":true,"order":0},"text":{"kind":"property","name":"text","type":{"name":"string"},"comment":"A text to type into a focused element.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"uncheck":{"kind":"method","name":"uncheck","type":{"name":"Promise"},"comment":"This method checks an element matching `selector` by performing the following steps:\n\nFind an element match matching `selector`. If there is none, wait until a matching element is attached to the DOM.\nEnsure that matched element is a checkbox or a radio input. If not, this method rejects. If the element is already unchecked, this method returns immediately.\nWait for actionability checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\nEnsure that the element is now unchecked. If not, this method rejects.\n\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.","returnComment":"Promise that resolves when the element matching `selector` is successfully unchecked.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to search for uncheckbox to check. If there are multiple elements satisfying the selector, the first will be checked. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"url":{"kind":"method","name":"url","type":{"name":"string"},"comment":"Returns frame's url.","returnComment":"","required":true,"args":{}},"waitForFunction":{"kind":"method","name":"waitForFunction","type":{"name":"Promise<JSHandle>"},"comment":"The `waitForFunction` can be used to observe viewport size change:\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 const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');\n page.setViewportSize({width: 50, height: 50});\n await watchDog;\n await browser.close();\n})();\n```\nTo pass an argument from Node.js to the predicate of `frame.waitForFunction` function:\n```js\nconst selector = '.foo';\nawait frame.waitForFunction(selector => !!document.querySelector(selector), selector);\n```","returnComment":"Promise which resolves when the `pageFunction` returns a truthy value. It resolves to a JSHandle of the truthy value.","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"polling":{"kind":"property","name":"polling","type":{"name":"number|\"raf\""},"comment":"If `polling` is `'raf'`, then `pageFunction` is constantly executed in `requestAnimationFrame` callback. If `polling` is a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to `raf`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"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 browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"Optional waiting parameters","returnComment":"","required":false,"order":2}}},"waitForLoadState":{"kind":"method","name":"waitForLoadState","type":{"name":"Promise"},"comment":"This resolves when the frame reaches a required load state, `load` by default. The navigation must have been committed when this method is called. If current document has already reached the required state, resolves immediately.\n```js\nawait frame.click('button'); // Click triggers navigation.\nawait frame.waitForLoadState(); // The promise resolves after 'load' event.\n```","returnComment":"Promise which resolves when the required load state has been reached.","required":true,"args":{"state":{"kind":"property","name":"state","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"Load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the method resolves immediately.\n - `'load'` - wait for the `load` event to be fired.\n - `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.\n - `'networkidle'` - wait until there are no network connections for at least `500` ms.","returnComment":"","required":false,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum waiting time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"waitForNavigation":{"kind":"method","name":"waitForNavigation","type":{"name":"Promise<null|Response>"},"comment":"This resolves when the frame navigates to a new URL. It is useful for when you run code\nwhich will indirectly cause the frame to navigate. Consider this example:\n```js\nconst [response] = await Promise.all([\n frame.waitForNavigation(), // The navigation promise resolves after navigation has finished\n frame.click('a.my-link'), // Clicking the link will indirectly cause a navigation\n]);\n```\n**NOTE** Usage of the History API to change the URL is considered a navigation.","returnComment":"Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. In case of navigation to a different anchor or navigation due to History API usage, the navigation will resolve with `null`.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false},"url":{"kind":"property","name":"url","type":{"name":"string|RegExp|Function"},"comment":"URL string, URL regex pattern or predicate receiving URL to match while waiting for the navigation.","returnComment":"","required":false},"waitUntil":{"kind":"property","name":"waitUntil","type":{"name":"\"domcontentloaded\"|\"load\"|\"networkidle\""},"comment":"When to consider navigation succeeded, defaults to `load`. Events can be either:\n - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.\n - `'load'` - consider navigation to be finished when the `load` event is fired.\n - `'networkidle'` - consider navigation to be finished when there are no network connections for at least `500` ms.","returnComment":"","required":false}}},"comment":"Navigation parameters which might have the following properties:","returnComment":"","required":false,"order":0}}},"waitForSelector":{"kind":"method","name":"waitForSelector","type":{"name":"Promise<null|ElementHandle>"},"comment":"Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.\nThis method works across navigations:\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\n\n(async () => {\n const browser = await webkit.launch();\n const page = await browser.newPage();\n let currentURL;\n page.mainFrame()\n .waitForSelector('img')\n .then(() => console.log('First URL with image: ' + currentURL));\n for (currentURL of ['https://example.com', 'https://google.com', 'https://bbc.com']) {\n await page.goto(currentURL);\n }\n await browser.close();\n})();\n```","returnComment":"Promise which resolves when element specified by selector satisfies `state` option. Resolves to `null` if waiting for `hidden` or `detached`.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to wait for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"state":{"kind":"property","name":"state","type":{"name":"\"attached\"|\"detached\"|\"hidden\"|\"visible\""},"comment":"Defaults to `'visible'`. Can be either:\n - `'attached'` - wait for element to be present in DOM.\n - `'detached'` - wait for element to not be present in DOM.\n - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without any content or with `display:none` has an empty bounding box and is not considered visible.\n - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`. This is opposite to the `'visible'` option.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"waitForTimeout":{"kind":"method","name":"waitForTimeout","type":{"name":"Promise"},"comment":"Returns a promise that resolves after the timeout.\nNote that `frame.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going to be flaky. Use signals such as network events, selectors becoming visible and others instead.","returnComment":"","required":true,"args":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"A timeout to wait for","returnComment":"","required":true,"order":0}}}}},"ElementHandle":{"name":"ElementHandle","extends":"JSHandle","members":{"$":{"kind":"method","name":"$","type":{"name":"Promise<null|ElementHandle>"},"comment":"The method finds an element matching the specified selector in the `ElementHandle`'s subtree. See Working with selectors for more details. If no elements match the selector, the return value resolves to `null`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query element for. See working with selectors for more details.","returnComment":"","required":true,"order":0}}},"$$":{"kind":"method","name":"$$","type":{"name":"Promise<Array<ElementHandle>>"},"comment":"The method finds all elements matching the specified selector in the `ElementHandle`s subtree. See Working with selectors for more details. If no elements match the selector, the return value resolves to `[]`.","returnComment":"","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query element for. See working with selectors for more details.","returnComment":"","required":true,"order":0}}},"$eval":{"kind":"method","name":"$eval","type":{"name":"Promise<Serializable>"},"comment":"The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first argument to `pageFunction`. See Working with selectors for more details. If no elements match the selector, the method throws an error.\nIf `pageFunction` returns a Promise, then `frame.$eval` would wait for the promise to resolve and return its value.\nExamples:\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```","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query element for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function(Element)"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":1},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":2}}},"$$eval":{"kind":"method","name":"$$eval","type":{"name":"Promise<Serializable>"},"comment":"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 `pageFunction`. See Working with selectors for more details.\nIf `pageFunction` returns a Promise, then `frame.$$eval` would wait for the promise to resolve and return its value.\nExamples:\n```html\n<div class=\"feed\">\n <div class=\"tweet\">Hello!</div>\n <div class=\"tweet\">Hi!</div>\n</div>\n```\n```js\nconst feedHandle = await page.$('.feed');\nexpect(await feedHandle.$$eval('.tweet', nodes => nodes.map(n => n.innerText))).toEqual(['Hello!', 'Hi!']);\n```","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector to query element for. See working with selectors for more details.","returnComment":"","required":true,"order":0},"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function(Array<Element>)"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":1},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":2}}},"boundingBox":{"kind":"method","name":"boundingBox","type":{"name":"Promise<null|Object>","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"the x coordinate of the element in pixels.","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"the y coordinate of the element in pixels.","returnComment":"","required":true},"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"the width of the element in pixels.","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"the height of the element in pixels.","returnComment":"","required":true}}},"comment":"This method returns the bounding box of the element (relative to the main frame), or `null` if the element is not visible.","returnComment":"","required":true,"args":{}},"check":{"kind":"method","name":"check","type":{"name":"Promise"},"comment":"This method checks the element by performing the following steps:\n\nEnsure that element is a checkbox or a radio input. If not, this method rejects. If the element is already checked, this method returns immediately.\nWait for actionability checks on the element, unless `force` option is set.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\nEnsure that the element is now checked. If not, this method rejects.\n\nIf the element is detached from the DOM at any moment during the action, this method rejects.\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.","returnComment":"Promise that resolves when the element is successfully checked.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"click":{"kind":"method","name":"click","type":{"name":"Promise"},"comment":"This method clicks the element by performing the following steps:\n\nWait for actionability checks on the element, unless `force` option is set.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element, or the specified `position`.\nWait 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 rejects.\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.","returnComment":"Promise that resolves when the element is successfully clicked.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"clickCount":{"kind":"property","name":"clickCount","type":{"name":"number"},"comment":"defaults to 1. See UIEvent.detail.","returnComment":"","required":false},"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"contentFrame":{"kind":"method","name":"contentFrame","type":{"name":"Promise<null|Frame>"},"comment":"","returnComment":"Resolves to the content frame for element handles referencing iframe nodes, or `null` otherwise","required":true,"args":{}},"dblclick":{"kind":"method","name":"dblclick","type":{"name":"Promise"},"comment":"This method double clicks the element by performing the following steps:\n\nWait for actionability checks on the element, unless `force` option is set.\nScroll the element into view if needed.\nUse page.mouse to double click in the center of the element, or the specified `position`.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the first click of the `dblclick()` triggers a navigation event, this method will reject.\n\nIf the element is detached from the DOM at any moment during the action, this method rejects.\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.\n\n**NOTE** `elementHandle.dblclick()` dispatches two `click` events and a single `dblclick` event.","returnComment":"Promise that resolves when the element is successfully double clicked.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"dispatchEvent":{"kind":"method","name":"dispatchEvent","type":{"name":"Promise"},"comment":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the elment, `click` is dispatched. This is equivalend to calling `element.click()`.\n```js\nawait elementHandle.dispatchEvent('click');\n```\nUnder 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.\nSince `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:\n\nDragEvent\nFocusEvent\nKeyboardEvent\nMouseEvent\nPointerEvent\nTouchEvent\nEvent\n\nYou can also specify `JSHandle` as the property value if you want live objects to be passed into the event:\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```","returnComment":"","required":true,"args":{"type":{"kind":"property","name":"type","type":{"name":"string"},"comment":"DOM event type: `\"click\"`, `\"dragstart\"`, etc.","returnComment":"","required":true,"order":0},"eventInit":{"kind":"property","name":"eventInit","type":{"name":"EvaluationArgument"},"comment":"event-specific initialization properties.","returnComment":"","required":false,"order":1}}},"fill":{"kind":"method","name":"fill","type":{"name":"Promise"},"comment":"This method waits for actionability checks, focuses the element, fills it and triggers an `input` event after filling.\nIf the element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.\nNote that you can pass an empty string to clear the input field.","returnComment":"","required":true,"args":{"value":{"kind":"property","name":"value","type":{"name":"string"},"comment":"Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"focus":{"kind":"method","name":"focus","type":{"name":"Promise"},"comment":"Calls focus on the element.","returnComment":"","required":true,"args":{}},"getAttribute":{"kind":"method","name":"getAttribute","type":{"name":"Promise<null|string>"},"comment":"Returns element attribute value.","returnComment":"","required":true,"args":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"Attribute name to get the value for.","returnComment":"","required":true,"order":0}}},"hover":{"kind":"method","name":"hover","type":{"name":"Promise"},"comment":"This method hovers over the element by performing the following steps:\n\nWait for actionability checks on the element, unless `force` option is set.\nScroll the element into view if needed.\nUse page.mouse to hover over the center of the element, or the specified `position`.\nWait 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 rejects.\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.","returnComment":"Promise that resolves when the element is successfully hovered.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"position":{"kind":"property","name":"position","type":{"name":"Object","properties":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.","returnComment":"","required":false},"modifiers":{"kind":"property","name":"modifiers","type":{"name":"Array<\"Alt\"|\"Control\"|\"Meta\"|\"Shift\">"},"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.","returnComment":"","required":false},"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"innerHTML":{"kind":"method","name":"innerHTML","type":{"name":"Promise<string>"},"comment":"","returnComment":"Resolves to the `element.innerHTML`.","required":true,"args":{}},"innerText":{"kind":"method","name":"innerText","type":{"name":"Promise<string>"},"comment":"","returnComment":"Resolves to the `element.innerText`.","required":true,"args":{}},"ownerFrame":{"kind":"method","name":"ownerFrame","type":{"name":"Promise<null|Frame>"},"comment":"","returnComment":"Returns the frame containing the given element.","required":true,"args":{}},"press":{"kind":"method","name":"press","type":{"name":"Promise"},"comment":"Focuses the element, and then uses `keyboard.down` and `keyboard.up`.\n`key` can specify the intended keyboardEvent.key value or a single character to generate the text for. A superset of the `key` values can be found here. Examples of the keys are:\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`, `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.\nFollowing modification shortcuts are also suported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective texts.\nShortcuts such as `key: \"Control+o\"` or `key: \"Control+Shift+T\"` are supported as well. When speficied with the modifier, modifier is pressed and being held while the subsequent key is being pressed.","returnComment":"","required":true,"args":{"key":{"kind":"property","name":"key","type":{"name":"string"},"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"screenshot":{"kind":"method","name":"screenshot","type":{"name":"Promise<Buffer>"},"comment":"This method waits for the actionability checks, then scrolls element into view before taking a screenshot. If the element is detached from DOM, the method throws an error.","returnComment":"Promise which resolves to buffer with the captured screenshot.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.","returnComment":"","required":false},"type":{"kind":"property","name":"type","type":{"name":"\"jpeg\"|\"png\""},"comment":"Specify screenshot type, defaults to `png`.","returnComment":"","required":false},"quality":{"kind":"property","name":"quality","type":{"name":"number"},"comment":"The quality of the image, between 0-100. Not applicable to `png` images.","returnComment":"","required":false},"omitBackground":{"kind":"property","name":"omitBackground","type":{"name":"boolean"},"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"Screenshot options.","returnComment":"","required":false,"order":0}}},"scrollIntoViewIfNeeded":{"kind":"method","name":"scrollIntoViewIfNeeded","type":{"name":"Promise"},"comment":"This method waits for actionability checks, then tries to scroll element into view, unless it is completely visible as defined by IntersectionObserver's `ratio`.\nThrows when `elementHandle` does not point to an element connected to a Document or a ShadowRoot.","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"selectOption":{"kind":"method","name":"selectOption","type":{"name":"Promise<Array<string>>"},"comment":"Triggers a `change` and `input` event once all the provided options have been selected.\nIf element is not a `<select>` element, the method throws an error.\n```js\n// single selection matching the value\nhandle.selectOption('blue');\n\n// single selection matching both the value and the label\nhandle.selectOption({ label: 'Blue' });\n\n// multiple selection\nhandle.selectOption('red', 'green', 'blue');\n\n// multiple selection for blue, red and second option\nhandle.selectOption({ value: 'blue' }, { index: 2 }, 'red');\n```","returnComment":"An array of option values that have been successfully selected.","required":true,"args":{"values":{"kind":"property","name":"values","type":{"name":"null|string|ElementHandle|Array<string>|Object|Array<ElementHandle>|Array<Object>","properties":{"value":{"kind":"property","name":"value","type":{"name":"string"},"comment":"Matches by `option.value`.","returnComment":"","required":false},"label":{"kind":"property","name":"label","type":{"name":"string"},"comment":"Matches by `option.label`.","returnComment":"","required":false},"index":{"kind":"property","name":"index","type":{"name":"number"},"comment":"Matches by the index.","returnComment":"","required":false}}},"comment":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option is considered matching if all specified properties match.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"selectText":{"kind":"method","name":"selectText","type":{"name":"Promise"},"comment":"This method waits for actionability checks, then focuses the element and selects all its text content.","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"setInputFiles":{"kind":"method","name":"setInputFiles","type":{"name":"Promise"},"comment":"This method expects `elementHandle` to point to an input element.\nSets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.","returnComment":"","required":true,"args":{"files":{"kind":"property","name":"files","type":{"name":"string|Array<string>|Object|Array<Object>","properties":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"File name **required**","returnComment":"","required":true},"mimeType":{"kind":"property","name":"mimeType","type":{"name":"string"},"comment":"File type **required**","returnComment":"","required":true},"buffer":{"kind":"property","name":"buffer","type":{"name":"Buffer"},"comment":"File content **required**","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"textContent":{"kind":"method","name":"textContent","type":{"name":"Promise<null|string>"},"comment":"","returnComment":"Resolves to the `node.textContent`.","required":true,"args":{}},"toString":{"kind":"method","name":"toString","type":{"name":"string"},"comment":"","returnComment":"","required":true,"args":{}},"type":{"kind":"method","name":"type","type":{"name":"Promise"},"comment":"Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.\nTo press a special key, like `Control` or `ArrowDown`, use `elementHandle.press`.\n```js\nawait elementHandle.type('Hello'); // Types instantly\nawait elementHandle.type('World', {delay: 100}); // Types slower, like a user\n```\nAn example of typing into a text field and then submitting the form:\n```js\nconst elementHandle = await page.$('input');\nawait elementHandle.type('some text');\nawait elementHandle.press('Enter');\n```","returnComment":"","required":true,"args":{"text":{"kind":"property","name":"text","type":{"name":"string"},"comment":"A text to type into a focused element.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"uncheck":{"kind":"method","name":"uncheck","type":{"name":"Promise"},"comment":"This method checks the element by performing the following steps:\n\nEnsure that element is a checkbox or a radio input. If not, this method rejects. If the element is already unchecked, this method returns immediately.\nWait for actionability checks on the element, unless `force` option is set.\nScroll the element into view if needed.\nUse page.mouse to click in the center of the element.\nWait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\nEnsure that the element is now unchecked. If not, this method rejects.\n\nIf the element is detached from the DOM at any moment during the action, this method rejects.\nWhen all steps combined have not finished during the specified `timeout`, this method rejects with a TimeoutError. Passing zero timeout disables this.","returnComment":"Promise that resolves when the element is successfully unchecked.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"force":{"kind":"property","name":"force","type":{"name":"boolean"},"comment":"Whether to bypass the actionability checks. Defaults to `false`.","returnComment":"","required":false},"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"waitForElementState":{"kind":"method","name":"waitForElementState","type":{"name":"Promise"},"comment":"Depending on the `state` parameter, this method waits for one of the actionability checks to pass. This method throws when the element is detached while waiting, unless waiting for the `\"hidden\"` state.\n\n`\"visible\"` Wait until the element is visible.\n`\"hidden\"` Wait until the element is not visible or not attached. Note that waiting for hidden does not throw when the element detaches.\n`\"stable\"` Wait until the element is both visible and stable.\n`\"enabled\"` Wait until the element is enabled.\n`\"disabled\"` Wait until the element is not enabled.\n\nIf the element does not satisfy the condition for the `timeout` milliseconds, this method will throw.","returnComment":"Promise that resolves when the element satisfies the `state`.","required":true,"args":{"state":{"kind":"property","name":"state","type":{"name":"\"disabled\"|\"enabled\"|\"hidden\"|\"stable\"|\"visible\""},"comment":"A state to wait for, see below for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"waitForSelector":{"kind":"method","name":"waitForSelector","type":{"name":"Promise<null|ElementHandle>"},"comment":"Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.\n```js\nawait page.setContent(`<div><span></span></div>`);\nconst div = await page.$('div');\n// Waiting for the 'span' selector relative to the div.\nconst span = await div.waitForSelector('span', { state: 'attached' });\n```\n\n**NOTE** This method does not work across navigations, use page.waitForSelector(selector[, options]) instead.","returnComment":"Promise that resolves when element specified by selector satisfies `state` option. Resolves to `null` if waiting for `hidden` or `detached`.","required":true,"args":{"selector":{"kind":"property","name":"selector","type":{"name":"string"},"comment":"A selector of an element to wait for, relative to the element handle. See working with selectors for more details.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"state":{"kind":"property","name":"state","type":{"name":"\"attached\"|\"detached\"|\"hidden\"|\"visible\""},"comment":"Defaults to `'visible'`. Can be either:\n - `'attached'` - wait for element to be present in DOM.\n - `'detached'` - wait for element to not be present in DOM.\n - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without any content or with `display:none` has an empty bounding box and is not considered visible.\n - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`. This is opposite to the `'visible'` option.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}}}},"JSHandle":{"name":"JSHandle","members":{"asElement":{"kind":"method","name":"asElement","type":{"name":"null|ElementHandle"},"comment":"Returns either `null` or the object handle itself, if the object handle is an instance of ElementHandle.","returnComment":"","required":true,"args":{}},"dispose":{"kind":"method","name":"dispose","type":{"name":"Promise"},"comment":"The `jsHandle.dispose` method stops referencing the element handle.","returnComment":"Promise which resolves when the object handle is successfully disposed.","required":true,"args":{}},"evaluate":{"kind":"method","name":"evaluate","type":{"name":"Promise<Serializable>"},"comment":"This method passes this handle as the first argument to `pageFunction`.\nIf `pageFunction` returns a Promise, then `handle.evaluate` would wait for the promise to resolve and return its value.\nExamples:\n```js\nconst tweetHandle = await page.$('.tweet .retweets');\nexpect(await tweetHandle.evaluate((node, suffix) => node.innerText, ' retweets')).toBe('10 retweets');\n```","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function"},"comment":"Function to be evaluated in browser context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1}}},"evaluateHandle":{"kind":"method","name":"evaluateHandle","type":{"name":"Promise<JSHandle>"},"comment":"This method passes this handle as the first argument to `pageFunction`.\nThe only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` returns in-page object (JSHandle).\nIf the function passed to the `jsHandle.evaluateHandle` returns a Promise, then `jsHandle.evaluateHandle` would wait for the promise to resolve and return its value.\nSee page.evaluateHandle() for more details.","returnComment":"Promise which resolves to the return value of `pageFunction` as in-page object (JSHandle)","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1}}},"getProperties":{"kind":"method","name":"getProperties","type":{"name":"Promise<Map<string, JSHandle>>"},"comment":"The method returns a map with **own property names** as keys and JSHandle instances for the property values.\n```js\nconst handle = await page.evaluateHandle(() => ({window, document}));\nconst properties = await handle.getProperties();\nconst windowHandle = properties.get('window');\nconst documentHandle = properties.get('document');\nawait handle.dispose();\n```","returnComment":"","required":true,"args":{}},"getProperty":{"kind":"method","name":"getProperty","type":{"name":"Promise<JSHandle>"},"comment":"Fetches a single property from the referenced object.","returnComment":"","required":true,"args":{"propertyName":{"kind":"property","name":"propertyName","type":{"name":"string"},"comment":"property to get","returnComment":"","required":true,"order":0}}},"jsonValue":{"kind":"method","name":"jsonValue","type":{"name":"Promise<Serializable>"},"comment":"Returns a JSON representation of the object. If the object has a\n`toJSON`\nfunction, it **will not be called**.\n\n**NOTE** The method will return an empty JSON object if the referenced object is not stringifiable. It will throw an error if the object has circular references.","returnComment":"","required":true,"args":{}}}},"ConsoleMessage":{"name":"ConsoleMessage","members":{"args":{"kind":"method","name":"args","type":{"name":"Array<JSHandle>"},"comment":"","returnComment":"","required":true,"args":{}},"location":{"kind":"method","name":"location","type":{"name":"Object","properties":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"URL of the resource if available, otherwise empty string.","returnComment":"","required":true},"lineNumber":{"kind":"property","name":"lineNumber","type":{"name":"number"},"comment":"0-based line number in the resource.","returnComment":"","required":true},"columnNumber":{"kind":"property","name":"columnNumber","type":{"name":"number"},"comment":"0-based column number in the resource.","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true,"args":{}},"text":{"kind":"method","name":"text","type":{"name":"string"},"comment":"","returnComment":"","required":true,"args":{}},"type":{"kind":"method","name":"type","type":{"name":"string"},"comment":"One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`, `'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`, `'count'`, `'timeEnd'`.","returnComment":"","required":true,"args":{}}}},"Dialog":{"name":"Dialog","members":{"accept":{"kind":"method","name":"accept","type":{"name":"Promise"},"comment":"","returnComment":"Promise which resolves when the dialog has been accepted.","required":true,"args":{"promptText":{"kind":"property","name":"promptText","type":{"name":"string"},"comment":"A text to enter in prompt. Does not cause any effects if the dialog's `type` is not prompt.","returnComment":"","required":false,"order":0}}},"defaultValue":{"kind":"method","name":"defaultValue","type":{"name":"string"},"comment":"","returnComment":"If dialog is prompt, returns default prompt value. Otherwise, returns empty string.","required":true,"args":{}},"dismiss":{"kind":"method","name":"dismiss","type":{"name":"Promise"},"comment":"","returnComment":"Promise which resolves when the dialog has been dismissed.","required":true,"args":{}},"message":{"kind":"method","name":"message","type":{"name":"string"},"comment":"","returnComment":"A message displayed in the dialog.","required":true,"args":{}},"type":{"kind":"method","name":"type","type":{"name":"string"},"comment":"","returnComment":"Dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`.","required":true,"args":{}}}},"Download":{"name":"Download","members":{"createReadStream":{"kind":"method","name":"createReadStream","type":{"name":"Promise<null|Readable>"},"comment":"Returns readable stream for current download or `null` if download failed.","returnComment":"","required":true,"args":{}},"delete":{"kind":"method","name":"delete","type":{"name":"Promise"},"comment":"Deletes the downloaded file.","returnComment":"","required":true,"args":{}},"failure":{"kind":"method","name":"failure","type":{"name":"Promise<null|string>"},"comment":"Returns download error if any.","returnComment":"","required":true,"args":{}},"path":{"kind":"method","name":"path","type":{"name":"Promise<null|string>"},"comment":"Returns path to the downloaded file in case of successful download.","returnComment":"","required":true,"args":{}},"saveAs":{"kind":"method","name":"saveAs","type":{"name":"Promise"},"comment":"Saves the download to a user-specified path.","returnComment":"","required":true,"args":{"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Path where the download should be saved.","returnComment":"","required":true,"order":0}}},"suggestedFilename":{"kind":"method","name":"suggestedFilename","type":{"name":"string"},"comment":"Returns suggested filename for this download. It is typically computed by the browser from the `Content-Disposition` response header or the `download` attribute. See the spec on whatwg. Different browsers can use different logic for computing it.","returnComment":"","required":true,"args":{}},"url":{"kind":"method","name":"url","type":{"name":"string"},"comment":"Returns downloaded url.","returnComment":"","required":true,"args":{}}}},"Video":{"name":"Video","members":{"path":{"kind":"method","name":"path","type":{"name":"Promise<string>"},"comment":"Returns the file system path this video will be recorded to. The video is guaranteed to be written to the filesystem upon closing the browser context.","returnComment":"","required":true,"args":{}}}},"FileChooser":{"name":"FileChooser","members":{"element":{"kind":"method","name":"element","type":{"name":"ElementHandle"},"comment":"Returns input element associated with this file chooser.","returnComment":"","required":true,"args":{}},"isMultiple":{"kind":"method","name":"isMultiple","type":{"name":"boolean"},"comment":"Returns whether this file chooser accepts multiple files.","returnComment":"","required":true,"args":{}},"page":{"kind":"method","name":"page","type":{"name":"Page"},"comment":"Returns page this file chooser belongs to.","returnComment":"","required":true,"args":{}},"setFiles":{"kind":"method","name":"setFiles","type":{"name":"Promise"},"comment":"Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.","returnComment":"","required":true,"args":{"files":{"kind":"property","name":"files","type":{"name":"string|Array<string>|Object|Array<Object>","properties":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"File name **required**","returnComment":"","required":true},"mimeType":{"kind":"property","name":"mimeType","type":{"name":"string"},"comment":"File type **required**","returnComment":"","required":true},"buffer":{"kind":"property","name":"buffer","type":{"name":"Buffer"},"comment":"File content **required**","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"noWaitAfter":{"kind":"property","name":"noWaitAfter","type":{"name":"boolean"},"comment":"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`.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}}}},"Keyboard":{"name":"Keyboard","members":{"down":{"kind":"method","name":"down","type":{"name":"Promise"},"comment":"Dispatches a `keydown` event.\n`key` can specify the intended keyboardEvent.key value or a single character to generate the text for. A superset of the `key` values can be found here. Examples of the keys are:\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`, `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.\nFollowing modification shortcuts are also suported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective texts.\nIf `key` is a modifier key, `Shift`, `Meta`, `Control`, or `Alt`, subsequent key presses will be sent with that modifier active. To release the modifier key, use `keyboard.up`.\nAfter the key is pressed once, subsequent calls to `keyboard.down` will have repeat set to true. To release the key, use `keyboard.up`.\n\n**NOTE** Modifier keys DO influence `keyboard.down`. Holding down `Shift` will type the text in upper case.","returnComment":"","required":true,"args":{"key":{"kind":"property","name":"key","type":{"name":"string"},"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","returnComment":"","required":true,"order":0}}},"insertText":{"kind":"method","name":"insertText","type":{"name":"Promise"},"comment":"Dispatches only `input` event, does not emit the `keydown`, `keyup` or `keypress` events.\n```js\npage.keyboard.insertText('嗨');\n```\n\n**NOTE** Modifier keys DO NOT effect `keyboard.insertText`. Holding down `Shift` will not type the text in upper case.","returnComment":"","required":true,"args":{"text":{"kind":"property","name":"text","type":{"name":"string"},"comment":"Sets input to the specified text value.","returnComment":"","required":true,"order":0}}},"press":{"kind":"method","name":"press","type":{"name":"Promise"},"comment":"`key` can specify the intended keyboardEvent.key value or a single character to generate the text for. A superset of the `key` values can be found here. Examples of the keys are:\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`, `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.\nFollowing modification shortcuts are also suported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective texts.\nShortcuts such as `key: \"Control+o\"` or `key: \"Control+Shift+T\"` are supported as well. When speficied with the modifier, modifier is pressed and being held while the subsequent key is being pressed.\n```js\nconst page = await browser.newPage();\nawait page.goto('https://keycode.info');\nawait page.keyboard.press('A');\nawait page.screenshot({ path: 'A.png' });\nawait page.keyboard.press('ArrowLeft');\nawait page.screenshot({ path: 'ArrowLeft.png' });\nawait page.keyboard.press('Shift+O');\nawait page.screenshot({ path: 'O.png' });\nawait browser.close();\n```\nShortcut for `keyboard.down` and `keyboard.up`.","returnComment":"","required":true,"args":{"key":{"kind":"property","name":"key","type":{"name":"string"},"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"type":{"kind":"method","name":"type","type":{"name":"Promise"},"comment":"Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.\nTo press a special key, like `Control` or `ArrowDown`, use `keyboard.press`.\n```js\nawait page.keyboard.type('Hello'); // Types instantly\nawait page.keyboard.type('World', {delay: 100}); // Types slower, like a user\n```\n\n**NOTE** Modifier keys DO NOT effect `keyboard.type`. Holding down `Shift` will not type the text in upper case.","returnComment":"","required":true,"args":{"text":{"kind":"property","name":"text","type":{"name":"string"},"comment":"A text to type into a focused element.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"up":{"kind":"method","name":"up","type":{"name":"Promise"},"comment":"Dispatches a `keyup` event.","returnComment":"","required":true,"args":{"key":{"kind":"property","name":"key","type":{"name":"string"},"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","returnComment":"","required":true,"order":0}}}}},"Mouse":{"name":"Mouse","members":{"click":{"kind":"method","name":"click","type":{"name":"Promise"},"comment":"Shortcut for `mouse.move`, `mouse.down` and `mouse.up`.","returnComment":"","required":true,"args":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true,"order":0},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"clickCount":{"kind":"property","name":"clickCount","type":{"name":"number"},"comment":"defaults to 1. See UIEvent.detail.","returnComment":"","required":false},"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"dblclick":{"kind":"method","name":"dblclick","type":{"name":"Promise"},"comment":"Shortcut for `mouse.move`, `mouse.down`, `mouse.up`, `mouse.down` and `mouse.up`.","returnComment":"","required":true,"args":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true,"order":0},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"delay":{"kind":"property","name":"delay","type":{"name":"number"},"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"down":{"kind":"method","name":"down","type":{"name":"Promise"},"comment":"Dispatches a `mousedown` event.","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"clickCount":{"kind":"property","name":"clickCount","type":{"name":"number"},"comment":"defaults to 1. See UIEvent.detail.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}},"move":{"kind":"method","name":"move","type":{"name":"Promise"},"comment":"Dispatches a `mousemove` event.","returnComment":"","required":true,"args":{"x":{"kind":"property","name":"x","type":{"name":"number"},"comment":"","returnComment":"","required":true,"order":0},"y":{"kind":"property","name":"y","type":{"name":"number"},"comment":"","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"steps":{"kind":"property","name":"steps","type":{"name":"number"},"comment":"defaults to 1. Sends intermediate `mousemove` events.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}},"up":{"kind":"method","name":"up","type":{"name":"Promise"},"comment":"Dispatches a `mouseup` event.","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"button":{"kind":"property","name":"button","type":{"name":"\"left\"|\"middle\"|\"right\""},"comment":"Defaults to `left`.","returnComment":"","required":false},"clickCount":{"kind":"property","name":"clickCount","type":{"name":"number"},"comment":"defaults to 1. See UIEvent.detail.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}}}},"Request":{"name":"Request","members":{"failure":{"kind":"method","name":"failure","type":{"name":"null|Object","properties":{"errorText":{"kind":"property","name":"errorText","type":{"name":"string"},"comment":"Human-readable error message, e.g. `'net::ERR_FAILED'`.","returnComment":"","required":true}}},"comment":"The method returns `null` unless this request has failed, as reported by\n`requestfailed` event.\nExample of logging of all the failed requests:\n```js\npage.on('requestfailed', request => {\n console.log(request.url() + ' ' + request.failure().errorText);\n});\n```","returnComment":"Object describing request failure, if any","required":true,"args":{}},"frame":{"kind":"method","name":"frame","type":{"name":"Frame"},"comment":"","returnComment":"A Frame that initiated this request.","required":true,"args":{}},"headers":{"kind":"method","name":"headers","type":{"name":"Object<string, string>"},"comment":"","returnComment":"An object with HTTP headers associated with the request. All header names are lower-case.","required":true,"args":{}},"isNavigationRequest":{"kind":"method","name":"isNavigationRequest","type":{"name":"boolean"},"comment":"Whether this request is driving frame's navigation.","returnComment":"","required":true,"args":{}},"method":{"kind":"method","name":"method","type":{"name":"string"},"comment":"","returnComment":"Request's method (GET, POST, etc.)","required":true,"args":{}},"postData":{"kind":"method","name":"postData","type":{"name":"null|string"},"comment":"","returnComment":"Request's post body, if any.","required":true,"args":{}},"postDataBuffer":{"kind":"method","name":"postDataBuffer","type":{"name":"null|Buffer"},"comment":"","returnComment":"Request's post body in a binary form, if any.","required":true,"args":{}},"postDataJSON":{"kind":"method","name":"postDataJSON","type":{"name":"null|Object"},"comment":"When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned. Otherwise it will be parsed as JSON.","returnComment":"Parsed request's body for `form-urlencoded` and JSON as a fallback if any.","required":true,"args":{}},"redirectedFrom":{"kind":"method","name":"redirectedFrom","type":{"name":"null|Request"},"comment":"When the server responds with a redirect, Playwright creates a new Request object. The two requests are connected by `redirectedFrom()` and `redirectedTo()` methods. When multiple server redirects has happened, it is possible to construct the whole redirect chain by repeatedly calling `redirectedFrom()`.\nFor example, if the website `http://example.com` redirects to `https://example.com`:\n```js\nconst response = await page.goto('http://example.com');\nconsole.log(response.request().redirectedFrom().url()); // 'http://example.com'\n```\nIf the website `https://google.com` has no redirects:\n```js\nconst response = await page.goto('https://google.com');\nconsole.log(response.request().redirectedFrom()); // null\n```","returnComment":"Request that was redirected by the server to this one, if any.","required":true,"args":{}},"redirectedTo":{"kind":"method","name":"redirectedTo","type":{"name":"null|Request"},"comment":"This method is the opposite of request.redirectedFrom():\n```js\nconsole.log(request.redirectedFrom().redirectedTo() === request); // true\n```","returnComment":"New request issued by the browser if the server responded with redirect.","required":true,"args":{}},"resourceType":{"kind":"method","name":"resourceType","type":{"name":"string"},"comment":"Contains the request's resource type as it was perceived by the rendering engine.\nResourceType will be one of the following: `document`, `stylesheet`, `image`, `media`, `font`, `script`, `texttrack`, `xhr`, `fetch`, `eventsource`, `websocket`, `manifest`, `other`.","returnComment":"","required":true,"args":{}},"response":{"kind":"method","name":"response","type":{"name":"Promise<null|Response>"},"comment":"","returnComment":"A matching Response object, or `null` if the response was not received due to error.","required":true,"args":{}},"url":{"kind":"method","name":"url","type":{"name":"string"},"comment":"","returnComment":"URL of the request.","required":true,"args":{}}}},"Response":{"name":"Response","members":{"body":{"kind":"method","name":"body","type":{"name":"Promise<Buffer>"},"comment":"","returnComment":"Promise which resolves to a buffer with response body.","required":true,"args":{}},"finished":{"kind":"method","name":"finished","type":{"name":"Promise<null|Error>"},"comment":"","returnComment":"Waits for this response to finish, returns failure error if request failed.","required":true,"args":{}},"frame":{"kind":"method","name":"frame","type":{"name":"Frame"},"comment":"","returnComment":"A Frame that initiated this response.","required":true,"args":{}},"headers":{"kind":"method","name":"headers","type":{"name":"Object<string, string>"},"comment":"","returnComment":"An object with HTTP headers associated with the response. All header names are lower-case.","required":true,"args":{}},"json":{"kind":"method","name":"json","type":{"name":"Promise<Serializable>"},"comment":"This method will throw if the response body is not parsable via `JSON.parse`.","returnComment":"Promise which resolves to a JSON representation of response body.","required":true,"args":{}},"ok":{"kind":"method","name":"ok","type":{"name":"boolean"},"comment":"Contains a boolean stating whether the response was successful (status in the range 200-299) or not.","returnComment":"","required":true,"args":{}},"request":{"kind":"method","name":"request","type":{"name":"Request"},"comment":"","returnComment":"A matching Request object.","required":true,"args":{}},"status":{"kind":"method","name":"status","type":{"name":"number"},"comment":"Contains the status code of the response (e.g., 200 for a success).","returnComment":"","required":true,"args":{}},"statusText":{"kind":"method","name":"statusText","type":{"name":"string"},"comment":"Contains the status text of the response (e.g. usually an \"OK\" for a success).","returnComment":"","required":true,"args":{}},"text":{"kind":"method","name":"text","type":{"name":"Promise<string>"},"comment":"","returnComment":"Promise which resolves to a text representation of response body.","required":true,"args":{}},"url":{"kind":"method","name":"url","type":{"name":"string"},"comment":"Contains the URL of the response.","returnComment":"","required":true,"args":{}}}},"Selectors":{"name":"Selectors","members":{"register":{"kind":"method","name":"register","type":{"name":"Promise"},"comment":"An example of registering selector engine that queries elements based on a tag name:\n```js\nconst { selectors, firefox } = require('playwright'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n // Must be a function that evaluates to a selector engine instance.\n const createTagNameEngine = () => ({\n // Creates a selector that matches given target when queried at the root.\n // Can return undefined if unable to create one.\n create(root, target) {\n return root.querySelector(target.tagName) === target ? target.tagName : undefined;\n },\n\n // Returns the first element matching given selector in the root's subtree.\n query(root, selector) {\n return root.querySelector(selector);\n },\n\n // Returns all elements matching given selector in the root's subtree.\n queryAll(root, selector) {\n return Array.from(root.querySelectorAll(selector));\n }\n });\n\n // Register the engine. Selectors will be prefixed with \"tag=\".\n await selectors.register('tag', createTagNameEngine);\n\n const browser = await firefox.launch();\n const page = await browser.newPage();\n await page.setContent(`<div><button>Click me</button></div>`);\n\n // Use the selector prefixed with its name.\n const button = await page.$('tag=button');\n // Combine it with other selector engines.\n await page.click('tag=div >> text=\"Click me\"');\n // Can use it in any methods supporting selectors.\n const buttonCount = await page.$$eval('tag=button', buttons => buttons.length);\n\n await browser.close();\n})();\n```","returnComment":"","required":true,"args":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"Name that is used in selectors as a prefix, e.g. `{name: 'foo'}` enables `foo=myselectorbody` selectors. May only contain `[a-zA-Z0-9_]` characters.","returnComment":"","required":true,"order":0},"script":{"kind":"property","name":"script","type":{"name":"function|string|Object","properties":{"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to current working directory.","returnComment":"","required":false},"content":{"kind":"property","name":"content","type":{"name":"string"},"comment":"Raw script content.","returnComment":"","required":false}}},"comment":"Script that evaluates to a selector engine instance.","returnComment":"","required":true,"order":1},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"contentScript":{"kind":"property","name":"contentScript","type":{"name":"boolean"},"comment":"Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same DOM, but not any JavaScript objects from the frame's scripts. Defaults to `false`. Note that running as a content script is not guaranteed when this engine is used together with other registered engines.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":2}}}}},"Route":{"name":"Route","members":{"abort":{"kind":"method","name":"abort","type":{"name":"Promise"},"comment":"Aborts the route's request.","returnComment":"","required":true,"args":{"errorCode":{"kind":"property","name":"errorCode","type":{"name":"string"},"comment":"Optional error code. Defaults to `failed`, could be\none of the following:\n - `'aborted'` - An operation was aborted (due to user action)\n - `'accessdenied'` - Permission to access a resource, other than the network, was denied\n - `'addressunreachable'` - The IP address is unreachable. This usually means\n - that there is no route to the specified host or network.\n - `'blockedbyclient'` - The client chose to block the request.\n - `'blockedbyresponse'` - The request failed because the response was delivered along with requirements which are not met ('X-Frame-Options' and 'Content-Security-Policy' ancestor checks, for instance).\n - `'connectionaborted'` - A connection timed out as a result of not receiving an ACK for data sent.\n - `'connectionclosed'` - A connection was closed (corresponding to a TCP FIN).\n - `'connectionfailed'` - A connection attempt failed.\n - `'connectionrefused'` - A connection attempt was refused.\n - `'connectionreset'` - A connection was reset (corresponding to a TCP RST).\n - `'internetdisconnected'` - The Internet connection has been lost.\n - `'namenotresolved'` - The host name could not be resolved.\n - `'timedout'` - An operation timed out.\n - `'failed'` - A generic failure occurred.","returnComment":"","required":false,"order":0}}},"continue":{"kind":"method","name":"continue","type":{"name":"Promise"},"comment":"Continues route's request with optional overrides.\n```js\nawait page.route('**/*', (route, request) => {\n // Override headers\n const headers = {\n ...request.headers(),\n foo: 'bar', // set \"foo\" header\n origin: undefined, // remove \"origin\" header\n };\n route.continue({headers});\n});\n```","returnComment":"","required":true,"args":{"overrides":{"kind":"property","name":"overrides","type":{"name":"Object","properties":{"method":{"kind":"property","name":"method","type":{"name":"string"},"comment":"If set changes the request method (e.g. GET or POST)","returnComment":"","required":false},"postData":{"kind":"property","name":"postData","type":{"name":"string|Buffer"},"comment":"If set changes the post data of request","returnComment":"","required":false},"headers":{"kind":"property","name":"headers","type":{"name":"Object<string, string>"},"comment":"If set changes the request HTTP headers. Header values will be converted to a string.","returnComment":"","required":false}}},"comment":"Optional request overrides, which can be one of the following:","returnComment":"","required":false,"order":0}}},"fulfill":{"kind":"method","name":"fulfill","type":{"name":"Promise"},"comment":"Fulfills route's request with given response.\nAn example of fulfilling all requests with 404 responses:\n```js\nawait page.route('**/*', route => {\n route.fulfill({\n status: 404,\n contentType: 'text/plain',\n body: 'Not Found!'\n });\n});\n```\nAn example of serving static file:\n```js\nawait page.route('**/xhr_endpoint', route => route.fulfill({ path: 'mock_data.json' }));\n```","returnComment":"","required":true,"args":{"response":{"kind":"property","name":"response","type":{"name":"Object","properties":{"status":{"kind":"property","name":"status","type":{"name":"number"},"comment":"Response status code, defaults to `200`.","returnComment":"","required":false},"headers":{"kind":"property","name":"headers","type":{"name":"Object<string, string>"},"comment":"Optional response headers. Header values will be converted to a string.","returnComment":"","required":false},"contentType":{"kind":"property","name":"contentType","type":{"name":"string"},"comment":"If set, equals to setting `Content-Type` response header.","returnComment":"","required":false},"body":{"kind":"property","name":"body","type":{"name":"string|Buffer"},"comment":"Optional response body.","returnComment":"","required":false},"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"Optional file path to respond with. The content type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to current working directory.","returnComment":"","required":false}}},"comment":"Response that will fulfill this route's request.","returnComment":"","required":true,"order":0}}},"request":{"kind":"method","name":"request","type":{"name":"Request"},"comment":"","returnComment":"A request to be routed.","required":true,"args":{}}}},"TimeoutError":{"name":"TimeoutError","extends":"Error","members":{}},"Accessibility":{"name":"Accessibility","members":{"snapshot":{"kind":"method","name":"snapshot","type":{"name":"Promise<null|Object>","properties":{"role":{"kind":"property","name":"role","type":{"name":"string"},"comment":"The role.","returnComment":"","required":true},"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"A human readable name for the node.","returnComment":"","required":true},"value":{"kind":"property","name":"value","type":{"name":"string|number"},"comment":"The current value of the node, if applicable.","returnComment":"","required":false},"description":{"kind":"property","name":"description","type":{"name":"string"},"comment":"An additional human readable description of the node, if applicable.","returnComment":"","required":false},"keyshortcuts":{"kind":"property","name":"keyshortcuts","type":{"name":"string"},"comment":"Keyboard shortcuts associated with this node, if applicable.","returnComment":"","required":false},"roledescription":{"kind":"property","name":"roledescription","type":{"name":"string"},"comment":"A human readable alternative to the role, if applicable.","returnComment":"","required":false},"valuetext":{"kind":"property","name":"valuetext","type":{"name":"string"},"comment":"A description of the current value, if applicable.","returnComment":"","required":false},"disabled":{"kind":"property","name":"disabled","type":{"name":"boolean"},"comment":"Whether the node is disabled, if applicable.","returnComment":"","required":false},"expanded":{"kind":"property","name":"expanded","type":{"name":"boolean"},"comment":"Whether the node is expanded or collapsed, if applicable.","returnComment":"","required":false},"focused":{"kind":"property","name":"focused","type":{"name":"boolean"},"comment":"Whether the node is focused, if applicable.","returnComment":"","required":false},"modal":{"kind":"property","name":"modal","type":{"name":"boolean"},"comment":"Whether the node is modal, if applicable.","returnComment":"","required":false},"multiline":{"kind":"property","name":"multiline","type":{"name":"boolean"},"comment":"Whether the node text input supports multiline, if applicable.","returnComment":"","required":false},"multiselectable":{"kind":"property","name":"multiselectable","type":{"name":"boolean"},"comment":"Whether more than one child can be selected, if applicable.","returnComment":"","required":false},"readonly":{"kind":"property","name":"readonly","type":{"name":"boolean"},"comment":"Whether the node is read only, if applicable.","returnComment":"","required":false},"required":{"kind":"property","name":"required","type":{"name":"boolean"},"comment":"Whether the node is required, if applicable.","returnComment":"","required":false},"selected":{"kind":"property","name":"selected","type":{"name":"boolean"},"comment":"Whether the node is selected in its parent node, if applicable.","returnComment":"","required":false},"checked":{"kind":"property","name":"checked","type":{"name":"boolean|\"mixed\""},"comment":"Whether the checkbox is checked, or \"mixed\", if applicable.","returnComment":"","required":false},"pressed":{"kind":"property","name":"pressed","type":{"name":"boolean|\"mixed\""},"comment":"Whether the toggle button is checked, or \"mixed\", if applicable.","returnComment":"","required":false},"level":{"kind":"property","name":"level","type":{"name":"number"},"comment":"The level of a heading, if applicable.","returnComment":"","required":false},"valuemin":{"kind":"property","name":"valuemin","type":{"name":"number"},"comment":"The minimum value in a node, if applicable.","returnComment":"","required":false},"valuemax":{"kind":"property","name":"valuemax","type":{"name":"number"},"comment":"The maximum value in a node, if applicable.","returnComment":"","required":false},"autocomplete":{"kind":"property","name":"autocomplete","type":{"name":"string"},"comment":"What kind of autocomplete is supported by a control, if applicable.","returnComment":"","required":false},"haspopup":{"kind":"property","name":"haspopup","type":{"name":"string"},"comment":"What kind of popup is currently being shown for a node, if applicable.","returnComment":"","required":false},"invalid":{"kind":"property","name":"invalid","type":{"name":"string"},"comment":"Whether and in what way this node's value is invalid, if applicable.","returnComment":"","required":false},"orientation":{"kind":"property","name":"orientation","type":{"name":"string"},"comment":"Whether the node is oriented horizontally or vertically, if applicable.","returnComment":"","required":false},"children":{"kind":"property","name":"children","type":{"name":"Array<Object>"},"comment":"Child AXNodes of this node, if any, if applicable.","returnComment":"","required":false}}},"comment":"Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.\n\n**NOTE** The Chromium accessibility tree contains nodes that go unused on most platforms and by\nmost screen readers. Playwright will discard them as well for an easier to process tree,\nunless `interestingOnly` is set to `false`.\n\nAn example of dumping the entire accessibility tree:\n```js\nconst snapshot = await page.accessibility.snapshot();\nconsole.log(snapshot);\n```\nAn example of logging the focused node's name:\n```js\nconst snapshot = await page.accessibility.snapshot();\nconst node = findFocusedNode(snapshot);\nconsole.log(node && node.name);\n\nfunction findFocusedNode(node) {\n if (node.focused)\n return node;\n for (const child of node.children || []) {\n const foundNode = findFocusedNode(child);\n return foundNode;\n }\n return null;\n}\n```","returnComment":"An AXNode object with the following properties:","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"interestingOnly":{"kind":"property","name":"interestingOnly","type":{"name":"boolean"},"comment":"Prune uninteresting nodes from the tree. Defaults to `true`.","returnComment":"","required":false},"root":{"kind":"property","name":"root","type":{"name":"ElementHandle"},"comment":"The root DOM element for the snapshot. Defaults to the whole page.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":0}}}}},"Worker":{"name":"Worker","members":{"close":{"kind":"event","name":"close","type":{"name":"Worker"},"comment":"Emitted when this dedicated WebWorker is terminated.","returnComment":"","required":true,"args":{}},"evaluate":{"kind":"method","name":"evaluate","type":{"name":"Promise<Serializable>"},"comment":"If the function passed to the `worker.evaluate` returns a Promise, then `worker.evaluate` would wait for the promise to resolve and return its value.\nIf the function passed to the `worker.evaluate` returns a non-Serializable value, then `worker.evaluate` resolves to `undefined`. DevTools Protocol also supports transferring some additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`, and bigint literals.","returnComment":"Promise which resolves to the return value of `pageFunction`","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated in the worker context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1}}},"evaluateHandle":{"kind":"method","name":"evaluateHandle","type":{"name":"Promise<JSHandle>"},"comment":"The only difference between `worker.evaluate` and `worker.evaluateHandle` is that `worker.evaluateHandle` returns in-page object (JSHandle).\nIf the function passed to the `worker.evaluateHandle` returns a Promise, then `worker.evaluateHandle` would wait for the promise to resolve and return its value.","returnComment":"Promise which resolves to the return value of `pageFunction` as in-page object (JSHandle)","required":true,"args":{"pageFunction":{"kind":"property","name":"pageFunction","type":{"name":"function|string"},"comment":"Function to be evaluated in the page context","returnComment":"","required":true,"order":0},"arg":{"kind":"property","name":"arg","type":{"name":"EvaluationArgument"},"comment":"Optional argument to pass to `pageFunction`","returnComment":"","required":false,"order":1}}},"url":{"kind":"method","name":"url","type":{"name":"string"},"comment":"","returnComment":"","required":true,"args":{}}}},"BrowserServer":{"name":"BrowserServer","members":{"close":{"kind":"method","name":"close","type":{"name":"Promise"},"comment":"Closes the browser gracefully and makes sure the process is terminated.","returnComment":"","required":true,"args":{}},"kill":{"kind":"method","name":"kill","type":{"name":"Promise"},"comment":"Kills the browser process and waits for the process to exit.","returnComment":"","required":true,"args":{}},"process":{"kind":"method","name":"process","type":{"name":"ChildProcess"},"comment":"","returnComment":"Spawned browser application process.","required":true,"args":{}},"wsEndpoint":{"kind":"method","name":"wsEndpoint","type":{"name":"string"},"comment":"Browser websocket endpoint which can be used as an argument to browserType.connect(options) to establish connection to the browser.","returnComment":"Browser websocket url.","required":true,"args":{}}}},"BrowserType":{"name":"BrowserType","members":{"connect":{"kind":"method","name":"connect","type":{"name":"Promise<Browser>"},"comment":"This methods attaches Playwright to an existing browser instance.","returnComment":"","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"wsEndpoint":{"kind":"property","name":"wsEndpoint","type":{"name":"string"},"comment":"A browser websocket endpoint to connect to. **required**","returnComment":"","required":true},"slowMo":{"kind":"property","name":"slowMo","type":{"name":"number"},"comment":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.","returnComment":"","required":false},"logger":{"kind":"property","name":"logger","type":{"name":"Logger"},"comment":"Logger sink for Playwright logging.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":true,"order":0}}},"executablePath":{"kind":"method","name":"executablePath","type":{"name":"string"},"comment":"","returnComment":"A path where Playwright expects to find a bundled browser executable.","required":true,"args":{}},"launch":{"kind":"method","name":"launch","type":{"name":"Promise<Browser>"},"comment":"You can use `ignoreDefaultArgs` to filter out `--mute-audio` from default arguments:\n```js\nconst browser = await chromium.launch({ // Or 'firefox' or 'webkit'.\n ignoreDefaultArgs: ['--mute-audio']\n});\n```\n\n**Chromium-only** Playwright can also be used to control the Chrome browser, 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.\nIf Google Chrome (rather than Chromium) is preferred, a Chrome Canary or Dev Channel build is suggested.\nIn browserType.launch([options]) above, any mention of Chromium also applies to Chrome.\nSee `this article` for a description of the differences between Chromium and Chrome. `This article` describes some differences for Linux users.","returnComment":"Promise which resolves to browser instance.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"headless":{"kind":"property","name":"headless","type":{"name":"boolean"},"comment":"Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to `true` unless the `devtools` option is `true`.","returnComment":"","required":false},"executablePath":{"kind":"property","name":"executablePath","type":{"name":"string"},"comment":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.","returnComment":"","required":false},"args":{"kind":"property","name":"args","type":{"name":"Array<string>"},"comment":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.","returnComment":"","required":false},"ignoreDefaultArgs":{"kind":"property","name":"ignoreDefaultArgs","type":{"name":"boolean|Array<string>"},"comment":"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`.","returnComment":"","required":false},"proxy":{"kind":"property","name":"proxy","type":{"name":"Object","properties":{"server":{"kind":"property","name":"server","type":{"name":"string"},"comment":"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.","returnComment":"","required":true},"bypass":{"kind":"property","name":"bypass","type":{"name":"string"},"comment":"Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","returnComment":"","required":false},"username":{"kind":"property","name":"username","type":{"name":"string"},"comment":"Optional username to use if HTTP proxy requires authentication.","returnComment":"","required":false},"password":{"kind":"property","name":"password","type":{"name":"string"},"comment":"Optional password to use if HTTP proxy requires authentication.","returnComment":"","required":false}}},"comment":"Network proxy settings.","returnComment":"","required":false},"downloadsPath":{"kind":"property","name":"downloadsPath","type":{"name":"string"},"comment":"If specified, accepted downloads are downloaded into this folder. Otherwise, temporary folder is created and is deleted when browser is closed.","returnComment":"","required":false},"chromiumSandbox":{"kind":"property","name":"chromiumSandbox","type":{"name":"boolean"},"comment":"Enable Chromium sandboxing. Defaults to `false`.","returnComment":"","required":false},"firefoxUserPrefs":{"kind":"property","name":"firefoxUserPrefs","type":{"name":"Object<string, string|number|boolean>"},"comment":"Firefox user preferences. Learn more about the Firefox user preferences at `about:config`.","returnComment":"","required":false},"handleSIGINT":{"kind":"property","name":"handleSIGINT","type":{"name":"boolean"},"comment":"Close the browser process on Ctrl-C. Defaults to `true`.","returnComment":"","required":false},"handleSIGTERM":{"kind":"property","name":"handleSIGTERM","type":{"name":"boolean"},"comment":"Close the browser process on SIGTERM. Defaults to `true`.","returnComment":"","required":false},"handleSIGHUP":{"kind":"property","name":"handleSIGHUP","type":{"name":"boolean"},"comment":"Close the browser process on SIGHUP. Defaults to `true`.","returnComment":"","required":false},"logger":{"kind":"property","name":"logger","type":{"name":"Logger"},"comment":"Logger sink for Playwright logging.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","returnComment":"","required":false},"env":{"kind":"property","name":"env","type":{"name":"Object<string, string|number|boolean>"},"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","returnComment":"","required":false},"devtools":{"kind":"property","name":"devtools","type":{"name":"boolean"},"comment":"**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`.","returnComment":"","required":false},"slowMo":{"kind":"property","name":"slowMo","type":{"name":"number"},"comment":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.","returnComment":"","required":false}}},"comment":"Set of configurable options to set on the browser. Can have the following fields:","returnComment":"","required":false,"order":0}}},"launchPersistentContext":{"kind":"method","name":"launchPersistentContext","type":{"name":"Promise<BrowserContext>"},"comment":"Launches browser that uses persistent storage located at `userDataDir` and returns the only context. Closing this context will automatically close the browser.","returnComment":"Promise that resolves to the persistent browser context instance.","required":true,"args":{"userDataDir":{"kind":"property","name":"userDataDir","type":{"name":"string"},"comment":"Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for Chromium and Firefox.","returnComment":"","required":true,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"headless":{"kind":"property","name":"headless","type":{"name":"boolean"},"comment":"Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to `true` unless the `devtools` option is `true`.","returnComment":"","required":false},"executablePath":{"kind":"property","name":"executablePath","type":{"name":"string"},"comment":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.","returnComment":"","required":false},"args":{"kind":"property","name":"args","type":{"name":"Array<string>"},"comment":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.","returnComment":"","required":false},"ignoreDefaultArgs":{"kind":"property","name":"ignoreDefaultArgs","type":{"name":"boolean|Array<string>"},"comment":"If `true`, then do not use any of the default arguments. If an array is given, then filter out the given default arguments. Dangerous option; use with care. Defaults to `false`.","returnComment":"","required":false},"proxy":{"kind":"property","name":"proxy","type":{"name":"Object","properties":{"server":{"kind":"property","name":"server","type":{"name":"string"},"comment":"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.","returnComment":"","required":true},"bypass":{"kind":"property","name":"bypass","type":{"name":"string"},"comment":"Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","returnComment":"","required":false},"username":{"kind":"property","name":"username","type":{"name":"string"},"comment":"Optional username to use if HTTP proxy requires authentication.","returnComment":"","required":false},"password":{"kind":"property","name":"password","type":{"name":"string"},"comment":"Optional password to use if HTTP proxy requires authentication.","returnComment":"","required":false}}},"comment":"Network proxy settings.","returnComment":"","required":false},"acceptDownloads":{"kind":"property","name":"acceptDownloads","type":{"name":"boolean"},"comment":"Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.","returnComment":"","required":false},"downloadsPath":{"kind":"property","name":"downloadsPath","type":{"name":"string"},"comment":"If specified, accepted downloads are downloaded into this folder. Otherwise, temporary folder is created and is deleted when browser is closed.","returnComment":"","required":false},"chromiumSandbox":{"kind":"property","name":"chromiumSandbox","type":{"name":"boolean"},"comment":"Enable Chromium sandboxing. Defaults to `true`.","returnComment":"","required":false},"handleSIGINT":{"kind":"property","name":"handleSIGINT","type":{"name":"boolean"},"comment":"Close the browser process on Ctrl-C. Defaults to `true`.","returnComment":"","required":false},"handleSIGTERM":{"kind":"property","name":"handleSIGTERM","type":{"name":"boolean"},"comment":"Close the browser process on SIGTERM. Defaults to `true`.","returnComment":"","required":false},"handleSIGHUP":{"kind":"property","name":"handleSIGHUP","type":{"name":"boolean"},"comment":"Close the browser process on SIGHUP. Defaults to `true`.","returnComment":"","required":false},"logger":{"kind":"property","name":"logger","type":{"name":"Logger"},"comment":"Logger sink for Playwright logging.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","returnComment":"","required":false},"env":{"kind":"property","name":"env","type":{"name":"Object<string, string|number|boolean>"},"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","returnComment":"","required":false},"devtools":{"kind":"property","name":"devtools","type":{"name":"boolean"},"comment":"**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`.","returnComment":"","required":false},"slowMo":{"kind":"property","name":"slowMo","type":{"name":"number"},"comment":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.","returnComment":"","required":false},"ignoreHTTPSErrors":{"kind":"property","name":"ignoreHTTPSErrors","type":{"name":"boolean"},"comment":"Whether to ignore HTTPS errors during navigation. Defaults to `false`.","returnComment":"","required":false},"bypassCSP":{"kind":"property","name":"bypassCSP","type":{"name":"boolean"},"comment":"Toggles bypassing page's Content-Security-Policy.","returnComment":"","required":false},"viewport":{"kind":"property","name":"viewport","type":{"name":"null|Object","properties":{"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"page width in pixels.","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"page height in pixels.","returnComment":"","required":true}}},"comment":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.","returnComment":"","required":false},"userAgent":{"kind":"property","name":"userAgent","type":{"name":"string"},"comment":"Specific user agent to use in this context.","returnComment":"","required":false},"deviceScaleFactor":{"kind":"property","name":"deviceScaleFactor","type":{"name":"number"},"comment":"Specify device scale factor (can be thought of as dpr). Defaults to `1`.","returnComment":"","required":false},"isMobile":{"kind":"property","name":"isMobile","type":{"name":"boolean"},"comment":"Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported in Firefox.","returnComment":"","required":false},"hasTouch":{"kind":"property","name":"hasTouch","type":{"name":"boolean"},"comment":"Specifies if viewport supports touch events. Defaults to false.","returnComment":"","required":false},"javaScriptEnabled":{"kind":"property","name":"javaScriptEnabled","type":{"name":"boolean"},"comment":"Whether or not to enable JavaScript in the context. Defaults to true.","returnComment":"","required":false},"timezoneId":{"kind":"property","name":"timezoneId","type":{"name":"string"},"comment":"Changes the timezone of the context. See ICU’s `metaZones.txt` for a list of supported timezone IDs.","returnComment":"","required":false},"geolocation":{"kind":"property","name":"geolocation","type":{"name":"Object","properties":{"latitude":{"kind":"property","name":"latitude","type":{"name":"number"},"comment":"Latitude between -90 and 90.","returnComment":"","required":true},"longitude":{"kind":"property","name":"longitude","type":{"name":"number"},"comment":"Longitude between -180 and 180.","returnComment":"","required":true},"accuracy":{"kind":"property","name":"accuracy","type":{"name":"number"},"comment":"Optional non-negative accuracy value. Defaults to `0`.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false},"locale":{"kind":"property","name":"locale","type":{"name":"string"},"comment":"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.","returnComment":"","required":false},"permissions":{"kind":"property","name":"permissions","type":{"name":"Array<string>"},"comment":"A list of permissions to grant to all pages in this context. See browserContext.grantPermissions for more details.","returnComment":"","required":false},"extraHTTPHeaders":{"kind":"property","name":"extraHTTPHeaders","type":{"name":"Object<string, string>"},"comment":"An object containing additional HTTP headers to be sent with every request. All header values must be strings.","returnComment":"","required":false},"offline":{"kind":"property","name":"offline","type":{"name":"boolean"},"comment":"Whether to emulate network being offline. Defaults to `false`.","returnComment":"","required":false},"httpCredentials":{"kind":"property","name":"httpCredentials","type":{"name":"Object","properties":{"username":{"kind":"property","name":"username","type":{"name":"string"},"comment":"","returnComment":"","required":true},"password":{"kind":"property","name":"password","type":{"name":"string"},"comment":"","returnComment":"","required":true}}},"comment":"Credentials for HTTP authentication.","returnComment":"","required":false},"colorScheme":{"kind":"property","name":"colorScheme","type":{"name":"\"dark\"|\"light\"|\"no-preference\""},"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See page.emulateMedia(options) for more details. Defaults to '`light`'.","returnComment":"","required":false},"videosPath":{"kind":"property","name":"videosPath","type":{"name":"string"},"comment":"Enables video recording for all pages to `videosPath` folder. If not specified, videos are not recorded.","returnComment":"","required":false},"videoSize":{"kind":"property","name":"videoSize","type":{"name":"Object","properties":{"width":{"kind":"property","name":"width","type":{"name":"number"},"comment":"Video frame width.","returnComment":"","required":true},"height":{"kind":"property","name":"height","type":{"name":"number"},"comment":"Video frame height.","returnComment":"","required":true}}},"comment":"Specifies dimensions of the automatically recorded video. Can only be used if `videosPath` is set. If not specified the size will be equal to `viewport`. If `viewport` is not configured explicitly the video size defaults to 1280x720. Actual picture of the page will be scaled down if necessary to fit specified size.","returnComment":"","required":false}}},"comment":"Set of configurable options to set on the browser. Can have the following fields:","returnComment":"","required":false,"order":1}}},"launchServer":{"kind":"method","name":"launchServer","type":{"name":"Promise<BrowserServer>"},"comment":"Launches browser server that client can connect to. An example of launching a browser executable and connecting to it later:\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```","returnComment":"Promise which resolves to the browser app instance.","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"headless":{"kind":"property","name":"headless","type":{"name":"boolean"},"comment":"Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to `true` unless the `devtools` option is `true`.","returnComment":"","required":false},"port":{"kind":"property","name":"port","type":{"name":"number"},"comment":"Port to use for the web socket. Defaults to 0 that picks any available port.","returnComment":"","required":false},"executablePath":{"kind":"property","name":"executablePath","type":{"name":"string"},"comment":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.","returnComment":"","required":false},"args":{"kind":"property","name":"args","type":{"name":"Array<string>"},"comment":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.","returnComment":"","required":false},"ignoreDefaultArgs":{"kind":"property","name":"ignoreDefaultArgs","type":{"name":"boolean|Array<string>"},"comment":"If `true`, then do not use any of the default arguments. If an array is given, then filter out the given default arguments. Dangerous option; use with care. Defaults to `false`.","returnComment":"","required":false},"proxy":{"kind":"property","name":"proxy","type":{"name":"Object","properties":{"server":{"kind":"property","name":"server","type":{"name":"string"},"comment":"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.","returnComment":"","required":true},"bypass":{"kind":"property","name":"bypass","type":{"name":"string"},"comment":"Optional coma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","returnComment":"","required":false},"username":{"kind":"property","name":"username","type":{"name":"string"},"comment":"Optional username to use if HTTP proxy requires authentication.","returnComment":"","required":false},"password":{"kind":"property","name":"password","type":{"name":"string"},"comment":"Optional password to use if HTTP proxy requires authentication.","returnComment":"","required":false}}},"comment":"Network proxy settings.","returnComment":"","required":false},"downloadsPath":{"kind":"property","name":"downloadsPath","type":{"name":"string"},"comment":"If specified, accepted downloads are downloaded into this folder. Otherwise, temporary folder is created and is deleted when browser is closed.","returnComment":"","required":false},"chromiumSandbox":{"kind":"property","name":"chromiumSandbox","type":{"name":"boolean"},"comment":"Enable Chromium sandboxing. Defaults to `true`.","returnComment":"","required":false},"firefoxUserPrefs":{"kind":"property","name":"firefoxUserPrefs","type":{"name":"Object<string, string|number|boolean>"},"comment":"Firefox user preferences. Learn more about the Firefox user preferences at `about:config`.","returnComment":"","required":false},"handleSIGINT":{"kind":"property","name":"handleSIGINT","type":{"name":"boolean"},"comment":"Close the browser process on Ctrl-C. Defaults to `true`.","returnComment":"","required":false},"handleSIGTERM":{"kind":"property","name":"handleSIGTERM","type":{"name":"boolean"},"comment":"Close the browser process on SIGTERM. Defaults to `true`.","returnComment":"","required":false},"handleSIGHUP":{"kind":"property","name":"handleSIGHUP","type":{"name":"boolean"},"comment":"Close the browser process on SIGHUP. Defaults to `true`.","returnComment":"","required":false},"logger":{"kind":"property","name":"logger","type":{"name":"Logger"},"comment":"Logger sink for Playwright logging.","returnComment":"","required":false},"timeout":{"kind":"property","name":"timeout","type":{"name":"number"},"comment":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","returnComment":"","required":false},"env":{"kind":"property","name":"env","type":{"name":"Object<string, string|number|boolean>"},"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","returnComment":"","required":false},"devtools":{"kind":"property","name":"devtools","type":{"name":"boolean"},"comment":"**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`.","returnComment":"","required":false}}},"comment":"Set of configurable options to set on the browser. Can have the following fields:","returnComment":"","required":false,"order":0}}},"name":{"kind":"method","name":"name","type":{"name":"string"},"comment":"Returns browser name. For example: `'chromium'`, `'webkit'` or `'firefox'`.","returnComment":"","required":true,"args":{}}}},"Logger":{"name":"Logger","members":{"isEnabled":{"kind":"method","name":"isEnabled","type":{"name":"boolean"},"comment":"Determines whether sink is interested in the logger with the given name and severity.","returnComment":"","required":true,"args":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"logger name","returnComment":"","required":true,"order":0},"severity":{"kind":"property","name":"severity","type":{"name":"\"error\"|\"info\"|\"verbose\"|\"warning\""},"comment":"","returnComment":"","required":true,"order":1}}},"log":{"kind":"method","name":"log","type":null,"comment":"","returnComment":"","required":true,"args":{"name":{"kind":"property","name":"name","type":{"name":"string"},"comment":"logger name","returnComment":"","required":true,"order":0},"severity":{"kind":"property","name":"severity","type":{"name":"\"error\"|\"info\"|\"verbose\"|\"warning\""},"comment":"","returnComment":"","required":true,"order":1},"message":{"kind":"property","name":"message","type":{"name":"string|Error"},"comment":"log message format","returnComment":"","required":true,"order":2},"args":{"kind":"property","name":"args","type":{"name":"Array<Object>"},"comment":"message arguments","returnComment":"","required":true,"order":3},"hints":{"kind":"property","name":"hints","type":{"name":"Object","properties":{"color":{"kind":"property","name":"color","type":{"name":"string"},"comment":"preferred logger color","returnComment":"","required":false}}},"comment":"optional formatting hints","returnComment":"","required":true,"order":4}}}}},"ChromiumBrowser":{"name":"ChromiumBrowser","extends":"Browser","members":{"newBrowserCDPSession":{"kind":"method","name":"newBrowserCDPSession","type":{"name":"Promise<CDPSession>"},"comment":"","returnComment":"Promise that resolves to the newly created browser\nsession.","required":true,"args":{}},"startTracing":{"kind":"method","name":"startTracing","type":{"name":"Promise"},"comment":"Only one trace can be active at a time per browser.","returnComment":"","required":true,"args":{"page":{"kind":"property","name":"page","type":{"name":"Page"},"comment":"Optional, if specified, tracing includes screenshots of the given page.","returnComment":"","required":false,"order":0},"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"path":{"kind":"property","name":"path","type":{"name":"string"},"comment":"A path to write the trace file to.","returnComment":"","required":false},"screenshots":{"kind":"property","name":"screenshots","type":{"name":"boolean"},"comment":"captures screenshots in the trace.","returnComment":"","required":false},"categories":{"kind":"property","name":"categories","type":{"name":"Array<string>"},"comment":"specify custom categories to use instead of default.","returnComment":"","required":false}}},"comment":"","returnComment":"","required":false,"order":1}}},"stopTracing":{"kind":"method","name":"stopTracing","type":{"name":"Promise<Buffer>"},"comment":"","returnComment":"Promise which resolves to buffer with trace data.","required":true,"args":{}}}},"ChromiumBrowserContext":{"name":"ChromiumBrowserContext","extends":"BrowserContext","members":{"backgroundpage":{"kind":"event","name":"backgroundpage","type":{"name":"Page"},"comment":"Emitted when new background page is created in the context.\n\n**NOTE** Only works with persistent context.","returnComment":"","required":true,"args":{}},"serviceworker":{"kind":"event","name":"serviceworker","type":{"name":"Worker"},"comment":"Emitted when new service worker is created in the context.","returnComment":"","required":true,"args":{}},"backgroundPages":{"kind":"method","name":"backgroundPages","type":{"name":"Array<Page>"},"comment":"","returnComment":"All existing background pages in the context.","required":true,"args":{}},"newCDPSession":{"kind":"method","name":"newCDPSession","type":{"name":"Promise<CDPSession>"},"comment":"","returnComment":"Promise that resolves to the newly created session.","required":true,"args":{"page":{"kind":"property","name":"page","type":{"name":"Page"},"comment":"Page to create new session for.","returnComment":"","required":true,"order":0}}},"serviceWorkers":{"kind":"method","name":"serviceWorkers","type":{"name":"Array<Worker>"},"comment":"","returnComment":"All existing service workers in the context.","required":true,"args":{}}}},"ChromiumCoverage":{"name":"ChromiumCoverage","members":{"startCSSCoverage":{"kind":"method","name":"startCSSCoverage","type":{"name":"Promise"},"comment":"","returnComment":"Promise that resolves when coverage is started","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"resetOnNavigation":{"kind":"property","name":"resetOnNavigation","type":{"name":"boolean"},"comment":"Whether to reset coverage on every navigation. Defaults to `true`.","returnComment":"","required":false}}},"comment":"Set of configurable options for coverage","returnComment":"","required":false,"order":0}}},"startJSCoverage":{"kind":"method","name":"startJSCoverage","type":{"name":"Promise"},"comment":"**NOTE** 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.","returnComment":"Promise that resolves when coverage is started","required":true,"args":{"options":{"kind":"property","name":"options","type":{"name":"Object","properties":{"resetOnNavigation":{"kind":"property","name":"resetOnNavigation","type":{"name":"boolean"},"comment":"Whether to reset coverage on every navigation. Defaults to `true`.","returnComment":"","required":false},"reportAnonymousScripts":{"kind":"property","name":"reportAnonymousScripts","type":{"name":"boolean"},"comment":"Whether anonymous scripts generated by the page should be reported. Defaults to `false`.","returnComment":"","required":false}}},"comment":"Set of configurable options for coverage","returnComment":"","required":false,"order":0}}},"stopCSSCoverage":{"kind":"method","name":"stopCSSCoverage","type":{"name":"Promise<Array<Object>>","properties":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"StyleSheet URL","returnComment":"","required":true},"text":{"kind":"property","name":"text","type":{"name":"string"},"comment":"StyleSheet content, if available.","returnComment":"","required":false},"ranges":{"kind":"property","name":"ranges","type":{"name":"Array<Object>","properties":{"start":{"kind":"property","name":"start","type":{"name":"number"},"comment":"A start offset in text, inclusive","returnComment":"","required":true},"end":{"kind":"property","name":"end","type":{"name":"number"},"comment":"An end offset in text, exclusive","returnComment":"","required":true}}},"comment":"StyleSheet ranges that were used. Ranges are sorted and non-overlapping.","returnComment":"","required":true}}},"comment":"**NOTE** CSS Coverage doesn't include dynamically injected style tags without sourceURLs.","returnComment":"Promise that resolves to the array of coverage reports for all stylesheets","required":true,"args":{}},"stopJSCoverage":{"kind":"method","name":"stopJSCoverage","type":{"name":"Promise<Array<Object>>","properties":{"url":{"kind":"property","name":"url","type":{"name":"string"},"comment":"Script URL","returnComment":"","required":true},"scriptId":{"kind":"property","name":"scriptId","type":{"name":"string"},"comment":"Script ID","returnComment":"","required":true},"source":{"kind":"property","name":"source","type":{"name":"string"},"comment":"Script content, if applicable.","returnComment":"","required":false},"functions":{"kind":"property","name":"functions","type":{"name":"Array<Object>","properties":{"functionName":{"kind":"property","name":"functionName","type":{"name":"string"},"comment":"","returnComment":"","required":true},"isBlockCoverage":{"kind":"property","name":"isBlockCoverage","type":{"name":"boolean"},"comment":"","returnComment":"","required":true},"ranges":{"kind":"property","name":"ranges","type":{"name":"Array<Object>","properties":{"count":{"kind":"property","name":"count","type":{"name":"number"},"comment":"","returnComment":"","required":true},"startOffset":{"kind":"property","name":"startOffset","type":{"name":"number"},"comment":"","returnComment":"","required":true},"endOffset":{"kind":"property","name":"endOffset","type":{"name":"number"},"comment":"","returnComment":"","required":true}}},"comment":"","returnComment":"","required":true}}},"comment":"V8-specific coverage format.","returnComment":"","required":true}}},"comment":"**NOTE** JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are\nreported.","returnComment":"Promise that resolves to the array of coverage reports for all scripts","required":true,"args":{}}}},"CDPSession":{"name":"CDPSession","extends":"EventEmitter","members":{"detach":{"kind":"method","name":"detach","type":{"name":"Promise"},"comment":"Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used\nto send messages.","returnComment":"","required":true,"args":{}},"send":{"kind":"method","name":"send","type":{"name":"Promise<Object>"},"comment":"","returnComment":"","required":true,"args":{"method":{"kind":"property","name":"method","type":{"name":"string"},"comment":"protocol method name","returnComment":"","required":true,"order":0},"params":{"kind":"property","name":"params","type":{"name":"Object"},"comment":"Optional method parameters","returnComment":"","required":false,"order":1}}}}},"FirefoxBrowser":{"name":"FirefoxBrowser","extends":"Browser","members":{}},"WebKitBrowser":{"name":"WebKitBrowser","extends":"Browser","members":{}}}