Automatic Tests fail with chrome >= 120 #906
Labels
bug
Something isn't working
ci/cd
maintenance
Code refactoring, project structure, dev tooling (storybook, dev server, npm tasks...)
Context
With chrome >= 120, the
i18n-sanitize
tests fail.Explanation
Tests fail because the sanitize function adds `target` and `rel` attributes on the sanitized anchor element while it did not with previous chrome versions.The
sanitize
function tests if the origin of the sanitized link (node.origin
) equalswindow.location.origin
.If origins are different, it adds the
target="_blank"
andrel="..."
attributes.It looks like
node.origin
for a sanitized link with<a href="/foo">toto</toto>
now results in an empty string while it resulted tohttp://localhost...
(or whatever) before.It only happens with anchor elements inside a document fragment, which is what the
sanitize
function returns.How to reproduce the root cause of the issue?
The text was updated successfully, but these errors were encountered: