Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Posixy way to launch browser?

Is there a 'Posixy' way to open an URL, preferrably in the default browser? I would like to do something like

ShellExecute(0, _T("open"), url, 0, 0, SW_SHOWDEFAULT);

that works on GNU/Linux and MAC. I read some answer saying that`

if (fork() == 0)
    system("sensible-browser http://wherever.com");

does the trick on Debian systems at least. Is there an easy way to extend this to something that works on other distributions and Mac OS X?

like image 743
Jonas Byström Avatar asked Sep 11 '25 02:09

Jonas Byström


1 Answers

A user's browser preference is not really something the POSIX standard concerns itself with that I'm aware of.

like image 141
Azeem.Butt Avatar answered Sep 13 '25 16:09

Azeem.Butt