puppeteer/assets/js/337096ba.9bbebe36.js
release-please[bot] cc95c085a2 deploy: 1014abc087
2023-11-29 13:34:30 +00:00

2 lines
9.2 KiB
JavaScript

/*! For license information please see 337096ba.9bbebe36.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[50879],{85517:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>a,contentTitle:()=>i,default:()=>o,frontMatter:()=>d,metadata:()=>c,toc:()=>h});var n=r(85893),s=r(11151);const d={sidebar_label:"PageEvent"},i="PageEvent enum",c={id:"api/puppeteer.pageevent",title:"PageEvent enum",description:"All the events that a page instance may emit.",source:"@site/../docs/api/puppeteer.pageevent.md",sourceDirName:"api",slug:"/api/puppeteer.pageevent",permalink:"/next/api/puppeteer.pageevent",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"PageEvent"},sidebar:"api",previous:{title:"Offset",permalink:"/next/api/puppeteer.offset"},next:{title:"PageEvents",permalink:"/next/api/puppeteer.pageevents"}},a={},h=[{value:"Signature:",id:"signature",level:4},{value:"Enumeration Members",id:"enumeration-members",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h4:"h4",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"pageevent-enum",children:"PageEvent enum"}),"\n",(0,n.jsx)(t.p,{children:"All the events that a page instance may emit."}),"\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:"export declare const enum PageEvent\n"})}),"\n",(0,n.jsx)(t.h2,{id:"enumeration-members",children:"Enumeration Members"}),"\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:"Member"}),(0,n.jsx)(t.th,{children:"Value"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Close"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"close"'})}),(0,n.jsx)(t.td,{children:"Emitted when the page closes."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Console"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"console"'})}),(0,n.jsxs)(t.td,{children:["Emitted when JavaScript within the page calls one of console API methods, e.g. ",(0,n.jsx)("code",{children:"console.log"})," or ",(0,n.jsx)("code",{children:"console.dir"}),". Also emitted if the page throws an error or a warning."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Dialog"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"dialog"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a JavaScript dialog appears, such as ",(0,n.jsx)("code",{children:"alert"}),", ",(0,n.jsx)("code",{children:"prompt"}),", ",(0,n.jsx)("code",{children:"confirm"})," or ",(0,n.jsx)("code",{children:"beforeunload"}),". Puppeteer can respond to the dialog via ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.dialog.accept",children:"Dialog.accept()"})," or ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.dialog.dismiss",children:"Dialog.dismiss()"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"DOMContentLoaded"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"domcontentloaded"'})}),(0,n.jsxs)(t.td,{children:["Emitted when the JavaScript ",(0,n.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded",children:"DOMContentLoaded"})," event is dispatched."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Error"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"error"'})}),(0,n.jsxs)(t.td,{children:["Emitted when the page crashes. Will contain an ",(0,n.jsx)("code",{children:"Error"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"FrameAttached"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"frameattached"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a frame is attached. Will contain a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.frame",children:"Frame"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"FrameDetached"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"framedetached"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a frame is detached. Will contain a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.frame",children:"Frame"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"FrameNavigated"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"framenavigated"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a frame is navigated to a new URL. Will contain a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.frame",children:"Frame"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Load"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"load"'})}),(0,n.jsxs)(t.td,{children:["Emitted when the JavaScript ",(0,n.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/Events/load",children:"load"})," event is dispatched."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Metrics"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"metrics"'})}),(0,n.jsxs)(t.td,{children:["Emitted when the JavaScript code makes a call to ",(0,n.jsx)("code",{children:"console.timeStamp"}),". For the list of metrics see ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.page.metrics",children:"page.metrics"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"PageError"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"pageerror"'})}),(0,n.jsxs)(t.td,{children:["Emitted when an uncaught exception happens within the page. Contains an ",(0,n.jsx)("code",{children:"Error"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Popup"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"popup"'})}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)("p",{children:"Emitted when the page opens a new tab or window."}),(0,n.jsxs)("p",{children:["Contains a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.page",children:"Page"})," corresponding to the popup window."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Request"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"request"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a page issues a request and contains a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.httprequest",children:"HTTPRequest"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"RequestFailed"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"requestfailed"'})}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)("p",{children:"Emitted when a request fails, for example by timing out."}),(0,n.jsxs)("p",{children:["Contains a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.httprequest",children:"HTTPRequest"}),"."]})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"RequestFinished"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"requestfinished"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a request finishes successfully. Contains a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.httprequest",children:"HTTPRequest"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"RequestServedFromCache"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"requestservedfromcache"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a request ended up loading from cache. Contains a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.httprequest",children:"HTTPRequest"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Response"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"response"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a response is received. Contains a ",(0,n.jsx)(t.a,{href:"/next/api/puppeteer.httpresponse",children:"HTTPResponse"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"WorkerCreated"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"workercreated"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a dedicated ",(0,n.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API",children:"WebWorker"})," is spawned by the page."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"WorkerDestroyed"}),(0,n.jsx)(t.td,{children:(0,n.jsx)("code",{children:'"workerdestroyed"'})}),(0,n.jsxs)(t.td,{children:["Emitted when a dedicated ",(0,n.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API",children:"WebWorker"})," is destroyed by the page."]})]})]})]})]})}function o(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},75251:(e,t,r)=>{var n=r(67294),s=Symbol.for("react.element"),d=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function h(e,t,r){var n,d={},h=null,l=null;for(n in void 0!==r&&(h=""+r),void 0!==t.key&&(h=""+t.key),void 0!==t.ref&&(l=t.ref),t)i.call(t,n)&&!a.hasOwnProperty(n)&&(d[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===d[n]&&(d[n]=t[n]);return{$$typeof:s,type:e,key:h,ref:l,props:d,_owner:c.current}}t.Fragment=d,t.jsx=h,t.jsxs=h},85893:(e,t,r)=>{e.exports=r(75251)},11151:(e,t,r)=>{r.d(t,{Z:()=>c,a:()=>i});var n=r(67294);const s={},d=n.createContext(s);function i(e){const t=n.useContext(d);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),n.createElement(d.Provider,{value:t},e.children)}}}]);