rewrite ds4_web.c/.h into rust #50

Closed
opened 2026-07-28 08:16:30 +00:00 by hugo · 1 comment
Owner

/native/web/ is a folder that contains a C implementation of a web browser client. This needs to be rewritten into proper rust and all the code should use that rust code. C-Code is only relevant in the border to the metal files, everything else must be proper Rust. So if this can be safely rewritten as Rust, it should be.

/native/web/ is a folder that contains a C implementation of a web browser client. This needs to be rewritten into proper rust and all the code should use that rust code. C-Code is only relevant in the border to the metal files, everything else must be proper Rust. So if this can be safely rewritten as Rust, it should be.
hugo added the bug label 2026-07-28 08:16:35 +00:00
hugo added idea and removed bug labels 2026-07-28 11:46:37 +00:00
Author
Owner

Implemented and pushed in commit 9d1c403.

Path taken:

  • Replaced the hand-written C HTTP/WebSocket/CDP stack with headless_chrome 1.0.22.
  • Added a thin Rust browser module that reuses the DS4 profile and debugging port, reconnects to an existing browser when available, and otherwise launches managed headless Chrome.
  • Preserved DS4 navigation readiness, dynamic scrolling, extraction JavaScript, result formatting, approval, and cancellation behavior.
  • Removed the Rust FFI wrapper, native/web/ds4_web.c and native/web/ds4_web.h, and the C web build step; retained the DS4 MIT license.
  • Added helper coverage plus an ignored real-Chrome localhost smoke test.

Verified with rustfmt, Clippy with warnings denied, make bundle, cargo test --all-features, and the live headless Chrome smoke test.

Implemented and pushed in commit 9d1c403. Path taken: - Replaced the hand-written C HTTP/WebSocket/CDP stack with headless_chrome 1.0.22. - Added a thin Rust browser module that reuses the DS4 profile and debugging port, reconnects to an existing browser when available, and otherwise launches managed headless Chrome. - Preserved DS4 navigation readiness, dynamic scrolling, extraction JavaScript, result formatting, approval, and cancellation behavior. - Removed the Rust FFI wrapper, native/web/ds4_web.c and native/web/ds4_web.h, and the C web build step; retained the DS4 MIT license. - Added helper coverage plus an ignored real-Chrome localhost smoke test. Verified with rustfmt, Clippy with warnings denied, make bundle, cargo test --all-features, and the live headless Chrome smoke test.
hugo closed this issue 2026-07-28 20:18:52 +00:00
Sign in to join this conversation.