Created
May 21, 2023 19:17
-
-
Save dptole/2556c7d52161a0b785b8321070a11644 to your computer and use it in GitHub Desktop.
Bypass "This document requires 'TrustedScript' assignment" error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This document requires 'TrustedScript' assignment | |
https://greasyfork.org/en/scripts/433051-trusted-types-helper | |
*/ | |
var html = '<p>ok</p>' | |
trustedTypes.createPolicy('default', { | |
createHTML: function (string, sink) { return string } | |
}) | |
var $d = document.createElement('div') | |
var $d.innerHTML = trustedTypes.defaultPolicy.createHTML(html) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment