mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
|
/*! For license information please see e2485004.2e476189.js.LICENSE.txt */
|
||
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[85424],{9484:(e,s,r)=>{r.r(s),r.d(s,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>o,toc:()=>a});var n=r(85893),t=r(11151);const i={sidebar_label:"API"},l="@puppeteer/browsers",o={id:"browsers-api/index",title:"@puppeteer/browsers",description:"Manage and launch browsers/drivers from a CLI or programmatically.",source:"@site/versioned_docs/version-22.0.0/browsers-api/index.md",sourceDirName:"browsers-api",slug:"/browsers-api/",permalink:"/browsers-api/",draft:!1,unlisted:!1,tags:[],version:"22.0.0",frontMatter:{sidebar_label:"API"},sidebar:"browsersApi",next:{title:"launch",permalink:"/browsers-api/browsers.launch"}},d={},a=[{value:"CLI",id:"cli",level:2},{value:"Known limitations",id:"known-limitations",level:2},{value:"API",id:"api",level:2},{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:"Variables",id:"variables",level:2}];function c(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,t.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h1,{id:"puppeteerbrowsers",children:"@puppeteer/browsers"}),"\n",(0,n.jsx)(s.p,{children:"Manage and launch browsers/drivers from a CLI or programmatically."}),"\n",(0,n.jsx)(s.h2,{id:"cli",children:"CLI"}),"\n",(0,n.jsxs)(s.p,{children:["Use ",(0,n.jsx)(s.code,{children:"npx"})," to run the CLI:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"npx @puppeteer/browsers --help\n"})}),"\n",(0,n.jsx)(s.p,{children:"CLI help will provide all documentation you need to use the CLI."}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"npx @puppeteer/browsers --help # help for all commands\nnpx @puppeteer/browsers install --help # help for the install command\nnpx @puppeteer/browsers launch --help # help for the launch command\n"})}),"\n",(0,n.jsx)(s.h2,{id:"known-limitations",children:"Known limitations"}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["We support installing and running Firefox, Chrome and Chromium. The ",(0,n.jsx)(s.code,{children:"latest"}),", ",(0,n.jsx)(s.code,{children:"beta"}),", ",(0,n.jsx)(s.code,{children:"dev"}),", ",(0,n.jsx)(s.code,{children:"canary"}),", ",(0,n.jsx)(s.code,{children:"stable"})," keywords are only supported for the install command. For the ",(0,n.jsx)(s.code,{children:"launch"})," command you need to specify an exact build ID. The build ID is provided by the ",(0,n.jsx)(s.code,{children:"install"})," command (see ",(0,n.jsx)(s.code,{children:"npx @puppeteer/browsers install --help"})," for the format)."]}),"\n",(0,n.jsx)(s.li,{children:"Launching the system browsers is only possible for Chrome/Chromium."}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"api",children:"API"}),"\n",(0,n.jsxs)(s.p,{children:["The programmatic API allows installing and launching browsers from your code. See the ",(0,n.jsx)(s.code,{children:"test"})," folder for examples on how to use the ",(0,n.jsx)(s.code,{children:"install"}),", ",(0,n.jsx)(s.code,{children:"canInstall"}),", ",(0,n.jsx)(s.code,{children:"launch"}),", ",(0,n.jsx)(s.code,{children:"computeExecutablePath"}),", ",(0,n.jsx)(s.code,{children:"computeSystemExecutablePath"})," and other methods."]}),"\n",(0,n.jsx)(s.h2,{id:"classes",children:"Classes"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Class"}),(0,n.jsx)(s.th,{children:"Description"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.a,{href:"/browsers-api/browsers.cli",children:"CLI"})}),(0,n.jsx)(s.td,{})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.a,{href:"/browsers-api/browsers.installedbrowser",children:"InstalledBrowser"})}),(0,n.jsx)(s.td,{})]}),(0,n.jsxs)(s.tr,{chil
|