Last active
March 23, 2025 07:57
-
-
Save jimmywarting/0dfe134f82353ecea8d32b9667d91f7c to your computer and use it in GitHub Desktop.
Revisions
-
jimmywarting revised this gist
Mar 23, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ This is for when you are building a library and csp are in the way and require you to use [trustedTypes](https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API) html ```js var toSafeNode=(h,x=new XMLHttpRequest)=>(x.send(x.open('GET',URL.createObjectURL(new Blob([h])),0)),x.responseXML) -
jimmywarting revised this gist
Mar 23, 2025 . No changes.There are no files selected for viewing
-
jimmywarting revised this gist
Mar 23, 2025 . No changes.There are no files selected for viewing
-
jimmywarting revised this gist
Mar 23, 2025 . No changes.There are no files selected for viewing
-
jimmywarting revised this gist
Mar 23, 2025 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,7 @@ When csp are in the way and require you to use [trustedTypes](https://developer. ```js var toSafeNode=(h,x=new XMLHttpRequest)=>(x.send(x.open('GET',URL.createObjectURL(new Blob([h])),0)),x.responseXML) ``` ```js var fragment = toSafeNode('<div>hej</div>') ``` -
jimmywarting created this gist
Mar 23, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ When csp are in the way and require you to use [trustedTypes](https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API) html ```js var toSafeNode=(h,x=new XMLHttpRequest)=>(x.send(x.open('GET',URL.createObjectURL(new Blob([h])),0)),x.responseXML) ```