kuanyui / EngineSwitcher

A WebExtension let you switch search engine in one click.
https://addons.mozilla.org/en-US/firefox/addon/engine-switcher/
6 stars 2 forks source link

[feature request] add to the context menu #16

Open vitaly-zdanevich opened 8 months ago

vitaly-zdanevich commented 8 months ago

Like this image

Maybe I will try to implement this, if ok.

kuanyui commented 7 months ago

Sounds good, but:

  1. I think this is somewhat out of scope of this extension (After all, this extension is for "one click to switch between engines with the same keyword"). What more important is, there are already multiple WebExtensions are specially designed to do this task, for example, the Trufflepiggy you mentioned? It even provides more and more engines already. (Though, the only reason I can think of is 1. for those who don't want to install too many WebExtensions if possible, 2. FLOSS?)

  2. Don't sure if contextMenu can be hidden via option_ui (I didn't tried before) for those who don't need this feature and don't want the contextMenu too many unused items...? I had ever used only browser.menus.create() before, don't sure if browser.menus.removeAll() can do this. Need some experiment. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus

  3. A last but not the least note, FireFox Android doesn't support browser.menus APIs, need to handle this specially and test on Android. (If my memory serves me right, something like if (browser.menus !== undefined) { /* setup menus... */ })