14
14
//!
15
15
//! ## Platform Support Status
16
16
//!
17
- //! | Platform | Supported | Browsers | Test status |
18
- //! |----------|-----------|----------|-------------|
19
- //! | macos | ✅ | default + [others](https://docs.rs/webbrowser/latest/webbrowser/enum.Browser.html) | ✅ |
20
- //! | windows | ✅ | default only | ✅ |
21
- //! | linux/wsl | ✅ | default only (respects $BROWSER env var, so can be used with other browsers) | ✅ |
22
- //! | android | ✅ | default only | ✅ |
23
- //! | ios | ✅ | default only | ✅ |
24
- //! | wasm | ✅ | default only | ✅ |
17
+ //! | Platform | Supported | Browsers | Test status |
18
+ //! |----------------------- |-----------|----------|-------------|
19
+ //! | macOS | ✅ | default + [others](https://docs.rs/webbrowser/latest/webbrowser/enum.Browser.html) | ✅ |
20
+ //! | windows | ✅ | default only | ✅ |
21
+ //! | linux/wsl | ✅ | default only (respects $BROWSER env var, so can be used with other browsers) | ✅ |
22
+ //! | android | ✅ | default only | ✅ |
23
+ //! | iOS/tvOS/visionOS | ✅ | default only | ✅ |
24
+ //! | wasm | ✅ | default only | ✅ |
25
25
//! | unix (*bsd, aix etc.) | ✅ | default only (respects $BROWSER env var, so can be used with other browsers) | Manual |
26
26
//!
27
27
//! ## Consistent Behaviour
39
39
//! * `disable-wsl` - this disables WSL `file` implementation (`http` still works)
40
40
//! * `wasm-console` - this enables logging to wasm console (valid only on wasm platform)
41
41
42
- #[ cfg_attr( any( target_os = "ios" , target_os = "tvos" ) , path = "ios.rs" ) ]
42
+ #[ cfg_attr(
43
+ any( target_os = "ios" , target_os = "tvos" , target_os = "visionos" ) ,
44
+ path = "ios.rs"
45
+ ) ]
43
46
#[ cfg_attr( target_os = "macos" , path = "macos.rs" ) ]
44
47
#[ cfg_attr( target_os = "android" , path = "android.rs" ) ]
45
48
#[ cfg_attr( target_family = "wasm" , path = "wasm.rs" ) ]
50
53
not( any(
51
54
target_os = "ios" ,
52
55
target_os = "tvos" ,
56
+ target_os = "visionos" ,
53
57
target_os = "macos" ,
54
58
target_os = "android" ,
55
59
target_family = "wasm" ,
@@ -67,6 +71,7 @@ mod os;
67
71
not( any(
68
72
target_os = "ios" ,
69
73
target_os = "tvos" ,
74
+ target_os = "visionos" ,
70
75
target_os = "macos" ,
71
76
target_os = "android" ,
72
77
target_family = "wasm" ,
@@ -316,6 +321,7 @@ pub fn open_browser_with_options(
316
321
if cfg ! ( any(
317
322
target_os = "ios" ,
318
323
target_os = "tvos" ,
324
+ target_os = "visionos" ,
319
325
target_os = "macos" ,
320
326
target_os = "android" ,
321
327
target_family = "wasm" ,
@@ -338,6 +344,8 @@ impl TargetType {
338
344
feature = "hardened" ,
339
345
target_os = "android" ,
340
346
target_os = "ios" ,
347
+ target_os = "tvos" ,
348
+ target_os = "visionos" ,
341
349
target_family = "wasm"
342
350
) ) ]
343
351
fn is_http ( & self ) -> bool {
@@ -346,7 +354,13 @@ impl TargetType {
346
354
347
355
/// If `target` represents a valid http/https url, return the str corresponding to it
348
356
/// else return `std::io::Error` of kind `std::io::ErrorKind::InvalidInput`
349
- #[ cfg( any( target_os = "android" , target_os = "ios" , target_family = "wasm" ) ) ]
357
+ #[ cfg( any(
358
+ target_os = "android" ,
359
+ target_os = "ios" ,
360
+ target_os = "tvos" ,
361
+ target_os = "visionos" ,
362
+ target_family = "wasm"
363
+ ) ) ]
350
364
fn get_http_url ( & self ) -> Result < & str > {
351
365
if self . is_http ( ) {
352
366
Ok ( self . 0 . as_str ( ) )
0 commit comments