"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[45670],{3905:(e,t,a)=>{a.d(t,{Zo:()=>s,kt:()=>c});varr=a(67294);functionn(e,t,a){returntine?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}functionl(e,t){vara=Object.keys(e);if(Object.getOwnPropertySymbols){varr=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}returna}functionp(e){for(vart=1;t<arguments.length;t++){vara=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){n(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}returne}functiono(e,t){if(null==e)return{};vara,r,n=function(e,t){if(null==e)return{};vara,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||(n[a]=e[a]);returnn}(e,t);if(Object.getOwnPropertySymbols){varl=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}returnn}vari=r.createContext({}),d=function(e){vart=r.useContext(i),a=t;returne&&(a="function"==typeofe?e(t):p(p({},t),e)),a},s=function(e){vart=d(e.components);returnr.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){vart=e.children;returnr.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){vara=e.components,n=e.mdxType,l=e.originalType,i=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),m=d(a),c=n,h=m["".concat(i,".").concat(c)]||m[c]||u[c]||l;returna?r.createElement(h,p(p({ref:t},s),{},{components:a})):r.createElement(h,p({ref:t},s))}));functionc(e,t){vara=arguments,n=t&&t.mdxType;if("string"==typeofe||n){varl=a.length,p=newArray(l);p[0]=m;varo={};for(variint)hasOwnProperty.call(t,i)&&(o[i]=t[i]);o.originalType=e,o.mdxType="string"==typeofe?e:n,p[1]=o;for(vard=2;d<l;d++)p[d]=a[d];returnr.createElement.apply(null,p)}returnr.createElement.apply(null,a)}m.displayName="MDXCreateElement"},86467:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>i,contentTitle:()=>p,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>d});varr=a(87462),n=(a(67294),a(3905));constl={sidebar_label:"JSHandle"},p="JSHandle class",o={unversionedId:"api/puppeteer.jshandle",id:"version-17.0.0/api/puppeteer.jshandle",title:"JSHandle class",description:"Represents a reference to a JavaScript object. Instances can be created using Page.evaluateHandle().",source:"@site/versioned_docs/version-17.0.0/api/puppeteer.jshandle.md",sourceDirName:"api",slug:"/api/puppeteer.jshandle",permalink:"/api/puppeteer.jshandle",draft:!1,tags:[],version:"17.0.0",frontMatter:{sidebar_label:"JSHandle"},sidebar:"sidebar",previous:{title:"JSHandle.jsonValue",permalink:"/api/puppeteer.jshandle.jsonvalue"},next:{title:"JSHandle.remoteObject",permalink:"/api/puppeteer.jshandle.remoteobject"}},i={},d=[{value:"Remarks",id:"remarks",level:2},{value:"Example",id:"example",level:2},{value:"Properties",id:"properties",level:2},{value:"Methods",id:"methods",level:2}],s={toc:d};functionu(e){let{components:t,...a}=e;return(0,n.kt)("wrapper",(0,r.Z)({},s,a,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"jshandle-class"},"JSHandle class"),(0,n.kt)("p",null,"Represents a reference to a JavaScript object. Instances can be created using ",(0,n.kt)("a",{parentName:"p",href:"/api/puppeteer.page.evaluatehandle"},"Page.evaluateHandle()"),"."),(0,n.kt)("p",null,"Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely ",(0,n.kt)("a",{parentName:"p",href:"/api/puppeteer.jshandle.dispose"},"disposed"),". JSHandles are auto-disposed when their associated frame is navigated away or the parent context gets destroyed."),(0,n.kt)("p",null,"Handles can be used as arguments for any evaluation function such as ",(0,n.kt)("a",{parentName:"p",href:"/api/puppeteer.page._eval"},"Page.$eval