Skip to content
Advertisement

How can I programmatically open the default browser and pass a URL in C/Linux?

Is there a convenient library call that allows me to open the default browser that I can use from C? I poked around in glib and didn’t see anything. There is xdg-open, and I can just system that I guess. Any better ideas?

Advertisement

Answer

If it is installed then xdg-open would work.

xdg-open http://www.stackoverflow.com
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement