puppeteer/assets/js/85e7bcf9.4c77b010.js

2 lines
9.2 KiB
JavaScript
Raw Normal View History

/*! For license information please see 85e7bcf9.4c77b010.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[58745],{92610:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>n,metadata:()=>a,toc:()=>h});var s=r(85893),d=r(11151);const n={sidebar_label:"PageEvent"},i="PageEvent enum",a={id:"api/puppeteer.pageevent",title:"PageEvent enum",description:"All the events that a page instance may emit.",source:"@site/versioned_docs/version-22.0.0/api/puppeteer.pageevent.md",sourceDirName:"api",slug:"/api/puppeteer.pageevent",permalink:"/api/puppeteer.pageevent",draft:!1,unlisted:!1,tags:[],version:"22.0.0",frontMatter:{sidebar_label:"PageEvent"},sidebar:"api",previous:{title:"Offset",permalink:"/api/puppeteer.offset"},next:{title:"PageEvents",permalink:"/api/puppeteer.pageevents"}},c={},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,d.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"pageevent-enum",children:"PageEvent enum"}),"\n",(0,s.jsx)(t.p,{children:"All the events that a page instance may emit."}),"\n",(0,s.jsx)(t.h4,{id:"signature",children:"Signature:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"export declare const enum PageEvent\n"})}),"\n",(0,s.jsx)(t.h2,{id:"enumeration-members",children:"Enumeration Members"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Member"}),(0,s.jsx)(t.th,{children:"Value"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Close"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:'"close"'})}),(0,s.jsx)(t.td,{children:"Emitted when the page closes."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Console"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:'"console"'})}),(0,s.jsxs)(t.td,{children:["Emitted when JavaScript within the page calls one of console API methods, e.g. ",(0,s.jsx)("code",{children:"console.log"})," or ",(0,s.jsx)("code",{children:"console.dir"}),". Also emitted if the page throws an error or a warning."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Dialog"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:'"dialog"'})}),(0,s.jsxs)(t.td,{children:["Emitted when a JavaScript dialog appears, such as ",(0,s.jsx)("code",{children:"alert"}),", ",(0,s.jsx)("code",{children:"prompt"}),", ",(0,s.jsx)("code",{children:"confirm"})," or ",(0,s.jsx)("code",{children:"beforeunload"}),". Puppeteer can respond to the dialog via ",(0,s.jsx)(t.a,{href:"/api/puppeteer.dialog.accept",children:"Dialog.accept()"})," or ",(0,s.jsx)(t.a,{href:"/api/puppeteer.dialog.dismiss",children:"Dialog.dismiss()"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"DOMContentLoaded"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:'"domcontentloaded"'})}),(0,s.jsxs)(t.td,{children:["Emitted when the JavaScript ",(0,s.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded",children:"DOMContentLoaded"})," event is dispatched."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Error"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:'"error"'})}),(0,s.jsxs)(t.td,{children:["Emitted when the page crashes. Will contain an ",(0,s.jsx)("code",{children:"Error"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"FrameAttached"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:'"frameattached"'})}),(0,s.jsxs)(t.td,{children:["Emitted when a frame is attached. Will contain a ",(0,s.jsx)(t.a,{href:"/api/puppeteer.frame",children:"Frame"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"FrameDetached"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:'"framedetached"'})}),(0,s.jsxs)(t.td,{children:["Emitted when a frame is detached. Will contain