I was having a problem on one of my OpenSuse installations where Firefox was taking about 30 seconds to start. After changing some network settings it fixed itself, but the longer the system ran the worse it got again.
After a lot, and I mean a LOT, of research I could never find a direct fix on the internet, but it seems to have to do with DNS stuff. In my network I enforce the use of the pihole and this seems to be one of the sources of the problem (may be other things too).
The way I found to fix it was to install the KDE network manager "plasma-nm"", this will give you the necessary dependencies and the ability to use KDE system settings on a non-KDE system (if you use Sway or Hyperland, for example, GNOME's network manager should also work well. You can even enter all the settings manually if you know how). In the KDE-System-Settings Network Manager settings, I changed the IPv4 settings to manual, entered the DNS IP directly (if you do not host your own, just enter an external one), gave myself a static IP (do that in your router to if you can, just to be sure) and set the netmask and gateway according to my routers defaults. The last thing to change is "IPv4 is required for this connection" to "True", which forces the system to use the configured DNS. After that (and perhaps a reboot) your Firefox should work normaly again.
It has no choice but to use your configured DNS and can not run into a DNS timeout any more. Hope I could help you. This was so annoying to fix... .