Fingerprinting works by collecting bits of information about the browser and device to identify users. Couldn’t browsers like Firefox see when a website gets such info with JS and either prevent or ask permission from the user for the website to make HTTP requests to upload such information to the website. Idk if they do something like this already.
No defense is perfect, of course. To prevent client-side code from running, you can always install NoScript.
Privacy is an endless treadmill, though; they are always finding new ways to get around protection. You may get a good level or privacy with the right tools, but it will also be super inconvenient.