xdg-open is a new standard, and you should use it whenever possible. However, if the distribution is more than a few years old, it may be absent, and alternative mechanisms include $ BROWSER (an older sample standard), gnome-open (Gnome), kfmclient exec (KDE), exo-open (Xfce), or mailcap (the text / html handler will most likely be a browser).
However, most applications do not care about such a lot of work - if they are created for a specific environment, they use the mechanisms for launching the environment. For example, Gnome has gnome_url_show, KDE has KRun, most terminal programs (like mutt) handle mail, etc. Hard browser encoding and permission to distribute, or the user to override the default is also normal.
I do not suggest hardcoding this, but if you really want to open a new tab in Firefox, you can use the "firefox -new-tab $ URL".
source share