Closed asger-finding closed 2 years ago
I checked the new devToolsWebContents
based detection but unfortunately it still has the issue of running the fallback code no matter what. And again, if I wait a bit (setTimeout
) before running the detection, it properly detects that I have successfully opened the DevTools. Of course using setTimeout
is not a reliable solution... I wonder how we should handle this. And as I suggested in Discord, I dont mind making a toggle option for fixes like this, if none of our other detection methods work.
Huh, that's strange. It worked for me in the WIn 10 VM. I guess it'll have to be a toggle then. I'm not really familiar with how you guys handle settings, so is that something you're up to doing?
Just for clarification, when you say it uses the fallback method, do you mean that it opens DevTools in a new window no matter what?
If you haven't already, also check that the normal method works
Switched to using setTimeout. It sucks, but it works. I found that it takes 280-300 ms to open devtools the normal way in my VM so I've assigned the setTimeout 500 ms.
The normal openDevTools()
works for me, and by that I mean it works even with all the fallback code removed (I prefer the detached mode so mine opens in that mode). I tested both old and new detection methods but they run the fallback code even when it shouldn't.
To be honest, I think this should be a toggle rather than using setTimeout. It probably would be better if the user only have to toggle the option once rather than having to wait .5 seconds for DevTools to open every time.
Sorry for a lot of requests.
Personally I think this is the better alternative. The timeout only applies to the small minority where this bug occurs, so its really negligible IMO. In my opinion, it's more obtrusive to have an extra setting only dedicated to those with the bug, but which can be toggled on by everyone. Either way, it's your choice, feel free to open a PR on my fork if you want any changes.
Thats a fair point. Unrelated but I think we should revert the Ctrl + R binds, they are too easy to accidentally press (and the reload key is definitely not something you want to accidentally press in this game).
I haven't personally have any problems with it in my client over multiple months, but sure. Maybe if some psycho has crouch bound to Ctrl. Done.
Thank you for your work on this!
Fixes a problem where BrowserWindows would lose their WebContents under certain circumstances in electron < 13.5.0.
Adds missing shortcut navigation for Toggle Devtools, Reload and Reload Without Cache (
F12
,CommandOrControl+R
andCommandOrControl+Shift+R
respectively)Tested in fedora 36. Remains untested in Windows 10/11.