YoshifumiFuyuno / Search-from-Popup-or-ContextMenu

WebExtension
71 stars 7 forks source link

Accelerator keys for all searches #27

Closed cheater closed 2 years ago

cheater commented 2 years ago

For every search, multiple-search group, and subfolder, make it possible to have accelerator keys settable in the search engine options list. Make sure that you warn if multiple searches have the same key, but allow it.

If multiple search engines have the same accel in different contexts, they should not show up the warning. They should peacefully co-exist.

For example, let's say you have the following structure:

SPC
* Options
* Google (M)
* Shopping (sub-folder) (A)
* * eBay (A)
* * Amazon (S)
* * Newegg (D)
* Music (sub-folder) (S)
* * YouTube (A)
* * CDDB (S)

The keys A and S are used multiple times, but that is fine, because they are all used in different contexts.

However, in this case:

SPC
* Options
* Google (A)
* Bing (A)
* DuckDuckGo (A)

You should warn that A is already used elsewhere. When that is done, each of the tabs should be opened (like a multiple-search option).

In the below case, Google and Bing should be opened but not DuckDuckGo:

SPC
* Options
* Multiple Search Start (A)
* Google
* Bing
* Multiple Search End
* DuckDuckGo

In the following case, Google, Bing and DuckDuckGo should all get opened:

SPC
* Options
* Multiple Search Start (A)
* Google
* Bing
* Multiple Search End
* DuckDuckGo (A)

If an accelerator key is already used for an MRU (like in #26), then only open the MRU, and do not open the other search engines that match. Make the warning a different color (eg pink for normal warning vs red for this warning) and change the message and make the warning message bold. But still only make it a warning and not an error.

YoshifumiFuyuno commented 2 years ago

For context menus, this can be achieved by using & in the name. e.g. Google (&M)

cheater commented 2 years ago

That is good to know. It would be good to have this information in the settings UI.