mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[27120],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>k});var r=n(67294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),u=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=u(e.components);return r.createElement(p.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,p=e.parentName,d=i(e,["components","mdxType","originalType","parentName"]),m=u(n),k=a,s=m["".concat(p,".").concat(k)]||m[k]||c[k]||l;return n?r.createElement(s,o(o({ref:t},d),{},{components:n})):r.createElement(s,o({ref:t},d))}));function k(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,o=new Array(l);o[0]=m;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i.mdxType="string"==typeof e?e:a,o[1]=i;for(var u=2;u<l;u++)o[u]=n[u];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},12463:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>m,frontMatter:()=>o,metadata:()=>p,toc:()=>d});n(67294);var r=n(3905);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const o={sidebar_label:"Configuration"},i="Configuration interface",p={unversionedId:"api/puppeteer.configuration",id:"version-20.7.4/api/puppeteer.configuration",title:"Configuration interface",description:"Defines options to configure Puppeteer's behavior during installation and runtime.",source:"@site/versioned_docs/version-20.7.4/api/puppeteer.configuration.md",sourceDirName:"api",slug:"/api/puppeteer.configuration",permalink:"/api/puppeteer.configuration",draft:!1,tags:[],version:"20.7.4",frontMatter:{sidebar_label:"Configuration"},sidebar:"api",previous:{title:"CommonEventEmitter.removeListener",permalink:"/api/puppeteer.commoneventemitter.removelistener"},next:{title:"connect",permalink:"/api/puppeteer.connect"}},u={},d=[{value:"Signature:",id:"signature",level:4},{value:"Properties",id:"properties",level:2}],c={toc:d};function m(e){var{components:t}=e,n=l(e,["components"]);return(0,r.kt)("wrapper",a({},c,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",a({},{id:"configuration-interface"}),"Configuration interface"),(0,r.kt)("p",null,"Defines options to configure Puppeteer's behavior during installation and runtime."),(0,r.kt)("p",null,"See individual properties for more information."),(0,r.kt)("h4",a({},{id:"signature"}),"Signature:"),(0,r.kt)("pre",null,(0,r.kt)("code",a({parentName:"pre"},{className:"language-typescript"}),"export interface Configuration\n")),(0,r.kt)("h2",a({},{id:"properties"}),"Properties"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",a({parentName:"tr"},{align:null}),"Property"),(0,r.kt)("th",a({parentName:"tr"},{align:null}),"Modifiers"),(0,r.kt)("th",a({parentName:"tr"},{align:null}),"Type"),(0,r.kt)("th",a({parentName:"tr"},{align:null}),"Description"),(0,r.kt)("th",a({parentName:"tr"},{align:null}),"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"browserRevision"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"string"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("p",null,"Specifies a certain version of the browser you'd like Puppeteer to use."),(0,r.kt)("p",null,"Can be overridden by ",(0,r.kt)("code",null,"PUPPETEER_BROWSER_REVISION"),"."),(0,r.kt)("p",null,"See ",(0,r.kt)("a",a({parentName:"td"},{href:"/api/puppeteer.puppeteernode.launch"}),"puppeteer.launch")," on how executable path is inferred.")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"A compatible-revision of the browser.")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"cacheDirectory"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"string"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("p",null,"Defines the directory to be used by Puppeteer for caching."),(0,r.kt)("p",null,"Can be overridden by ",(0,r.kt)("code",null,"PUPPETEER_CACHE_DIR"),".")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"path.join(os.homedir(), '.cache', 'puppeteer')"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"defaultProduct"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("a",a({parentName:"td"},{href:"/api/puppeteer.product"}),"Product")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("p",null,"Specifies which browser you'd like Puppeteer to use."),(0,r.kt)("p",null,"Can be overridden by ",(0,r.kt)("code",null,"PUPPETEER_PRODUCT"),".")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"chrome"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"downloadBaseUrl"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"string"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("p",null,"Specifies the URL prefix that is used to download the browser."),(0,r.kt)("p",null,"Can be overridden by ",(0,r.kt)("code",null,"PUPPETEER_DOWNLOAD_BASE_URL"),".")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"Either ",(0,r.kt)("a",a({parentName:"td"},{href:"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing"}),"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing")," or ",(0,r.kt)("a",a({parentName:"td"},{href:"https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central"}),"https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central"),", depending on the product.")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"downloadPath"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"string"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("p",null,"Specifies the path for the downloads folder."),(0,r.kt)("p",null,"Can be overridden by ",(0,r.kt)("code",null,"PUPPETEER_DOWNLOAD_PATH"),".")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"<","cacheDirectory",">"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"executablePath"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"string"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("p",null,"Specifies an executable path to be used in ",(0,r.kt)("a",a({parentName:"td"},{href:"/api/puppeteer.puppeteernode.launch"}),"puppeteer.launch"),"."),(0,r.kt)("p",null,"Can be overridden by ",(0,r.kt)("code",null,"PUPPETEER_EXECUTABLE_PATH"),".")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("strong",{parentName:"td"},"Auto-computed."))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"experiments"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("a",a({parentName:"td"},{href:"/api/puppeteer.experimentsconfiguration"}),"ExperimentsConfiguration")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"Defines experimental options for Puppeteer."),(0,r.kt)("td",a({parentName:"tr"},{align:null}))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"logLevel"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"'silent' ","|"," 'error' ","|"," 'warn'"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"Tells Puppeteer to log at the given level."),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"warn"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"skipDownload"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"boolean"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("p",null,"Tells Puppeteer to not download during installation."),(0,r.kt)("p",null,"Can be overridden by ",(0,r.kt)("code",null,"PUPPETEER_SKIP_DOWNLOAD"),".")),(0,r.kt)("td",a({parentName:"tr"},{align:null}))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",a({parentName:"tr"},{align:null}),"temporaryDirectory"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"optional")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),"string"),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("p",null,"Defines the directory to be used by Puppeteer for creating temporary files."),(0,r.kt)("p",null,"Can be overridden by ",(0,r.kt)("code",null,"PUPPETEER_TMP_DIR"),".")),(0,r.kt)("td",a({parentName:"tr"},{align:null}),(0,r.kt)("code",null,"os.tmpdir()"))))))}m.isMDXComponent=!0}}]); |