mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
2 lines
7.7 KiB
JavaScript
2 lines
7.7 KiB
JavaScript
/*! For license information please see e628b56f.8578e0bf.js.LICENSE.txt */
|
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[36541],{48284:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>d,default:()=>p,frontMatter:()=>t,metadata:()=>c,toc:()=>h});var i=r(85893),s=r(11151);const t={sidebar_label:"ScreenshotOptions"},d="ScreenshotOptions interface",c={id:"api/puppeteer.screenshotoptions",title:"ScreenshotOptions interface",description:"Signature:",source:"@site/../docs/api/puppeteer.screenshotoptions.md",sourceDirName:"api",slug:"/api/puppeteer.screenshotoptions",permalink:"/next/api/puppeteer.screenshotoptions",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"ScreenshotOptions"},sidebar:"api",previous:{title:"ScreenshotClip",permalink:"/next/api/puppeteer.screenshotclip"},next:{title:"SerializedAXNode",permalink:"/next/api/puppeteer.serializedaxnode"}},l={},h=[{value:"Signature:",id:"signature",level:4},{value:"Properties",id:"properties",level:2}];function o(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"screenshotoptions-interface",children:"ScreenshotOptions interface"}),"\n",(0,i.jsx)(n.h4,{id:"signature",children:"Signature:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typescript",children:"export interface ScreenshotOptions\n"})}),"\n",(0,i.jsx)(n.h2,{id:"properties",children:"Properties"}),"\n",(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:(0,i.jsx)(n.p,{children:"Property"})}),(0,i.jsx)("th",{children:(0,i.jsx)(n.p,{children:"Modifiers"})}),(0,i.jsx)("th",{children:(0,i.jsx)(n.p,{children:"Type"})}),(0,i.jsx)("th",{children:(0,i.jsx)(n.p,{children:"Description"})}),(0,i.jsx)("th",{children:(0,i.jsx)(n.p,{children:"Default"})})]})}),(0,i.jsxs)("tbody",{children:[(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"capturebeyondviewport",children:"captureBeyondViewport"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"boolean"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"Capture the screenshot beyond the viewport."})}),(0,i.jsx)("td",{children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"false"})," if there is no ",(0,i.jsx)(n.code,{children:"clip"}),". ",(0,i.jsx)(n.code,{children:"true"})," otherwise."]})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"clip",children:"clip"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.a,{href:"/next/api/puppeteer.screenshotclip",children:"ScreenshotClip"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"Specifies the region of the page/element to clip."})}),(0,i.jsx)("td",{})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"encoding",children:"encoding"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"'base64' | 'binary'"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"Encoding of the image."})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"'binary'"})})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"fromsurface",children:"fromSurface"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"boolean"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"Capture the screenshot from the surface, rather than the view."})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"true"})})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"fullpage",children:"fullPage"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"boolean"})}),(0,i.jsx)("td",{children:(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"true"}),", takes a screenshot of the full page."]})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"false"})})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"omitbackground",children:"omitBackground"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"boolean"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"Hides default white background and allows capturing screenshots with transparency."})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"false"})})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"optimizeforspeed",children:"optimizeForSpeed"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"boolean"})}),(0,i.jsx)("td",{}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"false"})})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"path",children:"path"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"string"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"The file path to save the image to. The screenshot type will be inferred from file extension. If path is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk."})}),(0,i.jsx)("td",{})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"quality",children:"quality"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"number"})}),(0,i.jsx)("td",{children:(0,i.jsxs)(n.p,{children:["Quality of the image, between 0-100. Not applicable to ",(0,i.jsx)(n.code,{children:"png"})," images."]})}),(0,i.jsx)("td",{})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)("span",{id:"type",children:"type"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"optional"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"'png' | 'jpeg' | 'webp'"})}),(0,i.jsx)("td",{}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"'png'"})})})]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},75251:(e,n,r)=>{var i=r(67294),s=Symbol.for("react.element"),t=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,c=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function h(e,n,r){var i,t={},h=null,o=null;for(i in void 0!==r&&(h=""+r),void 0!==n.key&&(h=""+n.key),void 0!==n.ref&&(o=n.ref),n)d.call(n,i)&&!l.hasOwnProperty(i)&&(t[i]=n[i]);if(e&&e.defaultProps)for(i in n=e.defaultProps)void 0===t[i]&&(t[i]=n[i]);return{$$typeof:s,type:e,key:h,ref:o,props:t,_owner:c.current}}n.Fragment=t,n.jsx=h,n.jsxs=h},85893:(e,n,r)=>{e.exports=r(75251)},11151:(e,n,r)=>{r.d(n,{Z:()=>c,a:()=>d});var i=r(67294);const s={},t=i.createContext(s);function d(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]); |