From 83208227feee58630f0a9a306bacdff66b47b760 Mon Sep 17 00:00:00 2001 From: commiekong <30882689+dfsm@users.noreply.github.com> Date: Mon, 27 Apr 2026 11:11:02 +1000 Subject: [PATCH] Hide Post Metadata from Screen Reader: New setting that adds aria-hidden to usernames, join dates, post actions, posted dates. Thread title, post contents, quotes are all read aloudwhile additional elements are dropped. Two-finger pull from top brings up Screen Reader. Will also apply to Voiceover if the setting is enabled, but Voiceover remains unaffected otherwise. Requested: https://forums.somethingawful.com/showthread.php?noseen=1&threadid=3837546&pagenumber=216&perpage=40&highlight=swipe,down#post548636993 --- App/Resources/RenderView.js | 17 +++++++++++++++++ App/Templates/Post.html.stencil | 3 ++- .../Posts/PostRenderModel.swift | 8 +++++++- .../Posts/PostsPageViewController.swift | 7 +++++++ App/Views/RenderView.swift | 11 +++++++++++ .../Sources/AwfulSettings/Settings.swift | 3 +++ .../AwfulSettingsUI/Localizable.xcstrings | 8 +++++++- .../Sources/AwfulSettingsUI/SettingsView.swift | 5 +++++ 8 files changed, 59 insertions(+), 3 deletions(-) diff --git a/App/Resources/RenderView.js b/App/Resources/RenderView.js index be9baec7f..e5773ccf8 100644 --- a/App/Resources/RenderView.js +++ b/App/Resources/RenderView.js @@ -1611,6 +1611,23 @@ Awful.setShowAvatars = function(showAvatars) { }; +/** + Toggles aria-hidden on post metadata so iOS Spoken Content / VoiceOver skips usernames, regdates, and post dates. + + @param {boolean} hide - `true` to mark the post header and post date as aria-hidden, `false` to restore them. + */ +Awful.setHidePostMetadataForReader = function(hide) { + var els = document.querySelectorAll('post > header, post > footer'); + Array.prototype.forEach.call(els, function(el) { + if (hide) { + el.setAttribute('aria-hidden', 'true'); + } else { + el.removeAttribute('aria-hidden'); + } + }); +}; + + /** Updates the stylesheet for the currently-selected theme. diff --git a/App/Templates/Post.html.stencil b/App/Templates/Post.html.stencil index 2c41feb82..bfe40a3db 100644 --- a/App/Templates/Post.html.stencil +++ b/App/Templates/Post.html.stencil @@ -7,6 +7,7 @@