sindresorhus/electron-context-menu

Add other search engines

vraravam opened this issue · 4 comments

As security-minded person, it would be good to allow searching by other search engines eg DuckDuckGo.
If using DDG, the url is of the form: https://duckduckgo.com/?q=${searchTerm}

Other users I have seen also use Bing in some cases.

I see that there's already #151 which was closed with the comment that it won't be enhanced for other search engines. Closing this ticket.

However, I am willing to add a generic "search" menu item. It's up to the developer to provide a title and URL with the query syntax used in Chrome: https://support.google.com/chrome/answer/95426?hl=en&co=GENIE.Platform%3DDesktop - #151 (comment)

However, I am willing to add a generic "search" menu item. It's up to the developer to provide a title and URL with the query syntax used in Chrome: https://support.google.com/chrome/answer/95426?hl=en&co=GENIE.Platform%3DDesktop - #151 (comment)

@sindresorhus - yes, I think that would be a good idea for the developer to provide the name and url/format of the search engine. I assume this will also take into account the i18n?

Hoping to take a crack at this. Just wanted to check if adding an object type option, like below, would be ok? It seems to work but not sure if it's the preferred way (still relatively new to javascript).

addSearchWithOther: 
	{
		title: 'DuckDuckGo',
		url: 'https://duckduckgo.com/?q=%s'
	}

Also, still deciding on the name. Willing to change to showSearchWithOther, showOtherSearchEngine, or anything else, just wasn't sure if it might be confusing with all of the other options prefixed with show... being booleans but maybe it'll be clear enough with the readme and TS types file?