I'm not 100% sure if this is considered too invasive or not (it's not *that* complicated though), but I'd still like a review regardless because it would simplify my jscript-mshtml CC integration patches I have for Proton now, and I'd like an extra pair of eyes to know if there's something very obviously wrong or I'm missing.