I was surprised to not be able to find a satisfying solution to this problem (in particular I'm looking for a solution that works for mobile phones as well). I tried something like this:
if ($.browser.mozilla) {
// do something
} else {
// do something else
}
but obtained the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'mozilla')
at (index):120:19
Thank you in advance for your help!