@Esanders thinks that we can prevent browser extensions from inserting junk into the page HTML that gets saved. Currently, we try to filter it out after it is inserted, based on a long list of rules for each one we've discovered (see T54327, occasionally updated e.g. T297862).
Ed: Aside from this being a never ending of task of whack-a-mole with an unlimited number of browser extensions and versions, we also risk removing real content. Right now a MediaWiki document is unlikely to contain content that matches these selectors, but as the list grows the chances of this happening increase.