puppeteer/assets/js/8e4cdb63.365bdf30.js

2 lines
15 KiB
JavaScript
Raw Normal View History

/*! For license information please see 8e4cdb63.365bdf30.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[88542],{74130:(e,r,i)=>{i.r(r),i.d(r,{assets:()=>d,contentTitle:()=>t,default:()=>h,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var n=i(85893),s=i(11151);const l={},t="Experimental WebDriver BiDi support",o={id:"webdriver-bidi",title:"Experimental WebDriver BiDi support",description:"WebDriver BiDi is a new cross-browser",source:"@site/versioned_docs/version-22.8.0/webdriver-bidi.md",sourceDirName:".",slug:"/webdriver-bidi",permalink:"/webdriver-bidi",draft:!1,unlisted:!1,tags:[],version:"22.8.0",frontMatter:{},sidebar:"docs",previous:{title:"Links",permalink:"/guides/links"},next:{title:"Supported browsers",permalink:"/supported-browsers"}},d={},c=[{value:"Automate with Chrome and Firefox",id:"automate-with-chrome-and-firefox",level:2},{value:"Measuring progress",id:"measuring-progress",level:2},{value:"Get started",id:"get-started",level:2},{value:"Puppeteer features supported over WebDriver BiDi",id:"puppeteer-features-supported-over-webdriver-bidi",level:2},{value:"Puppeteer features not yet supported over WebDriver BiDi",id:"puppeteer-features-not-yet-supported-over-webdriver-bidi",level:2}];function a(e){const r={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.h1,{id:"experimental-webdriver-bidi-support",children:"Experimental WebDriver BiDi support"}),"\n",(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.a,{href:"https://w3c.github.io/webdriver-bidi/",children:"WebDriver BiDi"})," is a new cross-browser\nautomation protocol currently under development, aiming to combine the best of both WebDriver \u201cClassic\u201d and CDP. WebDriver BiDi promises bi-directional communication, making it fast by default, and it comes packed with low-level control."]}),"\n",(0,n.jsx)(r.p,{children:"See also:"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"https://developer.chrome.com/articles/webdriver-bidi/",children:"WebDriver BiDi - The future of cross-browser automation"})}),"\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"https://developer.chrome.com/blog/webdriver-bidi-2023/",children:"WebDriver BiDi: 2023 status update"})}),"\n"]}),"\n",(0,n.jsx)(r.h2,{id:"automate-with-chrome-and-firefox",children:"Automate with Chrome and Firefox"}),"\n",(0,n.jsx)(r.p,{children:"Puppeteer supports WebDriver BiDi automation with Chrome and Firefox."}),"\n",(0,n.jsxs)(r.p,{children:["Firefox integration is nearing feature parity with its previous CDP-based approach. Learn more in the ",(0,n.jsx)(r.a,{href:"https://hacks.mozilla.org/2023/12/puppeteer-webdriver-bidi/",children:"dedicated announcement"}),"."]}),"\n",(0,n.jsx)(r.h2,{id:"measuring-progress",children:"Measuring progress"}),"\n",(0,n.jsxs)(r.p,{children:["To gauge the capabilities of WebDriver BiDi, we utilized the comprehensive ",(0,n.jsx)(r.a,{href:"https://puppeteer.github.io/ispuppeteerwebdriverbidiready/",children:"Puppeteer test suite"})]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:["For Firefox, there are currently under ",(0,n.jsx)(r.a,{href:"https://puppeteer.github.io/ispuppeteerwebdriverbidiready/firefox-delta.json",children:"30"})," failing tests compared to the CDP implementation, while over ",(0,n.jsx)(r.a,{href:"https://puppeteer.github.io/ispuppeteerwebdriverbidiready/firefox-delta.json",children:"140"})," new tests successfully utilize WebDriver BiDi, demonstrating its growing potential."]}),"\n",(0,n.jsx)(r.li,{children:"For Chrome, around 85% of tests pass with WebDriver BiDi, indicating room for improvement compared to the CDP-based approach."}),"\n"]}),"\n",(0,n.jsx)(r.h2,{id:"get-started",children:"Get started"}),"\n",(0,n.jsx)(r.p,{children:"Below is an example of launching Firefox or Chrome with WebDriver BiDi:"}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-ts",children:"import puppeteer from 'puppeteer';\n\nconst browser = await puppeteer.launch({\n product: 'firefox', // or 'chrome'\n protocol: 'webDriverBi