<feed xmlns='http://www.w3.org/2005/Atom'>
<title>webao/webAO/dom-events.ts, branch master</title>
<subtitle>WebAO fork</subtitle>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/'/>
<entry>
<title>CSP hardening: remove inline scripts</title>
<updated>2026-06-06T03:09:27+00:00</updated>
<author>
<name>Osmium Sorcerer</name>
<email>os@sof.beauty</email>
</author>
<published>2026-06-06T02:07:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sof.beauty/webao/commit/?id=e0ce108e0806d18353ad85125b2b5f1b1c67e07d'/>
<id>e0ce108e0806d18353ad85125b2b5f1b1c67e07d</id>
<content type='text'>
The next layer after input validaton to achive the paranoid levels of
security. Remove all event handlers inside HTML attributes and add them
in TS for each element, allowing `script-src 'self'` to be used as a CSP
directive.

Buttons that passed some value and had a shared function went into
a global listener with data-action attribute, while all the individual
elements received their own event listener. This is a mess, but my goal
was to end up as close as I could to one-to-one translation of how
functions were originally attached to elements.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The next layer after input validaton to achive the paranoid levels of
security. Remove all event handlers inside HTML attributes and add them
in TS for each element, allowing `script-src 'self'` to be used as a CSP
directive.

Buttons that passed some value and had a shared function went into
a global listener with data-action attribute, while all the individual
elements received their own event listener. This is a mess, but my goal
was to end up as close as I could to one-to-one translation of how
functions were originally attached to elements.
</pre>
</div>
</content>
</entry>
</feed>
