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

New lines in a search term #261

Closed tehkonst closed 3 weeks ago

tehkonst commented 1 month ago

I have a small question. Is it possible to send a search term with new lines inside for websites like Google Translate?

tehkonst commented 1 month ago

I found out that new lines remain in a search term when I use the context menu. And they disappear when I use the popup form. So I guess it's a bug.

CanisLupus commented 3 weeks ago

Hi! Sadly you are right, this is a limitation of SSS. The issue is known and listed here: https://github.com/CanisLupus/swift-selection-search/issues/228

The context menu gets the selected text through the WebExtensions API (so it works properly), while the page's text selection must be acquired through other means. I think that last time I checked I found it wasn't trivial to get the lines separated, and was afraid of getting some edge cases like text and images selected together. I could be misremembering!

CanisLupus commented 3 weeks ago

I'll close this since #228 exists, but yes, it's still an issue. Cheers!