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
213 stars 27 forks source link

Pop up doesn't appear if I right click them #224

Open crazyyzarc opened 3 years ago

crazyyzarc commented 3 years ago

Describe the problem When I right click on links, such as https://google.fr , the sss context menu is not displayed. Only if I select the link (text)

How to reproduce the problem SEE 2020-12-15 09_59_59-Amazon URL isn't cleared (#720) · Issues · Kevin R  _ ClearURLs · GitLab

only if select the text: 2020-12-15 10_00_15-Amazon URL isn't cleared (#720) · Issues · Kevin R  _ ClearURLs · GitLab

Anything else you'd like to include A function that detect links and intact with them

System info:

CanisLupus commented 3 years ago

Hi, this is actually in #120 and #179, although your description is clearer due to the images.

SSS actually has code for working on links too, but there's a really dumb reason why I disabled it, which is a bit hard to explain.

By default SSS uses Search for “%s” in the context menu, where %s is the selected text (you can change this default, but 95% of users probably won't touch this setting). Firefox controls this, so it automatically fills %s with the selected text. Keyword being "selected". :)

  1. If you had a text selection somewhere in the page but right clicked a link, it would show the selected text in the context menu, not the link's text. To make sense, the search would respect that as well, searching for the selected text, not the link's. Not completely obvious to the user, but acceptable.
  2. If you had NOTHING selected it would search using the link's text, but the text displayed on the menu would be the literal Search for “%s”, with the %s, which feels really strange and looks like a bug, so I'd get reports about it without being able to fix it.

Since I haven't found a solution for this, I never ended up adding this feature. Maybe there's a way to fix this, but I don't know it right now. :(