, , , ,

Firefox WebDriver Newsletter 134

Posted by

WebDriver is a remote control interface that enables introspection and control of user agents. As such it can help developers to verify that their websites are working and performing well with all major browsers. The protocol is standardized by the W3C and consists of two separate specifications: WebDriver classic (HTTP) and the new WebDriver BiDi (Bi-Directional).

This newsletter gives an overview of the work we’ve done as part of the Firefox 134 release cycle.

Contributions

Firefox – including our WebDriver implementation – is developed as an open source project, and everyone is welcome to contribute. If you ever wanted to contribute to an open source project used by millions of users, or are interested in some experience in software development, jump in.

In Firefox 134, after working on bug fixes and improvements in previous releases, Dan (temidayoazeez032) implemented a completely new WebDriver BiDi command: browser.getClientWindows. Read more about this new feature in the detailed WebDriver BiDi updates below.

WebDriver code is written in JavaScript, Python, and Rust so any web developer can contribute! Read how to setup the work environment and check the list of mentored issues for Marionette, or the list of mentored JavaScript bugs for WebDriver BiDi. Feel free to join our chatroom if you can’t see a bug that appeals to you, we can probably find a good task to get you started 🙂

WebDriver BiDi

Implemented the browser.getClientWindows command

Thanks again to Dan (temidayoazeez032) for this contribution. The browser.getClientWindows command allows clients to retrieve information about the currently opened browser windows. This command does not take any parameter and will return a payload with a clientWindows property containing a list of browser.ClientWindowInfo objects.

The example below shows the output of the browser.getClientWindows command when 2 browser windows are opened.

-> {
  "method": "browser.getClientWindows",
  "params": {},
  "id": 2
}

<- {
  "type": "success",
  "id": 2,
  "result": {
    "clientWindows": [
      {
        "active": false,
        "clientWindow": "8caf6a5d-944a-4709-ad0f-694418e3d262",
        "height": 971,
        "state": "normal",
        "width": 1280,
        "x": 4,
        "y": 38
      },
      {
        "active": true,
        "clientWindow": "be7dc2ed-d9ba-41d9-b864-dd9a6fabb9bf",
        "height": 971,
        "state": "normal",
        "width": 1280,
        "x": 26,
        "y": 60
      }
    ]
  }
}

This command will be especially useful in upcoming releases when the browser.setClientWindowState command is implemented, in order to update the dimensions of specific windows.

Support for initiatorType and destination fields in network events

The network.RequestData present in all network events now includes two new fields: initiatorType and destination. They are both strings, defined in the fetch specification (see: initiator type, destination). The initiatorType allows to know what triggered the request, and the destination field to know how the response will be used. Both fields are strings, and you can refer to the fetch specification to learn about the various values that they might be set to.

As an example, if a CSS file defines a background-image property for an element pointing to a url(), the corresponding request will have initiatorType set to "css" and destination set to "image".

Bug fixes

Marionette

Install and uninstall addons on GeckoView

The Addon:Install and Addon:Uninstall commands are now available for GeckoView. This will make it easier to test extensions on the mobile versions of Firefox.

Added Private Browsing mode support to Addon:Install

The Addon:Install command can now be used to install extensions enabled in Private Browsing mode. Clients can pass an optional boolean allowPrivateBrowsing to Addon:Install. When true, the extension will be installed in Private Browsing mode.

Leave a Reply

Your email address will not be published. Required fields are marked *