const html = policy.createHTML("<div>");
console.log(trustedTypes.isHTML(html)); // true;
const fake = Object.create(TrustedHTML.prototype);
console.log(trustedTypes.isHTML(fake)); // false
console.log(trustedTypes.isHTML("<div>plain string</div>")); // falseTrustedTypePolicyFactory: isHTML() method / notebook
TrustedTypePolicyFactory: isHTML() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.