Content-area clicks now dispatch a click event to JS listeners
(addEventListener + inline on* handlers) before performing default
actions. If preventDefault() is called, default actions (link
navigation, form submission, input focus) are suppressed.
Previously only links and submit buttons had click handling; clicks
on <button type="button"> or any other element never reached JS.
Uses a SwapBack RAII guard for the document swap to ensure restoration
on panic. Fixes a dispatching-flag leak where bootstrap() failure
would permanently block future click dispatches.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>