Changeset f7d142f in Klonkt for src/views/pages/admin-sites.ejs


Ignore:
Timestamp:
06/28/2026 03:36:22 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
81bb9c5
Parents:
127f87e
Message:

chore(csp): drop the last script unsafe-inline + add Permissions-Policy

Move every inline on* handler to a shared delegated data-* handler, so script-src-attr
can be 'none' instead of 'unsafe-inline'. Add a Permissions-Policy header disabling
camera/microphone/geolocation/Topics (embed features left at default).

  • views/shell.ejs — shared delegated submit/change/click/error handler (data-confirm, data-autosubmit, data-lang-switch, data-selectall, data-back, data-fallback)
  • views/{pages,partials}/*.ejs — 18 inline on* handlers -> data-* attributes (14 files)
  • server.js — scriptSrcAttr 'unsafe-inline' -> 'none'; Permissions-Policy header
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/admin-sites.ejs

    r127f87e rf7d142f  
    9393            <% if (!s.is_primary && (typeof canMutate === 'undefined' || canMutate)) { %>
    9494              <form method="post" action="/admin/sites/<%= s.slug %>/make-primary" style="margin:0;display:inline"
    95                     onsubmit="return confirm('<%= _s_makeprim_c %>')">
     95                    data-confirm="<%= _s_makeprim_c %>">
    9696                <button type="submit" class="ax-icon-btn" aria-label="<%= _s_makeprim %>" title="<%= _s_makeprim_t %>">★</button>
    9797              </form>
     
    9999            <a href="/admin/sites/<%= s.slug %>/edit" class="ax-icon-btn" aria-label="<%= _s_edit %>" title="<%= _s_edit %>">✎</a>
    100100            <form method="post" action="/admin/sites/<%= s.slug %>/delete" class="ax-delete-form"
    101                   onsubmit="return confirm('<%= _s_del_c %>')">
     101                  data-confirm="<%= _s_del_c %>">
    102102              <button type="submit" class="ax-icon-btn ax-icon-btn-danger" aria-label="<%= _s_del %>" title="<%= _s_del %>">🗑</button>
    103103            </form>
Note: See TracChangeset for help on using the changeset viewer.