sitespeedio / browsertime

Measure and Optimize Web Performance
https://www.sitespeed.io/documentation/browsertime/
Apache License 2.0
602 stars 137 forks source link

Move Firefox Browsertime extension functionality to BiDi #1170

Open soulgalore opened 4 years ago

soulgalore commented 4 years ago

Today Firefox uses https://github.com/sitespeedio/browsertime-extension to add things like cookies, request headers etc.

When Bidi for Firefox supports that functionality, we should use that instead since it will make things so much easier.

Chrome (that used to use the Browsertime Extension) uses the following CDP commands: https://github.com/sitespeedio/browsertime/blob/master/lib/chrome/webdriver/chromeDevtoolsProtocol.js

At the top of my head, these are the things we want to move to Bidi for Firefox:

soulgalore commented 4 years ago

Here's the upstream issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1613883

whimboo commented 1 year ago

Hi @soulgalore. With the efforts that we have made regarding WebDriver BiDi I wonder if we could update this particular issue to not target CDP but WebDriver BiDi instead.

Regarding the missing features the Set request headers and Inject JS on the page on new document are now available, hereby the latter for Firefox 113 (and backchannel support in 114).

soulgalore commented 1 year ago

Hi @whimboo yes you are right! Ok, I'lll start to move code to BiDi then!

soulgalore commented 1 year ago

Hi @whimboo can you point in the right direction if there's any documentation for Set request headers and Inject JS on the page on new document. Is there Selenium docs or a bug somewhere?

whimboo commented 1 year ago

I've also filed a meta bug on our side so that we can more easily track your requirements. If doable I would like to track the base requirements over there, and you can keep that issue open for your own work as needed to move to WebDriver BiDi?

whimboo commented 9 months ago

Note that Inject JS on the page on new document is available in Firefox since version 112 via the script.addPreloadScript command. Currently we are working on Set basic auth and the feature should be available on our side soon.

Sadly I don't have any information about the status in Selenium. Maybe @pujagani can give some details here.

soulgalore commented 9 months ago

I think for Selenium implementation it's already there with the BIDI class in JS, then you can send whatever command. What I'm more looking for is documentation like https://chromedevtools.github.io/devtools-protocol/ so you actually can see the command/args and what you expect back.

whimboo commented 9 months ago

That's good question @soulgalore! We talked about that already in the past but never got around to work on it. After discussing this earlier today internally I filed https://github.com/w3c/webdriver-bidi/issues/619 for now, which would allow us to auto-generate the data based off the CDDL definitions in the BiDi spec. We most likely will get started with some base content (commands and events) first before having all the arguments described as well.

pujagani commented 8 months ago

Hey @soulgalore! Please refer to https://docs.google.com/document/d/1PwRUs9fKuPctyqtICJpiaGabWy0TDKDbmMfpSKszdpA/edit?usp=sharing. We use https://wpt.fyi/results/webdriver/tests/bidi?label=master&label=experimental&aligned&view=subtest as source to truth to update the doc. It will give you an idea of what is implemented in Selenium regarding BiDi.

soulgalore commented 6 months ago

As reference: https://docs.google.com/spreadsheets/d/1bkiPU5eDBCqFkx5p_VSBx_OK8gy9TeHRKQVPHKMATGQ/edit?pli=1#gid=0