True but they also didn't need to had they made decisions geared around long term sustainability. They could have kept Firefox running with a budget of under $150 million a year (~500 employees) and invested the rest. That'd be a nest egg of probably $4 billion by now including growth. That's enough for them to keep going for decades with no external revenue.
Instead they kept spending money on moonshot projects to become an independent megacorp. Failing every time. Now they don't have many options remaining.