Thanks for your PR. Unfortunately it doesn’t work the way I imagined, but I guess that’s because I didn’t exactly describe the behavior I wanted. I’ll clarify it:
Expected behavior: When I press Ctrl+F the second time, the Discourse search window should close automatically and the browser’s search window should be visible and have focus.
Current behavior without the PR: When I press Ctrl+F the second time, the Discourse search window stays open and the browser’s search window is visible and has focus.
Behavior with the PR: When I press Ctrl+F the second time, the Discourse search window closes, but there is now browser search window.