mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
2 lines
8.0 KiB
JavaScript
2 lines
8.0 KiB
JavaScript
/*! For license information please see 5f2f9a64.65daf8de.js.LICENSE.txt */
|
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[67150],{98890:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>i,default:()=>a,frontMatter:()=>d,metadata:()=>o,toc:()=>l});var n=t(85893),s=t(11151);const d={sidebar_label:"LaunchOptions"},i="LaunchOptions interface",o={id:"api/puppeteer.launchoptions",title:"LaunchOptions interface",description:"Generic launch options that can be passed when launching any browser.",source:"@site/versioned_docs/version-22.0.0/api/puppeteer.launchoptions.md",sourceDirName:"api",slug:"/api/puppeteer.launchoptions",permalink:"/api/puppeteer.launchoptions",draft:!1,unlisted:!1,tags:[],version:"22.0.0",frontMatter:{sidebar_label:"LaunchOptions"},sidebar:"api",previous:{title:"launch",permalink:"/api/puppeteer.launch"},next:{title:"Locator",permalink:"/api/puppeteer.locator"}},c={},l=[{value:"Signature:",id:"signature",level:4},{value:"Properties",id:"properties",level:2}];function h(e){const r={a:"a",code:"code",h1:"h1",h2:"h2",h4:"h4",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.h1,{id:"launchoptions-interface",children:"LaunchOptions interface"}),"\n",(0,n.jsx)(r.p,{children:"Generic launch options that can be passed when launching any browser."}),"\n",(0,n.jsx)(r.h4,{id:"signature",children:"Signature:"}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-typescript",children:"export interface LaunchOptions\n"})}),"\n",(0,n.jsx)(r.h2,{id:"properties",children:"Properties"}),"\n",(0,n.jsxs)(r.table,{children:[(0,n.jsx)(r.thead,{children:(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.th,{children:"Property"}),(0,n.jsx)(r.th,{children:"Modifiers"}),(0,n.jsx)(r.th,{children:"Type"}),(0,n.jsx)(r.th,{children:"Description"}),(0,n.jsx)(r.th,{children:"Default"})]})}),(0,n.jsxs)(r.tbody,{children:[(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"channel"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"/api/puppeteer.chromereleasechannel",children:"ChromeReleaseChannel"})}),(0,n.jsx)(r.td,{children:"Chrome Release Channel"}),(0,n.jsx)(r.td,{})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"dumpio"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"boolean"}),(0,n.jsxs)(r.td,{children:["If true, pipes the browser process stdout and stderr to ",(0,n.jsx)("code",{children:"process.stdout"})," and ",(0,n.jsx)("code",{children:"process.stderr"}),"."]}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"false"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"env"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"Record<string, string | undefined>"}),(0,n.jsx)(r.td,{children:"Specify environment variables that will be visible to the browser."}),(0,n.jsxs)(r.td,{children:["The contents of ",(0,n.jsx)("code",{children:"process.env"}),"."]})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"executablePath"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"string"}),(0,n.jsx)(r.td,{children:"Path to a browser executable to use instead of the bundled Chromium. Note that Puppeteer is only guaranteed to work with the bundled Chromium, so use this setting at your own risk."}),(0,n.jsx)(r.td,{})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"extraPrefsFirefox"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"Record<string, unknown>"}),(0,n.jsxs)(r.td,{children:[(0,n.jsx)(r.a,{href:"https://searchfox.org/mozilla-release/source/modules/libpref/init/all.js",children:"Additional preferences"})," that can be passed when launching with Firefox."]}),(0,n.jsx)(r.td,{})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"handleSIGHUP"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"boolean"}),(0,n.jsxs)(r.td,{children:["Close the browser process on ",(0,n.jsx)("code",{children:"SIGHUP"}),"."]}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"true"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"handleSIGINT"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"boolean"}),(0,n.jsxs)(r.td,{children:["Close the browser process on ",(0,n.jsx)("code",{children:"Ctrl+C"}),"."]}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"true"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"handleSIGTERM"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"boolean"}),(0,n.jsxs)(r.td,{children:["Close the browser process on ",(0,n.jsx)("code",{children:"SIGTERM"}),"."]}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"true"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"ignoreDefaultArgs"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"boolean | string[]"}),(0,n.jsxs)(r.td,{children:["If ",(0,n.jsx)("code",{children:"true"}),", do not use ",(0,n.jsx)("code",{children:"puppeteer.defaultArgs()"})," when creating a browser. If an array is provided, these args will be filtered out. Use this with care - you probably want the default arguments Puppeteer uses."]}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"false"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"pipe"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"boolean"}),(0,n.jsx)(r.td,{children:"Connect to a browser over a pipe instead of a WebSocket."}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"false"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"product"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"/api/puppeteer.product",children:"Product"})}),(0,n.jsx)(r.td,{children:"Which browser to launch."}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"chrome"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"timeout"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"number"}),(0,n.jsxs)(r.td,{children:["Maximum time in milliseconds to wait for the browser to start. Pass ",(0,n.jsx)("code",{children:"0"})," to disable the timeout."]}),(0,n.jsxs)(r.td,{children:[(0,n.jsx)("code",{children:"30_000"})," (30 seconds)."]})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:"waitForInitialPage"}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"optional"})}),(0,n.jsx)(r.td,{children:"boolean"}),(0,n.jsxs)(r.td,{children:["Whether to wait for the initial page to be ready. Useful when a user explicitly disables that (e.g. ",(0,n.jsx)("code",{children:"--no-startup-window"})," for Chrome)."]}),(0,n.jsx)(r.td,{children:(0,n.jsx)("code",{children:"true"})})]})]})]})]})}function a(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},75251:(e,r,t)=>{var n=t(67294),s=Symbol.for("react.element"),d=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,r,t){var n,d={},l=null,h=null;for(n in void 0!==t&&(l=""+t),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(h=r.ref),r)i.call(r,n)&&!c.hasOwnProperty(n)&&(d[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===d[n]&&(d[n]=r[n]);return{$$typeof:s,type:e,key:l,ref:h,props:d,_owner:o.current}}r.Fragment=d,r.jsx=l,r.jsxs=l},85893:(e,r,t)=>{e.exports=t(75251)},11151:(e,r,t)=>{t.d(r,{Z:()=>o,a:()=>i});var n=t(67294);const s={},d=n.createContext(s);function i(e){const r=n.useContext(d);return n.useMemo((function(){return"function"==typeof e?e(r):{...r,...e}}),[r,e])}function o(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),n.createElement(d.Provider,{value:r},e.children)}}}]); |