then admiral darlan , the supreme french commander in french north africa , even though he hated the british because they had beaten the french at the battle of trafalgar in 1805 during the napoleonic wars , agreed to fight alongside the allies .