edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* trustedTypes
@ 2021-10-20  7:11 Kevin Carhart
  0 siblings, 0 replies; only message in thread
From: Kevin Carhart @ 2021-10-20  7:11 UTC (permalink / raw)
  To: edbrowse-dev

This is what I have so far for the trustedTypes API.  There may be issues but here's what I came up with.

trustedTypes = function(){};
trustedTypes.createPolicy = function(pn,po){
var x = new Object;
x.policyName = pn;
if (po['createHTML'])
x.createHTML = po['createHTML'];
if (po['createScript'])
x.createScript = po['createScript'];
if (po['createScriptURL'])
x.createScriptURL = po['createScriptURL'];
return x;
}

This is the code that uses it in the recaptcha library.  Later code will expect to be able to get those callback names and run them.

                if (B = O, (u = G.trustedTypes) && u.createPolicy) {
                    try {
                        B = u.createPolicy('goog#html', {
                            createHTML: a[W].bind(v[0], A),
                            createScript: a[W].bind(v[0], v[2]),
                            createScriptURL: a[W].bind(v[0], v[1])
                        });



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-20  7:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20  7:11 trustedTypes Kevin Carhart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).