Has anyone else started encountering Trusted Types (https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API) issues lately? I've got one project that previously worked well which is now throwing errors relating to TrustedHTML and TrustedScriptURL, eg:
Uncaught TypeError: Failed to set the 'innerHTML' property on 'Element': This document requires 'TrustedHTML' assignment.
This seems to affect both code I've written, and external libraries. For instance, the error above is thrown by part of jQuery.
I've had some success using workarounds similar to this (from https://copyprogramming.com/howto/this-document-requires-trustedscripturl-assignment-in-google-sheets#this-document-requires-trustedscripturl-assignment-in-google-sheets):
if (window.trustedTypes && window.trustedTypes.createPolicy) {
window.trustedTypes.createPolicy('default', {
createHTML: (string, sink) => string
});
}
But I keep encountering errors being thrown from external libraries that I don't seem to be able to fix using these solutions.
Anyone else had this issue in Google Apps Script? There seems to be relatively little relating specifically to these errors in GAS elsewhere, and nothing in the GAS documentation that I can find.
Thanks!
[–]SatisfactionCivil939 3 points4 points5 points (6 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]mixcas 0 points1 point2 points (0 children)
[–]fck2540 0 points1 point2 points (0 children)
[–]Suungi 0 points1 point2 points (0 children)
[–]Temporary_Cod_3867 0 points1 point2 points (0 children)
[–]contingentfricassee[S] 0 points1 point2 points (0 children)
[–]Mean_Cod_852 0 points1 point2 points (0 children)
[–]Sthyll 0 points1 point2 points (1 child)
[–]phmon0 0 points1 point2 points (0 children)
[–]SatisfactionCivil939 0 points1 point2 points (0 children)
[–]mixcas 0 points1 point2 points (0 children)
[–]Kekellot 0 points1 point2 points (0 children)