Skip to content

Instantly share code, notes, and snippets.

@lydemann
Last active April 15, 2021 18:41
Show Gist options
  • Select an option

  • Save lydemann/21eb094e631739b5443862804549ae8c to your computer and use it in GitHub Desktop.

Select an option

Save lydemann/21eb094e631739b5443862804549ae8c to your computer and use it in GitHub Desktop.
const escaped = custompolicy1.createHTML('<img src=x onerror=alert(1)>');
console.log(escaped instanceof TrustedHTML); // true
el.innerHTML = escaped; // '<img src=x onerror=alert(1)>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment