| // https://github.com/wicg/trusted-types |
| |
| typedef [StringContext=TrustedHTML] DOMString HTMLString; |
| typedef [StringContext=TrustedScript] DOMString ScriptString; |
| typedef [StringContext=TrustedScriptURL] USVString ScriptURLString; |
| |
| [ |
| Exposed=(Window, Worker), |
| SecureContext |
| ] interface TrustedHTML { |
| stringifier; |
| }; |
| |
| [ |
| Exposed=(Window, Worker), |
| SecureContext |
| ] interface TrustedScript { |
| stringifier; |
| }; |
| |
| [ |
| Exposed=(Window, Worker), |
| SecureContext |
| ] interface TrustedScriptURL { |
| stringifier; |
| }; |
| |
| [ |
| Exposed=(Window, Worker), |
| SecureContext |
| ] interface TrustedTypePolicyFactory { |
| TrustedTypePolicy createPolicy(DOMString policyName, optional TrustedTypePolicyOptions policyOptions = {}); |
| // All the policy object names that have been created |
| }; |
| |
| [ |
| Exposed=(Window, Worker), |
| SecureContext |
| ] interface TrustedTypePolicy { |
| readonly attribute DOMString name; |
| TrustedHTML createHTML(DOMString input); |
| TrustedScript createScript(DOMString input); |
| TrustedScriptURL createScriptURL(USVString input); |
| }; |
| |
| dictionary TrustedTypePolicyOptions { |
| CreateHTMLCallback createHTML; |
| CreateScriptCallback createScript; |
| CreateURLCallback createScriptURL; |
| }; |
| |
| callback CreateHTMLCallback = DOMString (DOMString input); |
| callback CreateScriptCallback = DOMString (DOMString input); |
| callback CreateURLCallback = USVString (DOMString input); |