devtools: Allow specifiying an address to listen to and default to localhost (#42502)

Previously we listened to 0.0.0.0. which means any connection coming to
a specific port. That seems a bit ill advised as not everybody has a
good firewall setup. Now we default listen only on 127.0.0.1 but
optionally can describe a full SocketAddr such as "192.168.1.23:1234".

Side note: Cleaned up the ipc-channel syntax.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

Testing: Currently we don't have an automatic way to test this. Manually
run devtools and it connects.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger
2026-02-19 12:24:56 +09:00
committed by GitHub
parent 07b120e0d0
commit 00fa5d3088
5 changed files with 30 additions and 18 deletions

View File

@@ -87,9 +87,8 @@ pub struct Preferences {
pub css_animations_testing_enabled: bool,
/// Start the devtools server at startup
pub devtools_server_enabled: bool,
/// Port number to start a server to listen to remote Firefox devtools connections.
/// 0 for random port.
pub devtools_server_port: i64,
/// The address +port the devtools server listens to, default to 127.0.0.1:7000.
pub devtools_server_listen_address: String,
// feature: WebGPU | #24706 | Web/API/WebGPU_API
pub dom_webgpu_enabled: bool,
/// List of comma-separated backends to be used by wgpu.
@@ -342,7 +341,7 @@ impl Preferences {
Self {
css_animations_testing_enabled: false,
devtools_server_enabled: false,
devtools_server_port: 0,
devtools_server_listen_address: String::new(),
dom_abort_controller_enabled: true,
dom_adoptedstylesheet_enabled: false,
dom_allow_scripts_to_close_windows: false,