Repository navigation
Conversation
…an extension) follow the app's changes, also when replaced before hydration; no start on a copy of the page served from another origin
sfisol
force-pushed
the
updated-text-refresh
branch
from
November 3, 2026 14:45
4301878 to
07f120e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status: parked — planned, but postponed for now
Following the review, this stays as a draft and isn't meant for merging in its current form. The problem is real, but the solution here is too specialized to live in the core as it is. Below is a summary to come back to.
The problem
Page translators replace the app's text nodes with nodes of their own. These include the one built into Chrome and Edge, Firefox's full-page translation, translating proxies, and some extensions. Chrome, for example, puts a
<font>element in place of each translated text. The app keeps references to the original text nodes, which are no longer in the page. That leads to three things:<base>points back to the original site. The app would request its data from there, which the browser doesn't allow, while its links stay with the copy.Nothing crashes: every DOM command is wrapped and reports its own failure.
What this branch does
MapNodesuses aMutationObserverto track nodes that something else put in place of the app's texts. An updated text goes in as a new node where the stand-in is, so the translator picks it up again.<font>or any other translator-specific markup.<base>points to another origin.Why it's postponed
Other frameworks don't special-case translators in their core either:
In the meantime, an app can handle the foreign-copy case on its own. A
<script type="module">in<head>runs before the loader and can removedata-vertigo-run-wasmwhendocument.baseURIhas a different origin. In-browser translation remains a known limitation.Possible ways forward
Each of these is generic and not tied to translators:
CharacterData.datainstead oftextContent. DOM-level shims such as translation-resilience intercept thedataandnodeValuesetters but nottextContent. With this one-line change, an app could opt into such a shim without anything in vertigo.