However, when people sometimes write "Firefox is too big and complex to fork", or "nobody has the resources to build a browser", it adds some perspective.
It's not that a browser *has* to do things this way. It *is* possible to be more consistent, reduce complexity, and still do the same thing.
Is cleaning this up feasible? Unlikely. The dependencies that one piece of code has on the behaviour of another is probably too complex to track. I wouldn't want to do that.
Is a greenfield rewrite...