-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use $BROWSER
variable on Linux for links
#8
Comments
On linux standard programs respective programs are used and I would hope they do everything by the book. |
So actually, there are multiple standards, and command-line apps are expected to obey Also for the record, |
To me it seems that It doesn't sound easy to do and probably requires some testing to get right - however, if you feel you need it, please feel free to implement it. Please note that to me this would warrant a major version jump just because the existing behaviour might change considerably for some. |
The default "browser" on my machine seems to be the Calibre e-book reader through "/bin/ebook-reader". This is not ideal. Honoring the |
I presume you are trying to open However, I don't think I am going to tackle this, as the potential for unwanted side-effects seems too huge. |
The crate docs need to be clear about whether this thing is intended to open files in the browser, or open files with a registered application for the file type. If in the browser, then honoring the If with a registered application, this should be clearly documented, including some of the standard "unexpected consequences" of this plan given the state of MIME types on all three major platforms but especially on Linux. XDG/Gnome/KDE is a mess here: |
I could imagine to add a new section to the documentation of |
Also worth mentioning / considering: Custom-schema uris like |
UNIX DesktopThe choice of application for opening a given URL or path on a UNIX desktop is highly dependent on the user's GUI framework (if any) and its configuration. On a console, results will likely be poor. The openers expect to be able to open in a new or existing window, something that consoles lack. On Windows WSL, Currently the It cannot be overemphasized how fragile this all is in UNIX environments. It is common for the various MIME tables to incorrectly specify the application "owning" a given filetype. It is common for openers to behave strangely. Use with caution. |
(I don't see how the behavior of |
…-only UNIX platforms. (#8) Co-authored-by: Bart Massey <[email protected]>
…-only UNIX platforms. (#8) Co-authored-by: Bart Massey <[email protected]>
Thanks a lot! I have added this PR for feedback before merging, which will conclude this issue, essentially as 'not-planned' as I don't intend to try and fix opening URLSs on any platforms. |
https://github.com/amodm/webbrowser-rs/blob/main/src/unix.rs is an example of how this can be done. I don't know how well that implementation works, though. |
Thanks so much for sharing! It seems like the Looking at the API example… use webbrowser;
if webbrowser::open("http://github.com").is_ok() {
// ...
} I don't even think that On that basis, I am closing this issue as a superior solution seems to exist. |
This would be nice considering how that variable should take precedence over whatever the default program is.
The text was updated successfully, but these errors were encountered: