puppeteer/assets/js/cf930cdd.c1d2256d.js
2021-10-07 15:21:45 +00:00

1 line
6.0 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[34115],{3905:function(e,t,r){r.d(t,{Zo:function(){return c},kt:function(){return s}});var a=r(67294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},p=Object.keys(e);for(a=0;a<p.length;a++)r=p[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(a=0;a<p.length;a++)r=p[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var o=a.createContext({}),i=function(e){var t=a.useContext(o),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},c=function(e){var t=i(e.components);return a.createElement(o.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,p=e.originalType,o=e.parentName,c=u(e,["components","mdxType","originalType","parentName"]),m=i(r),s=n,f=m["".concat(o,".").concat(s)]||m[s]||d[s]||p;return r?a.createElement(f,l(l({ref:t},c),{},{components:r})):a.createElement(f,l({ref:t},c))}));function s(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var p=r.length,l=new Array(p);l[0]=m;var u={};for(var o in t)hasOwnProperty.call(t,o)&&(u[o]=t[o]);u.originalType=e,u.mdxType="string"==typeof e?e:n,l[1]=u;for(var i=2;i<p;i++)l[i]=r[i];return a.createElement.apply(null,l)}return a.createElement.apply(null,r)}m.displayName="MDXCreateElement"},78633:function(e,t,r){r.r(t),r.d(t,{frontMatter:function(){return u},contentTitle:function(){return o},metadata:function(){return i},toc:function(){return c},default:function(){return m}});var a=r(87462),n=r(63366),p=(r(67294),r(3905)),l=["components"],u={},o=void 0,i={unversionedId:"puppeteer.frame.evaluatehandle",id:"puppeteer.frame.evaluatehandle",isDocsHomePage:!1,title:"puppeteer.frame.evaluatehandle",description:"Home &gt; puppeteer &gt; Frame &gt; evaluateHandle",source:"@site/docs/puppeteer.frame.evaluatehandle.md",sourceDirName:".",slug:"/puppeteer.frame.evaluatehandle",permalink:"/puppeteer/docs/next/puppeteer.frame.evaluatehandle",editUrl:"https://github.com/facebook/puppeteer/edit/main/website/docs/puppeteer.frame.evaluatehandle.md",version:"current",frontMatter:{},sidebar:"docs",previous:{title:"puppeteer.frame.evaluate",permalink:"/puppeteer/docs/next/puppeteer.frame.evaluate"},next:{title:"puppeteer.frame.executioncontext",permalink:"/puppeteer/docs/next/puppeteer.frame.executioncontext"}},c=[{value:"Frame.evaluateHandle() method",id:"frameevaluatehandle-method",children:[]},{value:"Parameters",id:"parameters",children:[]},{value:"Remarks",id:"remarks",children:[]}],d={toc:c};function m(e){var t=e.components,r=(0,n.Z)(e,l);return(0,p.kt)("wrapper",(0,a.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,p.kt)("p",null,(0,p.kt)("a",{parentName:"p",href:"/puppeteer/docs/next/index"},"Home")," ",">"," ",(0,p.kt)("a",{parentName:"p",href:"/puppeteer/docs/next/puppeteer"},"puppeteer")," ",">"," ",(0,p.kt)("a",{parentName:"p",href:"/puppeteer/docs/next/puppeteer.frame"},"Frame")," ",">"," ",(0,p.kt)("a",{parentName:"p",href:"/puppeteer/docs/next/puppeteer.frame.evaluatehandle"},"evaluateHandle")),(0,p.kt)("h2",{id:"frameevaluatehandle-method"},"Frame.evaluateHandle() method"),(0,p.kt)("b",null,"Signature:"),(0,p.kt)("pre",null,(0,p.kt)("code",{parentName:"pre",className:"language-typescript"},"evaluateHandle<HandlerType extends JSHandle = JSHandle>(pageFunction: EvaluateHandleFn, ...args: SerializableOrJSHandle[]): Promise<HandlerType>;\n")),(0,p.kt)("h2",{id:"parameters"},"Parameters"),(0,p.kt)("table",null,(0,p.kt)("thead",{parentName:"table"},(0,p.kt)("tr",{parentName:"thead"},(0,p.kt)("th",{parentName:"tr",align:null},"Parameter"),(0,p.kt)("th",{parentName:"tr",align:null},"Type"),(0,p.kt)("th",{parentName:"tr",align:null},"Description"))),(0,p.kt)("tbody",{parentName:"table"},(0,p.kt)("tr",{parentName:"tbody"},(0,p.kt)("td",{parentName:"tr",align:null},"pageFunction"),(0,p.kt)("td",{parentName:"tr",align:null},(0,p.kt)("a",{parentName:"td",href:"/puppeteer/docs/next/puppeteer.evaluatehandlefn"},"EvaluateHandleFn")),(0,p.kt)("td",{parentName:"tr",align:null},"a function that is run within the frame")),(0,p.kt)("tr",{parentName:"tbody"},(0,p.kt)("td",{parentName:"tr",align:null},"args"),(0,p.kt)("td",{parentName:"tr",align:null},(0,p.kt)("a",{parentName:"td",href:"/puppeteer/docs/next/puppeteer.serializableorjshandle"},"SerializableOrJSHandle"),"[","]"),(0,p.kt)("td",{parentName:"tr",align:null},"arguments to be passed to the pageFunction")))),(0,p.kt)("b",null,"Returns:"),(0,p.kt)("p",null,"Promise","<","HandlerType",">"),(0,p.kt)("h2",{id:"remarks"},"Remarks"),(0,p.kt)("p",null,"The only difference between ",(0,p.kt)("a",{parentName:"p",href:"/puppeteer/docs/next/puppeteer.frame.evaluate"},"Frame.evaluate()")," and ",(0,p.kt)("inlineCode",{parentName:"p"},"frame.evaluateHandle")," is that ",(0,p.kt)("inlineCode",{parentName:"p"},"evaluateHandle")," will return the value wrapped in an in-page object."),(0,p.kt)("p",null,"This method behaves identically to ",(0,p.kt)("a",{parentName:"p",href:"/puppeteer/docs/next/puppeteer.page.evaluatehandle"},"Page.evaluateHandle()")," except it's run within the context of the ",(0,p.kt)("inlineCode",{parentName:"p"},"frame"),", rather than the entire page."))}m.isMDXComponent=!0}}]);