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
221 stars 26 forks source link

[Feature request] : handle links #120

Open ghost opened 6 years ago

ghost commented 6 years ago

Swift Selection Search 3.27.2 / Firefox 62.0.3 (x64) running smoothly.

I'm facing a handicap when it comes to links in which case I have to hover them with the ALT key ("delinkify") to have SSS popup. At this time I use a dedicated extension called Redirect Link with a lot of engines in a similar way to SSL.

For instance, a shortened url link that I wish to check for the true destination by sending it to a site such as CheckShortURL : if SSS would handle links I could check it immediately (given of course the search engine be included in my SSS settings).

Thanks!

CanisLupus commented 6 years ago

Hey! :) So, if I'm understanding this correctly, you'd like SSS to recognize that the text you selected is inside a link and provide search engines or other functions specifically for links. Is that right?

I think this would need code support similar to what is needed for issue #93 (where the copy icon would be one of the options for the link).

What would make sense? To have an option for each individual engine where you could specify that it should only appear for links? (otherwise it appears for general text as usual). I'd like to hear more about your specific use-case if you have other things in mind. :)

Either way, this is so that I can think about what the implementation needs, for whenever I'm able to work on SSS again. Issue #106 is up next. ;)

Cheers! Daniel

ghost commented 6 years ago

Hi @CanisLupus! I conceptualize correctly but I lack to explain accordingly :)

So, if I'm understanding this correctly, you'd like SSS to recognize that the text you selected is inside a link and provide search engines or other functions specifically for links. Is that right?

Not exactly. I'd like to right-click a link (http://example.com) and see the menu item Search for http://example.com With->[engine list] in the context menu.... in fact the very text of the link.

The truth is I had switched to SSS after having been a user of a similar extension, ContextSearch web-ext ... and I faced then the similar drama (!) and related it at the time at https://github.com/ssborbis/ContextSearch-web-ext/issues/11 (I appear as ghost because I had closed my account since then).

As for the way of having links handled by SSS I'd conceive what had been done by ContextSearch web-ext which is to keep the frame as it is (no special category) but to simply consider urls, which would mean of course that the extension be triggered by urls as well as by text but only within the context menu because having the SSS popup on a rightt-click / link doesn't seem suitable. From there on the user would of course have to apply correctly his search engines.

That's the idea. I think it remains an interesting enhancement for SSS, but I'm not the developer of course!

CanisLupus commented 6 years ago

Aaah, I see now. So you'd like SSS to detect right clicks on links and show its context menu for them (while currently it only does so if text is selected).

I didn't understand at first because I tend to think of SSS as primarily the popup and only then the context menu, although some people do prefer the latter. :)

I'll consider this for a future update, it makes a lot of sense.

ghost commented 6 years ago

I prefer the popup personally, I hardly never use SSS via the context-menu. But should the link detection be included in SSS then I'm not sure that right-clicking bringing up the SSS popup would be wise, especially that right-clicking (text, link) is associated to the context-menu... anyway my suggestion, as far as i'm concerned, if it would indeed ease search on links concerns nevertheless a very small minority of my quests which practically always concern text. The suggestion is meant to bring a "plus" and is far from corresponding to a need.

I have in mind this: if SSS would include code that would allow double-clicking (or [key?] + [left|middle|right] click) on a link to bring up the popup then that could be an interesting approach. Of course users would have to check if double-clicking a link is not already handled by one of their scripts or extensions (natively Firefox doesn't).

CanisLupus commented 6 years ago

Yeah, I generally use the popup myself. :) Right clicking to open the popup would indeed create incompatibilities with general browser usage.

By making use of the Alt key to "delinkify" (by the way, I didn't know that was a thing that existed, so thank you ;)), the user could easily select some text on the link and I could implement what I mentioned in my first reply. It would be more complicated, but doable. I'll have to think about these other approaches (probably not double click since it's not very "standard"), but at least the context menu solution for this problem should be simple enough.