/*! For license information please see 36e6c47b.8b5406a8.js.LICENSE.txt */ "use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[71395],{11835:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>i,contentTitle:()=>o,default:()=>g,frontMatter:()=>s,metadata:()=>p,toc:()=>l});var r=a(85893),n=a(11151);const s={sidebar_label:"Target.asPage"},o="Target.asPage() method",p={id:"api/puppeteer.target.aspage",title:"Target.asPage() method",description:"Forcefully creates a page for a target of any type. It is useful if you want to handle a CDP target of type other as a page. If you deal with a regular page target, use Target.page().",source:"@site/versioned_docs/version-22.8.0/api/puppeteer.target.aspage.md",sourceDirName:"api",slug:"/api/puppeteer.target.aspage",permalink:"/api/puppeteer.target.aspage",draft:!1,unlisted:!1,tags:[],version:"22.8.0",frontMatter:{sidebar_label:"Target.asPage"},sidebar:"api",previous:{title:"Target",permalink:"/api/puppeteer.target"},next:{title:"Target.browser",permalink:"/api/puppeteer.target.browser"}},i={},l=[{value:"Signature:",id:"signature",level:4}];function c(e){const t={a:"a",code:"code",h1:"h1",h4:"h4",p:"p",pre:"pre",strong:"strong",...(0,n.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"targetaspage-method",children:"Target.asPage() method"}),"\n",(0,r.jsxs)(t.p,{children:["Forcefully creates a page for a target of any type. It is useful if you want to handle a CDP target of type ",(0,r.jsx)(t.code,{children:"other"})," as a page. If you deal with a regular page target, use ",(0,r.jsx)(t.a,{href:"/api/puppeteer.target.page",children:"Target.page()"}),"."]}),"\n",(0,r.jsx)(t.h4,{id:"signature",children:"Signature:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-typescript",children:"class Target {\n abstract asPage(): Promise;\n}\n"})}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(t.p,{children:["Promise<",(0,r.jsx)(t.a,{href:"/api/puppeteer.page",children:"Page"}),">"]})]})}function g(e={}){const{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},75251:(e,t,a)=>{var r=a(67294),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,p=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,a){var r,s={},l=null,c=null;for(r in void 0!==a&&(l=""+a),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,r)&&!i.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:n,type:e,key:l,ref:c,props:s,_owner:p.current}}t.Fragment=s,t.jsx=l,t.jsxs=l},85893:(e,t,a)=>{e.exports=a(75251)},11151:(e,t,a)=>{a.d(t,{Z:()=>p,a:()=>o});var r=a(67294);const n={},s=r.createContext(n);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function p(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]);