edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: "Kevin Carhart" <kevin_carhart@fastmail.fm>
To: edbrowse-dev@edbrowse.org
Subject: trustedTypes
Date: Wed, 20 Oct 2021 00:11:11 -0700	[thread overview]
Message-ID: <de9a3e1e-2d97-46b9-a66c-7cbabc5a860c@www.fastmail.com> (raw)

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])
                        });



                 reply	other threads:[~2021-10-20  7:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de9a3e1e-2d97-46b9-a66c-7cbabc5a860c@www.fastmail.com \
    --to=kevin_carhart@fastmail.fm \
    --cc=edbrowse-dev@edbrowse.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).