NumeriusNegidius / Context-Search

A Firefox WebExtension that displays a context menu, that searches for the selected text.
https://addons.mozilla.org/firefox/addon/context-search-we/
Mozilla Public License 2.0
32 stars 9 forks source link

Support for keyword searches without escaping (Capital %S) #40

Closed arend-von-reinersdorff closed 4 years ago

arend-von-reinersdorff commented 6 years ago

Thanks for this great add-on. A worthy successor to SmartSearch.

I have a feature request: Support for keyword searches without escaping the search value (%S syntax with capital S). See mozillaZine - Using keyword searches section "Difference between (small s) %s and (Capital S) %S".

My current usecase is a keyword search for the Internet Archive: Search URL with small s doesn't work: https://web.archive.org/web/*/%s It results in escaped characters and an error message: https://web.archive.org/web/*/https%3A%2F%2Fwww.wikipedia.org

Search URL with capital S behaves correctly for this case: https://web.archive.org/web/*/%S Search value is part of the path and not escaped: https://web.archive.org/web/*/https://www.wikipedia.org Unfortunately, this is currently not supported by Context-Search.

NumeriusNegidius commented 4 years ago

Unless someone steps up, this won't be fixed. Closing this for now.

somini commented 4 years ago

In case anyone wants to take a stab at this, this is the location to do it, it seems:

https://github.com/NumeriusNegidius/Context-Search/blob/ea5fbf15dbfaf4c52132111fefd61c24336c7b25/background.js#L359-L361

I'm guessing making a replacement without the encodeURIComponent function?

There's also other validations that check for %s presence.