deepjyoti30 / startpage

A minimal starpage for Chrome and Firefox
MIT License
630 stars 86 forks source link

Added Search Engine Config to config.json #4

Closed haideralipunjabi closed 4 years ago

haideralipunjabi commented 4 years ago

The search engine can be customized from config.json now.

"searchEngine":{
    "name": "Google",
    "searchUrl": "https://www.google.com/search?q="
  },

JSON doesn't support comments or I would have commented the config of some other search engines.

deepjyoti30 commented 4 years ago

Hey @haideralipunjabi Thanks for the PR.

I think expecting the URL from the user would not be a good practice since we can already decide that based on the search engine passed by the user.

I would say we should keep the searchEngine value to a string where the user can pass the name of the search engine and we can keep a fallback/default in case the passed engine is not recognized. That would be better since all the user would have to do is pass the name of the engine.

We can hardcode the query URL's for each engine and decide which to use while parsing the data.

haideralipunjabi commented 4 years ago

OK. That is a good idea. I will submit an updated PR soon.