Would they be able to enforce this on Firefox or other browsers?
They'll have to interpolate the ads into the stream. Then people will code clients that detects the ads and black them and mute them. Then YouTube will learn how that works and will change their ads not to trigger detection. Etc. This is called an arms race.
There are apps for this, and dozens of similar ones for all sorts of video players. I personally use SVP's because I already own it.
I think they mostly use youtube-dl under the hood to fetch the video URL, so that is a significant point of failure.