On 11/29/17, Warren Young <[email protected]> wrote:
>
> Strict CSP can be a pain, alas.

I have come to notice that myself.  Futhermore, by separating code and
data into separate files, it makes the system more obscure and
difficult to maintain.

There is lots of onclick= and style= happening inside of Fossil.
Apparently what I would need to do is generate HTML without all of the
onclick= and style= attributes, but make sure every element has an id=
attribute.  Then at the bottom generate a big

    <script type="application/json" id="init-data"> ... JSON here ... </script>

Then in the onload handler script, do something like:

    var init_data =
JSON.parse(document.getElementById('init-data').textContent);

Then spin through the init_data JSON adding onclick and style values
to various elements.  Essentially making the init-data a kind of
virtual machine that executes after page load and fixes up the page by
inserting all the attributes I need.

Do I have that right?

-- 
D. Richard Hipp
[email protected]
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to