evilpie / add-custom-search-engine

Add a custom search engine to the list of available search engines in Firefox
https://addons.mozilla.org/en-US/firefox/addon/add-custom-search-engine/
Mozilla Public License 2.0
173 stars 13 forks source link

Check if search name is available #31

Closed dccoder84 closed 3 years ago

dccoder84 commented 3 years ago

I wondered why I cannot add eBay as a search engine. Turns out the name was already used internally some way even if I hadn't installed an eBay search. So "ebay" instead of "eBay" as search name worked but it would be nice if the user could get some type of feedback otherwise this is quite confusing. Tested with Firefox 84.0.2.

evilpie commented 3 years ago

Good idea. I think we should be able to do this with search.get. So far I have resisted doing this because it requires adding a new permission.

dccoder84 commented 3 years ago

If you need inspiration how to code this you can have a look at how Firefox itself implemented it. The GUI has to be enabled and is behing a flag under about:config. You have to set the variable browser.urlbar.update2.engineAliasRefresh to true then you will see an additional "Add" button add the bottom of about:preferences#search. If you click this button you will get a dialogue which is similar to you addon. The "add search enginge" button within the dialogue will grey out if the search engine name is already available. The best thing would be if somebody provides a patch so that this dialogue will also have an option to set an icon. Then your addon wouldn't be that important anymore. Of course your addon still has more options and would still be useful d-(' ' d-).

dccoder84 commented 3 years ago

Cool, thank you very much :)

dccoder84 commented 3 years ago

Sorry but it doesn't work correctly. I can still type "eBay" without getting a feedback. And in the URL-Bar-Three-Dots-Dropdown-Menu there won't be an entry "Add Search Engine" then.

evilpie commented 3 years ago

@dccoder84 Is it possible that you have that search engine installed but hidden? i.e. no blue in about:preferences#search.

dccoder84 commented 3 years ago

I don't know what's the problem but everything works fine when using a fresh profile and a new Firefox installation.