Skip to content

Commit 9be0012

Browse files
ryanbrantonok-edm
andauthored
Add trusted_types.js scriptlet (#194)
* update metadata.json * build dist/resources.json --------- Co-authored-by: Anton Lazarev <[email protected]>
1 parent 246c9ab commit 9be0012

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

dist/resources.json

+1-1
Large diffs are not rendered by default.

metadata.json

+8
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@
7979
},
8080
"resourcePath": "touch-fix.js"
8181
},
82+
{
83+
"name": "trusted_types.js",
84+
"aliases": [],
85+
"kind": {
86+
"mime": "application/javascript"
87+
},
88+
"resourcePath": "trusted_types.js"
89+
},
8290
{
8391
"name": "vaft-ublock-origin.js",
8492
"aliases": [],

resources/trusted_types.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// set-trusted-types.js
2+
function setTrustedTypes() {
3+
if (window.trustedTypes && window.trustedTypes.createPolicy) {
4+
window.trustedTypes.createPolicy("default", {
5+
createScript: string => string
6+
});
7+
}
8+
runAt(() => {}, 'interactive');
9+
}

0 commit comments

Comments
 (0)