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