fix(messenger): unread badge for facebook.com/messages and messenger-only accounts - #743
Open
nexxai wants to merge 1 commit into
Open
fix(messenger): unread badge for facebook.com/messages and messenger-only accounts#743nexxai wants to merge 1 commit into
nexxai wants to merge 1 commit into
Conversation
…nd facebook.com/messages Reverts serviceURL to https://messenger.com to fix login for messenger-only accounts (fixes ferdium/ferdium-app#2397) and restores unread counting that broke after moving to facebook.com/messages (fixes ferdium/ferdium-app#2416). On facebook.com/messages the thread list does not expose unread via the old messenger.com selectors. The new webview: - fixes crash where querySelector(...).ariaLabel threw on null - supports both /t/ and /messages/t/ prefixes (and requests/marketplace) - adds facebook.com/messages detection via [data-testid="mwthreadlist-item"] with unread indicators (.is6700om, .lrazzd5p, .o48pnaf2 etc.) - keeps legacy .bp9cbjyn fallback for messenger.com - adds generic aria-label and document.title fallbacks - handles message-requests via additional selectors - wraps counting in try/catch so loop never breaks Bump version 1.8.6 -> 1.8.7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-flight Checklist
Please ensure you've completed all of the following.
Description of Change
Moving
serviceURLtohttps://facebook.com/messages(1.8.6) broke the unread badge —a[href^='/t/'][role='link']no longer matches/messages/t/andquerySelector(...).ariaLabelthrows onnull, abortinggetMessages()beforeFerdium.setBadge(). It also broke login for messenger-only accounts with no Facebook profile.Fix: revert
serviceURLtohttps://messenger.comand makewebview.jshandle both hosts. Fixes null crash with optional chaining, adds/messages/t/and/messages/requests/t/prefixes, addsfacebook.com/messagesdetection via[data-testid="mwthreadlist-item"](is6700om/o48pnaf2/lrazzd5p) plus generic[aria-label*="unread"]anddocument.title(N)fallback, and keeps legacy.bp9cbjynpath. Bothmessenger.comandfacebook.com/messages(if user sets custom URL) now count correctly.Bumped to 1.8.7. Verified locally via hot-patch in
~/Library/Application Support/Ferdium/recipes/messenger/(badge 0→1 after receiving message) andpnpm lint:fix && pnpm reformat-files && pnpm packagepasses (438 recipes, 0 failures).Closes ferdium/ferdium-app#2416