You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The page https://www.suewag.de/privatkunden uses custom elements to an extreme. From the DOM root almost no text is visible, it is all hidden inside the shadow roots of the custom elements.
Example script to actually get all the text on the page (and a bit more because it doesn't differentiate between things like <div>, <custom-element> and <script>)
Similarly, the InPageTranslation class would need to be updated to be aware of shadowRoot. I'm not sure whether DOM mutations propagate from shadowRoot to the parent fragment or eventually the document.body tree?
Ideally, we could use the accessibility tree directly to figure out text and translate that. That should contain all text that is relevant to translate, if pages are properly accessible. It is also something creators of custom elements can easily design for. But unfortunately nothing like that is being shipped yet.
The page https://www.suewag.de/privatkunden uses custom elements to an extreme. From the DOM root almost no text is visible, it is all hidden inside the shadow roots of the custom elements.
Example script to actually get all the text on the page (and a bit more because it doesn't differentiate between things like
<div>
,<custom-element>
and<script>
)Similarly, the
InPageTranslation
class would need to be updated to be aware of shadowRoot. I'm not sure whether DOM mutations propagate from shadowRoot to the parent fragment or eventually the document.body tree?Ideally, we could use the accessibility tree directly to figure out text and translate that. That should contain all text that is relevant to translate, if pages are properly accessible. It is also something creators of custom elements can easily design for. But unfortunately nothing like that is being shipped yet.
There is the Accessibility Object Model, Phase 4 Draft which could be promising some day.
The text was updated successfully, but these errors were encountered: