Conversation
crates/wasm/Cargo.toml
Outdated
| "native", | ||
| ] } | ||
|
|
||
| webbrowser = "0.8.10" |
There was a problem hiding this comment.
Might be a good idea to use open, which we have a workspace dep for. Not sure if it'd be a security risk, though - does open::that("explorer.exe") work?
There was a problem hiding this comment.
Might be a good idea to use
open, which we have a workspace dep for. Not sure if it'd be a security risk, though - doesopen::that("explorer.exe")work?
open works.
I am not on Windows so I am not sure of the latter. Isn't that only used for URL? https://docs.rs/open/latest/open/
| ) -> Element { | ||
| crate::prelude::Button::new(&url.clone(), move |world| { | ||
| println!("Opening url {}", &url); | ||
| let link = Entity::new().with(hyperlink(), url.clone()); |
There was a problem hiding this comment.
Maybe worth adding a function for this instead of an entity. That would also allow us to return an error if we find the thing that's being opened to be invalid/questionable.
There was a problem hiding this comment.
Maybe worth adding a function for this instead of an entity. That would also allow us to return an error if we find the thing that's being opened to be invalid/questionable.
I tried before to call webbrowser here but get a 'wbindgen_placeholder' error. That's why I have to send to the world and watch it. Perhaps we can do the check there and then decide whether we want to open it or not?
--- edit
cannot put open here as well. so it has to communicate with backend?
2023-07-07.09-00-18.mp4