This is how I do it:
Firefox - Add environment variable to enable Wayland Hardware Acceleration in Firefox and Thunderbird
To makes sure Firefox is using Wayland for Hardware Acceleration you can add the environment variable “MOZ_ENABLE_WAYLAND=1”.
In EndeavourOS:
(1) Make the environment directory:
mkdir ~/.config/environment.d
(2) Create the envvars.conf:
nano ~/.config/environment.d/envvars.conf`
(3) Add the following line to the ~/.config/environment.d/envvars.conf file:
MOZ_ENABLE_WAYLAND=1
(4) Reboot
(5) Launch Firefox and verify Windows Protocol is set to ‘Wayland’:
(a) Navigate to “about:support”`
(b) Look for “Windows Protocol” = wayland `
Source: