mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
|
/*! For license information please see 0034c797.b1093b83.js.LICENSE.txt */
|
||
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[48651],{4719:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>d,contentTitle:()=>t,default:()=>h,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=n(85893),s=n(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-21.6.0/webdriver-bidi.md",sourceDirName:".",slug:"/webdriver-bidi",permalink:"/webdriver-bidi",draft:!1,unlisted:!1,tags:[],version:"21.6.0",frontMatter:{},sidebar:"docs",previous:{title:"Puppeteer Angular Schematic",permalink:"/integrations/ng-schematics"},next:{title:"Chromium Support",permalink:"/chromium-support"}},d={},c=[{value:"Automate with Chrome and Firefox",id:"automate-with-chrome-and-firefox",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,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.h1,{id:"experimental-webdriver-bidi-support",children:"Experimental WebDriver BiDi Support"}),"\n",(0,i.jsxs)(r.p,{children:[(0,i.jsx)(r.a,{href:"https://w3c.github.io/webdriver-bidi/",children:"WebDriver BiDi"})," is a new cross-browser\nautomation protocol that adds browser-driven events to WebDriver. Here are the\nresources if you want to learn more about WebDriver BiDi:"]}),"\n",(0,i.jsxs)(r.ul,{children:["\n",(0,i.jsx)(r.li,{children:(0,i.jsx)(r.a,{href:"https://developer.chrome.com/articles/webdriver-bidi/",children:"WebDriver BiDi - The future of cross-browser automation"})}),"\n",(0,i.jsx)(r.li,{children:(0,i.jsx)(r.a,{href:"https://developer.chrome.com/blog/webdriver-bidi-2023/",children:"WebDriver BiDi: 2023 status update"})}),"\n"]}),"\n",(0,i.jsx)(r.h2,{id:"automate-with-chrome-and-firefox",children:"Automate with Chrome and Firefox"}),"\n",(0,i.jsxs)(r.p,{children:["Firefox support has almost reaching feature parity with the previous CDP-based\nimplementation. To see which features are fully supported with WebDriver BiDi we\nused the ",(0,i.jsx)(r.a,{href:"https://puppeteer.github.io/ispuppeteerwebdriverbidiready/",children:"Puppeteer test suite"}),". Currently,\nwe still have fewer than\n",(0,i.jsx)(r.a,{href:"https://puppeteer.github.io/ispuppeteerwebdriverbidiready/firefox-delta.json",children:"60"}),"\ntests that are failing with Firefox and WebDriver BiDi compared to the previous\nCDP implementation in Firefox but we also have more than\n",(0,i.jsx)(r.a,{href:"https://puppeteer.github.io/ispuppeteerwebdriverbidiready/firefox-delta.json",children:"82"}),"\nnew tests that work with WebDriver BiDi and that didn't work with CDP."]}),"\n",(0,i.jsx)(r.p,{children:"For Chrome, around 68% of the tests are currently passing with WebDriver BiDi so\nthe CDP-based implementation remains more powerful. Some of the Puppeteer\nfunctionality is relying on CDP even with WebDriver BiDi enabled. Therefore, the\ntest pass rate is currently higher than that one of Firefox."}),"\n",(0,i.jsx)(r.p,{children:"Example of launching Firefox with WebDriver BiDi:"}),"\n",(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-ts",children:"import puppeteer from 'puppeteer';\n\nconst browser = await puppeteer.launch({\n product: 'firefox',\n protocol: 'webDriverBiDi',\n});\nconst page = await browser.newPage();\n...\nawait browser.close();\n"})}),"\n",(0,i.jsx)(r.p,{children:"Example of launching Chrome with WebDriver BiDi:"}),"\n",(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-ts",children:"import puppeteer from 'puppeteer';\n\nconst browser = await puppeteer.launch({\n product: 'chrome',\n protocol: 'webDriverBiDi',\n});\nconst page = await browser.newPage();\n...\nawait browser.close();\n"})}),"\n",(0,i.jsx)(r.h2,{id:"puppeteer-features-suppo
|