File tree 2 files changed +2
-8
lines changed
2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,6 @@ async function openHiddenPreferences(): Promise<boolean> {
222
222
if ( ! isPreferencesOpen ( ) ) {
223
223
document . documentElement . classList . add ( 'hide-preferences-window' ) ;
224
224
225
- const style = document . createElement ( 'style' ) ;
226
- // Hide both the backdrop and the preferences dialog
227
- style . textContent = `${ selectors . preferencesSelector } ._3ixn, ${ selectors . preferencesSelector } ._59s7 { opacity: 0 !important }` ;
228
- document . body . append ( style ) ;
229
-
230
225
await openPreferences ( ) ;
231
226
232
227
return true ;
@@ -661,7 +656,7 @@ async function openPreferences(): Promise<void> {
661
656
}
662
657
663
658
function isPreferencesOpen ( ) : boolean {
664
- return Boolean ( document . querySelector < HTMLElement > ( '[aria-label=Preferences]' ) ) ;
659
+ return Boolean ( document . querySelector < HTMLElement > ( selectors . preferencesSelector ) ) ;
665
660
}
666
661
667
662
async function closePreferences ( ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ export default {
17
17
userMenuNewSidebar : '[role=navigation] > div > div:nth-child(2) > div > div > div:nth-child(1) [role=button]' ,
18
18
viewsMenu : '.x9f619.x1n2onr6.x1ja2u2z.x78zum5.xdt5ytf.x2lah0s.x193iq5w.xdj266r' ,
19
19
selectedConversation : '[role=navigation] [role=grid] [role=row] [role=gridcell] [role=link][aria-current=page]' ,
20
- // ! Very fragile selector (most likely cause of hidden dialog issue)
21
- preferencesSelector : 'div[role=dialog][class="x1n2onr6 x1ja2u2z x1afcbsf x78zum5 xdt5ytf x1a2a7pz x6ikm8r x10wlt62 x71s49j x1jx94hy x1g2kw80 xxadwq3 x16n5opg x3hh19s xl7ujzl x1kl8bxo xhkep3z xb3b7hn xwhkkir xeb55yp x17omtbh"]' ,
20
+ preferencesSelector : '[aria-label=Preferences]' ,
22
21
// TODO: Fix this selector for new design
23
22
messengerSoundsSelector : '._374d ._6bkz' ,
24
23
conversationMenuSelectorNewDesign : '[role=menu]' ,
You can’t perform that action at this time.
0 commit comments