aboutsummaryrefslogtreecommitdiff
path: root/webAO/packets/handlers/handleZZ.ts
AgeCommit message (Collapse)Author
4 daysRemove safeTags, decodeChat, and prepChatOsmium Sorcerer
Following the removal of innerHTML manipulation, we no longer need these sanitization functions. I've reviewed every safeTags call site to make sure the outputs don't end up anywhere unsafe, and malicious input can't malipulate DOM or execute code. These values either end up either as plain text (textContent, innerText, createTextNode, title, option) or as a URL path to request assets to the server (encoded using encodeURI). That is, if safeTags was even effective, considering all that function did was replace '<' and '>' symbols with Unicode lookalikes. Even the comment was suggesting the use of fundamentally safer functions instead of these hacks. Replace remaining uses of prepChat with unescapeChat as we still need to do the token substitution (like "<and>" to "&"). decodeChat was escaping Unicode sequences like \uXXXX, but I don't see the reason for this, AO2 Client doesn't have this feature, and considering WebSocket text frames are strictly UTF-8, we don't need these encodings.
4 daysEliminate innerHTML manipulationOsmium Sorcerer
Construct DOM nodes directly instead of trying to sanitize every input string and dynamically updating HTML. Replace all uses of innerHTML with textContent, replaceChildren, and appendChild. This removes the need to use safeTags and replace newlines, but now requires preserving whitespace via CSS pre-wrap. Every OOC chat line is now placed into its own element instead of simply being appended to the log. This might be worse, and createTextNode is another alternative.
2026-02-07Catch rejected play() promises from browser autoplay policyDavid Skoland
Browsers reject .play() with a DOMException when the user hasn't interacted with the document yet. Add .catch(() => {}) to all 9 play() call sites to suppress the uncaught promise rejection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2024-12-13fix modcall newlinesstonedDiscord
2024-11-20Prettified Code!stonedDiscord
2022-09-04Fix AO HostCaleb
2022-08-30Several packets addedCaleb