Adapting the browser_protocol file fetching to the file structure change. by diemol · Pull Request #16440 · SeleniumHQ/selenium

User description

🔗 Related Issues

Fixes #16299

💥 What does this PR do?

See the linked issue for more details.

This PR fetches the browser_protocol file, retrieves all the includes, fetches them, and concatenates the files into a single browser_protocol.pdl file, allowing the rest of the process to continue.


PR Type

Bug fix


Description

  • Implements fetching and concatenation of Chrome DevTools Protocol domain files

  • Adds flatten_browser_pdl() function to resolve include directives in browser_protocol.pdl

  • Fetches individual domain .pdl files from Chromium repository and merges them

  • Integrates flattening step into the CDP update workflow


Diagram Walkthrough

flowchart LR
  A["Fetch browser_protocol.pdl"] --> B["Parse include directives"]
  B --> C["Fetch domain .pdl files"]
  C --> D["Concatenate domains"]
  D --> E["Overwrite browser_protocol.pdl"]
Loading

File Walkthrough

Relevant files
Bug fix
update_cdp.py
Implement browser_protocol.pdl flattening for Chromium file structure

scripts/update_cdp.py

  • Added flatten_browser_pdl() function to parse and fetch included
    domain files
  • Extracts include directives using regex pattern matching
  • Fetches domain files from Chromium repository and concatenates them
  • Integrated flattening step into add_pdls() workflow after initial
    fetch
+21/-0