puppeteer/assets/js/5ab72998.883db365.js

2 lines
4.6 KiB
JavaScript
Raw Normal View History

/*! For license information please see 5ab72998.883db365.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[84359],{60184:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>o,contentTitle:()=>i,default:()=>p,frontMatter:()=>a,metadata:()=>c,toc:()=>l});var n=t(85893),s=t(11151);const a={sidebar_label:"Tracing"},i="Tracing class",c={id:"api/puppeteer.tracing",title:"Tracing class",description:"The Tracing class exposes the tracing audit interface.",source:"@site/versioned_docs/version-22.8.2/api/puppeteer.tracing.md",sourceDirName:"api",slug:"/api/puppeteer.tracing",permalink:"/api/puppeteer.tracing",draft:!1,unlisted:!1,tags:[],version:"22.8.2",frontMatter:{sidebar_label:"Tracing"},sidebar:"api",previous:{title:"Touchscreen.touchStart",permalink:"/api/puppeteer.touchscreen.touchstart"},next:{title:"Tracing.start",permalink:"/api/puppeteer.tracing.start"}},o={},l=[{value:"Signature:",id:"signature",level:4},{value:"Remarks",id:"remarks",level:2},{value:"Example",id:"example",level:2},{value:"Methods",id:"methods",level:2}];function d(e){const r={a:"a",code:"code",h1:"h1",h2:"h2",h4:"h4",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.h1,{id:"tracing-class",children:"Tracing class"}),"\n",(0,n.jsx)(r.p,{children:"The Tracing class exposes the tracing audit interface."}),"\n",(0,n.jsx)(r.h4,{id:"signature",children:"Signature:"}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-typescript",children:"export declare class Tracing\n"})}),"\n",(0,n.jsx)(r.h2,{id:"remarks",children:"Remarks"}),"\n",(0,n.jsxs)(r.p,{children:["You can use ",(0,n.jsx)(r.code,{children:"tracing.start"})," and ",(0,n.jsx)(r.code,{children:"tracing.stop"})," to create a trace file which can be opened in Chrome DevTools or ",(0,n.jsx)(r.a,{href:"https://chromedevtools.github.io/timeline-viewer/",children:"timeline viewer"}),"."]}),"\n",(0,n.jsxs)(r.p,{children:["The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ",(0,n.jsx)(r.code,{children:"Tracing"})," class."]}),"\n",(0,n.jsx)(r.h2,{id:"example",children:"Example"}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-ts",children:"await page.tracing.start({path: 'trace.json'});\nawait page.goto('https://www.google.com');\nawait page.tracing.stop();\n"})}),"\n",(0,n.jsx)(r.h2,{id:"methods",children:"Methods"}),"\n",(0,n.jsxs)("table",{children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:(0,n.jsx)(r.p,{children:"Method"})}),(0,n.jsx)("th",{children:(0,n.jsx)(r.p,{children:"Modifiers"})}),(0,n.jsx)("th",{children:(0,n.jsx)(r.p,{children:"Description"})})]})}),(0,n.jsxs)("tbody",{children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{children:(0,n.jsx)("span",{id:"start",children:(0,n.jsx)(r.a,{href:"/api/puppeteer.tracing.start",children:"start(options)"})})}),(0,n.jsx)("td",{}),(0,n.jsxs)("td",{children:[(0,n.jsx)(r.p,{children:"Starts a trace for the current page."}),(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Remarks:"})}),(0,n.jsx)(r.p,{children:"Only one trace can be active at a time per browser."})]})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{children:(0,n.jsx)("span",{id:"stop",children:(0,n.jsx)(r.a,{href:"/api/puppeteer.tracing.stop",children:"stop()"})})}),(0,n.jsx)("td",{}),(0,n.jsx)("td",{children:(0,n.jsxs)(r.p,{children:["Stops a trace started with the ",(0,n.jsx)(r.code,{children:"start"})," method."]})})]})]})]})]})}function p(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},75251:(e,r,t)=>{var n=t(67294),s=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(e,r,t){var n,a={},l=null,d=null;for(n in void 0!==t&&(l=""+t),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(d=r.ref),r)i.call(r,n)&&!o.hasOwnProperty(n)&&(a[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.def