I’m running Firefox 137.0 (firefox-137.0-2.fc41.x86_64 ) on Fedora 41. When opening URLs from the command line (e.g., by typing firefox google.com or xdg-open http://google.com), the URL opens successfully in a new tab, but Firefox doesn’t activate – that is, it does not come to the foreground (and when on another desktop, it does not cause the desktop to switch to the correct one).
That’s interesting. I kind of like this feature (the way it works currently), given that I’m notified by the notification pop-up, and if I want to switch to the browser, I just click on the notification, whereas if I want to switch later, I can continue my work, knowing that the page is open there to be read when appropriate. I think this is caused by the way the XDG Desktop Portal is implemented.
This is also a feature I would like to see in the Newsflash RSS reader. However, according to the comments in this feature request, the developer has used another way of opening URIs, which by default also activates the app opening the URI.
So I guess the way it generally works is by using the XDG Desktop Portal, and in order to make an app open the link directly, one would have to use other means.
I don’t know if the portal can be tweaked by any means, in order to change the open URI behavior.