CanisLupus / swift-selection-search

Swift Selection Search (SSS) is a simple Firefox add-on that lets you quickly search for some text in a page using your favorite search engines.
https://addons.mozilla.org/firefox/addon/swift-selection-search/
MIT License
215 stars 26 forks source link

Bug: I'm no more able to Ctrl+click an engine icon (as a replacement of middle click) #157

Closed Jackymancs4 closed 4 years ago

Jackymancs4 commented 4 years ago

Describe the problem

Hello @CanisLupus , maybe you remember me from last year!

After upgrading SSS to 3.40.2, my usual workflow got interrupted.

I use a Macbook Pro without mouse (only trackpad), and as such I lack the middle button. With version 3.33, I used to ctrl+click an Engine icon to open a new background tab. But now, the popup instantly disappears on every keydown event.

How to reproduce the problem Steps to reproduce the behavior:

  1. Select some text. The popup spawns.
  2. Press Cmd or ctrl or alt
  3. The popup disappears

The popup should not disappear, allowing me to ctrl+click an icon.

After a little investigation, I found that the regression has been likely introduced in a519e15ee8b21fc506e762691c7e6c6a1931e3a5 , with keydown being a little too aggressive instead of keypress.

I will refrain from making any PR because there are multiple ways of handling this, but please take a look a this because it's driving me crazy..

Thank you!

System info:

Jackymancs4 commented 4 years ago

Ok, I now see that this has been already reported in an unrelated issue here https://github.com/CanisLupus/swift-selection-search/issues/156

Since I see no v3.40.3 code in the repo, and the new release has not been accepted by AMO yet, I will leave this open a little more.

CanisLupus commented 4 years ago

Hi Giacomo, I remember! ;)

You're right, sorry for the trouble. The differences between the keydown event and keypress regarding modifier keys like Ctrl were unknown to me, even though I had fixed a specific case for users of the "Hold Alt" option. Seems I forgot Ctrl+Click!

I've fixed it in the meantime due to another user reporting it in #156 like you said. Now Mozilla reviewers may take a while to review it. Thanks for reporting, since now there's an open issue that people can see if they come here looking for this problem.

We should leave this open until the fix is confirmed. :) The commits are also now pushed as they should.

Cheers!

Jackymancs4 commented 4 years ago

I just locally tested v3.40.3 and the issue appears to be fixed indeed. Thank you!

BTW, you did an incredible job with the text box UI, truly a beautiful result!

CanisLupus commented 4 years ago

Great to hear. :)

Ha! Thank you! The text box is now one of the most useful things in SSS for me. Lots of times I want to search for some text but add something in front to narrow the search. Now it's just there. ;)