-
-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hide-preferences-window
Preventing Preferences Window from Opening
#2265
Comments
We shouldn't be required to remove the class manually using a Web Dev Tools hack. This issue should be resolved. From what I know, Caprine uses Chromium engine to render the Messenger app. I have no idea why the class isn't removed properly, it should work flawlessly in Chromium. |
If Caprine was only displaying the Messenger website, this would not be an issue. The |
I'm wondering if users have different interface versions. If someone is still having this issue on v2.60.3, could you run the following steps? Open messenger.com and open the preferences window (remove If it returns an empty list, that would explain why If this is an issue where users are getting different versions of the back-end, it's going to be more complicated to implement, but not sure if that's the case yet. |
Also affects me. Yep, the selector properly finds the div for the preferences dialog in a brave window (chromium based). However, I definitely see this every time in caprine on ubuntu (have for a long time now). I always just do the hack to get it working if I restart caprine. But, it is annoying. Perhaps this is a race condition between searching for the div and the preferences window actually being displayed? |
Windows 11, 2.60.3. Empty list when prefs dialog is closed; the elements match when the prefs dialog is opened: while opened:
|
I imagine it should be empty while preferences is closed if this is intended to search for the preferences window. Where in the code is this? I was going to see if I could find a race condition, but when searching for https://github.com/search?q=repo%3Asindresorhus%2Fcaprine+document.querySelectorAll&type=code |
Nvm, I found it: Line 222 in 2ba6371
|
Line 766 in 2ba6371
Nah, nevermind. Must be happening in parallel somewhere. Not sure why the operation that's triggering it isn't breaking on the DOM modification. |
For my case, this line runs which adds the class (presumably to change mute notifications): Line 249 in 2ba6371
But, the corresponding line to close preferences here is never run: Line 667 in 2ba6371
So, the class is never removed and when I manually remove the class the preferences window is, in fact, still open. Which is what blocks many things (I can't scroll back history, blah, blah, blah). If I can figure out why I'll submit a PR. Though, it's a little hard debugging this. I'm not familiar with debugging Electron apps. It thankfully does show source code when I hit DOM breakpoints, but I'm not actually sure how I can make code edits that aren't blown away with a refresh. If I can figure out the broken code path I'll see if I can just build it locally and run it. |
Turns out debugging an electron app is basically the same as any node app. :-P I couldn't reproduce this when running locally, but can reproduce it every time in the production app. The call here never returns: Line 654 in 2ba6371
It gets to that line, but then never gets here after the Line 227 in 2ba6371
What I noticed in the production app is that the selector is different. It looks like this: That is NOT in the DOM based on Running locally the class is as you stated above @mquevill. And, that's in the DOM so gets removed. It looks like that selector was only just changed 3 weeks ago by you @mquevill. Turns out I don't have auto-update for this app since it's just installed from a deb so I tried grabbing the latest (2.60.3) and installing it. That didn't work. BUT, I looked in "About Caprine" and it shows 2.60.1. So...that's weird. I did an I do notice the comment about the selector being very fragile. It might be nice to have an option to NOT have hidden preferences. Honestly, I could care less if it pops up a settings window for a second to change a setting if it avoids stuff like this. I'm happy to submit a PR if there's interest and I can figure it out. Christmas vacation just started for me so I have a little free time. |
It's still broken with a locally generated deb with Any ideas on why this seems to persist even after update. Is there JS cached somewhere that's being used instead of the latest code? |
Figured it out. I had an older flatpak version installed that was getting used instead of the apt version. Purged them both and killed the configs for the deb (in On first open it incorrectly left So, in summary, to fix I'd recommend:
I'm gonna see how hard it is to add an option to bypass the whole hidden settings thing (it can be off by default). I don't feel like it's worth the hassle. |
PR here for new setting: #2269 |
As mentioned in #1983, the
hide-preferences-window
class is not being removed as expected.This issue persists, preventing the Preferences window from appearing. As a result, users cannot
access settings or the "Restore Messages" popup.
Steps to Reproduce:
Expected Behavior:
The Preferences window should appear when accessed, allowing users to adjust settings
or restore messages.
Actual Behavior:
The Preferences window does not appear due to the
hide-preferences-window
class being incorrectly applied.Temporary Workaround:
Users can manually remove the
hide-preferences-window
class using the following steps:hide-preferences-window
class.This workaround allows the Preferences window to appear but is not an ideal solution.
Environment:
Tested Operating Systems:
Additional Context:
This issue remains unresolved despite being flagged previously. A permanent fix to remove
or manage the
hide-preferences-window
class properly is needed.The text was updated successfully, but these errors were encountered: