SusiMail compose-window unload guard. Prevents accidental navigation away from the compose page by prompting the user before unload, unless a form submission button has been clicked.
SusiMail
SusiMail
compose
deleteMail
I2P+ SusiMail delete-mail modal handler. Ensures the delete-mail confirmation modal is correctly positioned and visible on instantiation, with iframe-aware viewport calculations and a MutationObserver for cleanup on removal.
folder
SusiMail folder view button handlers. Manages delete, select-all, clear-selection, and row-click interactions in the mail folder list view.
HtmlSanitizer
Client-side HTML sanitizer for preventing XSS in user-generated content. Uses DOMParser for browser-native, fast parsing with allowlist approach.
htmlView
SusiMail HTML view handler. Manages toggle-view buttons for switching between text and HTML mail views, and applies fallback CSS styling inside the HTML iframe.
markdown
SusiMail Markdown renderer. Converts Markdown-formatted mail bodies into HTML. Supports: CommonMark + GFM (tables, strikethrough, task lists, fenced code lang). Self-contained, no external dependencies.
Security model:
- Renderer emits only a fixed set of whitelisted HTML tags.
- All link URLs pass through scheme allowlist (http:, https:, mailto:).
- All text content is HTML-escaped before output.
Security note: initMarkdown() expects mailbody elements to contain plain text markdown. Do not pre-populate with HTML. For defense-in-depth, consider post-processing output with DOMPurify if handling untrusted third-party input.
notifications
SusiMail notification handler. Auto-removes empty notification elements and adds a click-to-dismiss handler for notification banners.
previewMail
SusiMail message preview on hover. Displays a floating preview popup when hovering over mail subject links in the folder list, with caching, timeout handling, and theme-aware styling.
refreshInbox
I2P+ SusiMail inbox refresher. Performs AJAX polling to refresh the mailbox view and notification elements without a full page reload. The "Refresh Page" button also triggers an immediate fetch on click.
sanitizeHTML
SusiMail HTML sanitizer and display fixer. Addresses layout and security issues in iframed HTML messages: removes !important declarations, normalises div margins, blocks remote images, and surfaces blocked-image/web-bug counts.
toggleHeaders
SusiMail toggle-headers utility. Provides expand/collapse controls for showing or hiding debug email headers in the message view.