How does Google Translate break SPAs?

Development31 oct 2026

Google Chrome has the auto-translate feature. I always thought it just replaces the text content of the text nodes. So for most of the apps it would be harmless. I was mistaken. It wraps the text nodes with a <font/> tag:

// Before
<div>Museo de Arte</div>
// After
<div>
  <font dir="auto" style="vertical-align: inherit;">
    Art Museum
  </font>
</div>

The original text node becomes detached. So SPA engines like React, Angular, Vue get into a broken, unpredictable state.

Why do they do it? Probably to be able to untranslate it on demand.