mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
2 lines
4.5 KiB
JavaScript
2 lines
4.5 KiB
JavaScript
|
/*! For license information please see 670be399.f620e1c5.js.LICENSE.txt */
|
||
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[29051],{47005:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>s,toc:()=>c});var n=r(85893),i=r(11151);const a={sidebar_label:"Frame.waitForTimeout"},o="Frame.waitForTimeout() method",s={id:"api/puppeteer.frame.waitfortimeout",title:"Frame.waitForTimeout() method",description:"Warning: This API is now obsolete.",source:"@site/../docs/api/puppeteer.frame.waitfortimeout.md",sourceDirName:"api",slug:"/api/puppeteer.frame.waitfortimeout",permalink:"/next/api/puppeteer.frame.waitfortimeout",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"Frame.waitForTimeout"},sidebar:"api",previous:{title:"Frame.waitForSelector",permalink:"/next/api/puppeteer.frame.waitforselector"},next:{title:"Frame.waitForXPath",permalink:"/next/api/puppeteer.frame.waitforxpath"}},l={},c=[{value:"Signature:",id:"signature",level:4},{value:"Parameters",id:"parameters",level:2},{value:"Remarks",id:"remarks",level:2},{value:"Example",id:"example",level:2}];function d(e){const t={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h4:"h4",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"framewaitfortimeout-method",children:"Frame.waitForTimeout() method"}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Warning: This API is now obsolete."}),"\n",(0,n.jsxs)(t.p,{children:["Replace with ",(0,n.jsx)(t.code,{children:"new Promise(r => setTimeout(r, milliseconds));"}),"."]}),"\n",(0,n.jsx)(t.p,{children:"Causes your script to wait for the given number of milliseconds."}),"\n"]}),"\n",(0,n.jsx)(t.h4,{id:"signature",children:"Signature:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typescript",children:"class Frame {\n waitForTimeout(milliseconds: number): Promise<void>;\n}\n"})}),"\n",(0,n.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"milliseconds"}),(0,n.jsx)(t.td,{children:"number"}),(0,n.jsx)(t.td,{children:"the number of milliseconds to wait."})]})})]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Returns:"})}),"\n",(0,n.jsx)(t.p,{children:"Promise<void>"}),"\n",(0,n.jsx)(t.h2,{id:"remarks",children:"Remarks"}),"\n",(0,n.jsxs)(t.p,{children:["It's generally recommended to not wait for a number of seconds, but instead use ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.frame.waitforselector",children:"Frame.waitForSelector()"}),", ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.frame.waitforxpath",children:"Frame.waitForXPath()"})," or ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.frame.waitforfunction",children:"Frame.waitForFunction()"})," to wait for exactly the conditions you want."]}),"\n",(0,n.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,n.jsx)(t.p,{children:"Wait for 1 second:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ts",children:"await frame.waitForTimeout(1000);\n"})})]})}function p(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},75251:(e,t,r)=>{var n=r(67294),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,a={},c=null,d=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)o.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:i,type:e,key:c,ref:d,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},85893:(e,t
|