Performing browser detection is the last thing you want to do, because you are guaranteeing that anything which is not Firefox but has the same problem, isn't going to be fixed.
Also, if Firefox is updated to fix that problem, you may be trying to fix something that doesn't need to be fixed any more, which ends up making things worse for yourself.
Instead, perform object detection where you check for the problem that needs to be fixed, and should that problem be there you can then do something about it.
What is the problem that needs to be fixed? As it is a common situation, there will be a common solution that resolves the issue for you.