Skip to content

Fix Trusted Types violations (round #2) #106395

@jrieken

Description

@jrieken

Continuation of #106285 and part of the TrustedTypes effort (see #103699). To get a list of violations

  • run yarn tsec-compile-check

Or, get the list of violations from edge/chrome directly

Also, there is .vscode/searches/TrustedTypes.code-search which finds all occurences of innerHTML. There are common sources of violation and therefore common fixes

  • styling via style.innerHTML ➡️ use textContent instead (example c112f84)
  • clear a node via node.innerHTML = '' ➡️ use dom.ts#clearNode or node.innerText = ''
  • building dom nodes ➡️ use dom.$ or document.createElement and friends

Metadata

Metadata

Labels

engineeringVS Code - Build / issue tracking / etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions