Also removing the environment variable from thunderbird via gdb before clicking a link in an email will make firefox behave correctly, and starting firefox by
env MOZ_APP_LAUNCHER=/usr/bin/pluma firefox will make firefox want to set pluma.desktop as default browser :)