Skip to content

Improve the simulator live region#11275

Open
microbit-robert wants to merge 1 commit intomicrosoft:masterfrom
microbit-matt-hillsdon:sim-live-region
Open

Improve the simulator live region#11275
microbit-robert wants to merge 1 commit intomicrosoft:masterfrom
microbit-matt-hillsdon:sim-live-region

Conversation

@microbit-robert
Copy link
Copy Markdown
Contributor

@microbit-robert microbit-robert commented Apr 20, 2026

The live region is re-created if required. There is code in the sim that can clear the DOM.
The same message can be announced more than once with the addition (toggling) of a non-breaking space.

The live region is re-created if required. There is code in the sim that
clears the DOM.
The same message can be announced more than once with the addition of a
non-breaking space.
Comment thread pxtsim/accessibility.ts
liveRegion.textContent = value;
if (value) {
/* eslint-disable @microsoft/sdl/no-inner-html */
liveRegion.innerHTML = `<p>${value}${addNonBreakingSpace ? '&nbsp;' : ''}</p>`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not use innerhtml here.. are we certain that everything being passed to this function is sanitized? if someone were to, say, pass a malicious string with html into our localization pipeline somehow would they be able to inject some code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants