Skip to content

Commit 8c195c3

Browse files
opener doesn't seem happy, try switching to webbrowser crate instead.
1 parent 6823d0d commit 8c195c3

File tree

3 files changed

+174
-4
lines changed

3 files changed

+174
-4
lines changed

Cargo.lock

Lines changed: 166 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samply/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fs4 = "0.8.3"
5353
humantime = "2.1.0"
5454
shlex = "1.3.0"
5555
coreclr-tracing = { version = "0.1", path = "../coreclr-tracing" }
56+
webbrowser = "1.0.4"
5657

5758
[target.'cfg(any(target_os = "android", target_os = "macos", target_os = "linux"))'.dependencies]
5859

samply/src/server.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,15 @@ async fn start_server(
209209
}
210210
eprintln!("Press Ctrl+C to stop.");
211211

212+
eprintln!("opening browser?");
212213
if server_props.open_in_browser {
214+
eprintln!("yes");
213215
if let Some(profiler_url) = &profiler_url {
214-
let _ = opener::open_browser(profiler_url);
216+
eprintln!("definitely");
217+
match webbrowser::open(profiler_url) {
218+
Ok(_) => println!("Opened browser at {}", profiler_url),
219+
Err(e) => eprintln!("Failed to open browser: {}", e),
220+
}
215221
}
216222
}
217223

0 commit comments

Comments
 (0)