Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Firefox Browsertime extension functionality to BiDi #1170

Open
4 of 6 tasks
soulgalore opened this issue Feb 7, 2020 · 10 comments
Open
4 of 6 tasks

Move Firefox Browsertime extension functionality to BiDi #1170

soulgalore opened this issue Feb 7, 2020 · 10 comments

Comments

@soulgalore
Copy link
Member

soulgalore commented Feb 7, 2020

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:

  • Set request headers - #2108 when Firefox supports it.
  • Set cookies
  • Inject JS on the page on new document
  • Set basic auth (same as request headers)
  • Block domains
  • Clear browser cache.
@soulgalore
Copy link
Member Author

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

@whimboo
Copy link

whimboo commented Apr 25, 2023

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
Copy link
Member Author

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

@soulgalore soulgalore changed the title Move Firefox Browsertime extension functionality to CDP Move Firefox Browsertime extension functionality to BiDi Apr 25, 2023
@soulgalore
Copy link
Member Author

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
Copy link

whimboo commented May 2, 2023

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
Copy link

whimboo commented Dec 12, 2023

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
Copy link
Member Author

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
Copy link

whimboo commented Dec 12, 2023

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 w3c/webdriver-bidi#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
Copy link

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
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants