Cross OS Native API Methods to Get Path to Default Browser

Hi all I’m working on a cross operating system method to obtain the path to the default browser using native C API’s of the operating systems. For example if it is Firefox it will get back “C:Program Files(x86)Mozilla Firefoxfirefox.exe” on a windows system.

I did some research and this is what I got so far but it’s not the best, in that for linux it only supports gtk systems. I’m not 100% confident its the best method to take either. I also think I’m missing methods for other systems such as SunOS and *BSD. Can you please advise:

case 'WINNT':
    // copy this
    // that works properly based on this article:

case 'Linux':
    // GDK
    // non-GDK
        // ???

case 'Darwin':

Source: unix

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.