A better solution would be to make webgl, webgpu and (especially) webrtc have some sort of prompt before they can be in any way used in that fashion, but this will absolutely destroy web ux Windows Vista style.
Even simply changing the user agent was sabotaged at Firefox, and choosing one user agent per domain is wishful thinking.
And then legislation required those consent boxes back, so everyone built their own, instead of demanding that the default should be changed back.