/*! For license information please see 0a3df235.013acd22.js.LICENSE.txt */ "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[45339],{13397:(e,r,s)=>{s.r(r),s.d(r,{assets:()=>a,contentTitle:()=>d,default:()=>l,frontMatter:()=>n,metadata:()=>p,toc:()=>c});var t=s(85893),i=s(11151);const n={sidebar_label:"API"},d="API Reference",p={id:"api/index",title:"API Reference",description:"Classes",source:"@site/versioned_docs/version-21.6.0/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/api/",draft:!1,unlisted:!1,tags:[],version:"21.6.0",frontMatter:{sidebar_label:"API"}},a={},c=[{value:"Classes",id:"classes",level:2},{value:"Enumerations",id:"enumerations",level:2},{value:"Functions",id:"functions",level:2},{value:"Interfaces",id:"interfaces",level:2},{value:"Namespaces",id:"namespaces",level:2},{value:"Variables",id:"variables",level:2},{value:"Type Aliases",id:"type-aliases",level:2}];function h(e){const r={a:"a",h1:"h1",h2:"h2",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.h1,{id:"api-reference",children:"API Reference"}),"\n",(0,t.jsx)(r.h2,{id:"classes",children:"Classes"}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"Class"}),(0,t.jsx)(r.th,{children:"Description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.accessibility",children:"Accessibility"})}),(0,t.jsxs)(r.td,{children:["The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as ",(0,t.jsx)(r.a,{href:"https://en.wikipedia.org/wiki/Screen_reader",children:"screen readers"})," or ",(0,t.jsx)(r.a,{href:"https://en.wikipedia.org/wiki/Switch_access",children:"switches"}),"."]})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.browser",children:"Browser"})}),(0,t.jsxs)(r.td,{children:[(0,t.jsxs)("p",{children:[(0,t.jsx)(r.a,{href:"/api/puppeteer.browser",children:"Browser"})," represents a browser instance that is either:"]}),(0,t.jsxs)("p",{children:["- connected to via ",(0,t.jsx)(r.a,{href:"/api/puppeteer.puppeteer.connect",children:"Puppeteer.connect()"})," or - launched by ",(0,t.jsx)(r.a,{href:"/api/puppeteer.puppeteernode.launch",children:"PuppeteerNode.launch()"}),"."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)(r.a,{href:"/api/puppeteer.browser",children:"Browser"})," ",(0,t.jsx)(r.a,{href:"/api/puppeteer.eventemitter",children:"emits"})," various events which are documented in the ",(0,t.jsx)(r.a,{href:"/api/puppeteer.browserevent",children:"BrowserEvent"})," enum."]})]})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.browsercontext",children:"BrowserContext"})}),(0,t.jsxs)(r.td,{children:[(0,t.jsxs)("p",{children:[(0,t.jsx)(r.a,{href:"/api/puppeteer.browsercontext",children:"BrowserContext"})," represents individual sessions within a ",(0,t.jsx)(r.a,{href:"/api/puppeteer.browser",children:"browser"}),"."]}),(0,t.jsxs)("p",{children:["When a ",(0,t.jsx)(r.a,{href:"/api/puppeteer.browser",children:"browser"})," is launched, it has a single ",(0,t.jsx)(r.a,{href:"/api/puppeteer.browsercontext",children:"browser context"})," by default. Others can be created using ",(0,t.jsx)(r.a,{href:"/api/puppeteer.browser.createincognitobrowsercontext",children:"Browser.createIncognitoBrowserContext()"}),"."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)(r.a,{href:"/api/puppeteer.browsercontext",children:"BrowserContext"})," ",(0,t.jsx)(r.a,{href:"/api/puppeteer.eventemitter",children:"emits"})," various events which are documented in the ",(0,t.jsx)(r.a,{href:"/api/puppeteer.browsercontextevent",children:"BrowserContextEvent"})," enum."]}),(0,t.jsxs)("p",{children:["If a ",(0,t.jsx)(r.a,{href:"/api/puppeteer.page",children:"page"})," opens another ",(0,t.jsx)(r.a,{href:"/api/puppeteer.page",children:"page"}),", e.g. using ",(0,t.jsx)("code",{children:"window.open"}),", the popup will belong to the parent ",(0,t.jsx)(r.a,{href:"/api/puppeteer.page.browsercontext",children:"page's browser context"}),"."]})]})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.cdpsession",children:"CDPSession"})}),(0,t.jsxs)(r.td,{children:["The ",(0,t.jsx)("code",{children:"CDPSession"})," instances are used to talk raw Chrome Devtools Protocol."]})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.connection",children:"Connection"})}),(0,t.jsx)(r.td,{})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.consolemessage",children:"ConsoleMessage"})}),(0,t.jsx)(r.td,{children:"ConsoleMessage objects are dispatched by page via the 'console' event."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.coverage",children:"Coverage"})}),(0,t.jsx)(r.td,{children:"The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.csscoverage",children:"CSSCoverage"})}),(0,t.jsx)(r.td,{})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.customerror",children:"CustomError"})}),(0,t.jsx)(r.td,{})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.devicerequestprompt",children:"DeviceRequestPrompt"})}),(0,t.jsx)(r.td,{children:"Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.devicerequestpromptdevice",children:"DeviceRequestPromptDevice"})}),(0,t.jsx)(r.td,{children:"Device in a request prompt."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.dialog",children:"Dialog"})}),(0,t.jsxs)(r.td,{children:["Dialog instances are dispatched by the ",(0,t.jsx)(r.a,{href:"/api/puppeteer.page",children:"Page"})," via the ",(0,t.jsx)("code",{children:"dialog"})," event."]})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.elementhandle",children:"ElementHandle"})}),(0,t.jsx)(r.td,{children:"ElementHandle represents an in-page DOM element."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.eventemitter",children:"EventEmitter"})}),(0,t.jsx)(r.td,{children:"The EventEmitter class that many Puppeteer classes extend."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.filechooser",children:"FileChooser"})}),(0,t.jsx)(r.td,{children:"File choosers let you react to the page requesting for a file."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:(0,t.jsx)(r.a,{href:"/api/puppeteer.frame",children:"Frame"})}),(0,t.jsxs)(r.td,{children:[(0,t.jsx)("p",{children:"Represents a DOM frame."}),(0,t.jsxs)("p",{children:["To understand frames, you can think of frames as ",(0,t.jsx)("code",{children:"