I was probably fooled by my OLED monitor. I thought YouTube didn’t show the HDR label simply because they didn’t like Firefox, but after comparing, I found that Firefox indeed doesn’t support displaying HDR videos.
Firefox doesn’t support wide color gamut in HDR mode and can’t display HDR photos correctly, yet it can play HDR videos on YouTube — which is quite strange.