Skip to content

Commit

Permalink
Use preferences window class info instead of aria-label (#2257)
Browse files Browse the repository at this point in the history
  • Loading branch information
mquevill authored Dec 1, 2024
1 parent 6754597 commit 6f7c3ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion source/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ async function observeTheme(): Promise<void> {
observerNew.observe(menuElements, {childList: true});
}

// Attribute notation needed here to guarantee exact (not partial) match.
const modalElements = await elementReady(selectors.preferencesSelector, {stopOnDomReady: false});
if (modalElements) {
observerNew.observe(modalElements, {childList: true});
Expand Down
3 changes: 2 additions & 1 deletion source/browser/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default {
userMenuNewSidebar: '[role=navigation] > div > div:nth-child(2) > div > div > div:nth-child(1) [role=button]',
viewsMenu: '.x9f619.x1n2onr6.x1ja2u2z.x78zum5.xdt5ytf.x2lah0s.x193iq5w.xdj266r',
selectedConversation: '[role=navigation] [role=grid] [role=row] [role=gridcell] [role=link][aria-current=page]',
preferencesSelector: '[aria-label=Preferences]',
// ! Very fragile selector (most likely cause of hidden dialog issue)
preferencesSelector: '.x1n2onr6.x1ja2u2z.x1afcbsf.x78zum5.xdt5ytf.x1a2a7pz.x6ikm8r.x10wlt62.x71s49j.x1jx94hy.x1g2kw80.xxadwq3.x16n5opg.x3hh19s.xl7ujzl.x1kl8bxo.xhkep3z.xb3b7hn.xwhkkir.x1n7qst7.x17omtbh:has(.x1l90r2v.x1swvt13.x1pi30zi)',
// TODO: Fix this selector for new design
messengerSoundsSelector: '._374d ._6bkz',
conversationMenuSelectorNewDesign: '[role=menu]',
Expand Down

0 comments on commit 6f7c3ec

Please sign in to comment.