Fix missing user-agent from servo-shell (#36859)

Properly passes user-agent from servoshell args to the preferences.

Testing:
```bash
RUST_LOG=warn WAYLAND_DISPLAY='' ./mach run -r --screen-size=375x812 --window-size=375x812 --pref=dom_svg_enabled --pref=dom_intersection_observer_enabled --user-agent "Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1"


RUST_LOG=warn WAYLAND_DISPLAY='' ./mach run -r --screen-size=375x812 --window-size=375x812 --pref=dom_svg_enabled --pref=dom_intersection_observer_enabled
```

Fixes: N/A

---------

Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Astraea Quinn S 2025-05-05 18:51:11 +02:00 committed by GitHub
parent 2fa96cf961
commit a77ee1521a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -653,6 +653,10 @@ pub(crate) fn parse_command_line_arguments(args: Vec<String>) -> ArgumentParsing
preferences.media_glvideo_enabled = false;
}
if let Some(user_agent) = opt_match.opt_str("user-agent") {
preferences.user_agent = user_agent;
}
let opts = Opts {
debug: debug_options.clone(),
wait_for_stable_image,