`/(Tablet|Mobile)/.test(ua) && ua.indexOf('Firefox') > -1;` would have been a winner.