Does safari has an extension like this Chrome extension called Context Menu Search? It enables user to search highlighted text from the context menu.
I needed something similar too!
So look up: CustomSearch. It's highly adaptable by using the integrated CustomSearch Entry Editor.
"CustomSearch allows you to easily send the selected text to one of up to eight search engines — right from the toolbar or a contextual menu. CustomSearch includes search entries for Wikipedia, Google, Bing, and Amazon."
Not at the Safari-level, but on MacOS one can add custom context menu Services that are context sensitive. I do this to add arbitrary search engines for any selected text (from any application).
- Open Automator.
- Choose File > New.
- Select Quick Action, then click Choose button.
- Create the following workflow, replacing the search URL (currently shows DuckDuckGo search):
Save the Action with the name you wish to appear in Context Menu (e.g., "Search DuckDuckGo").
Try it out. Select some text in Safari or elsewhere, right-click, go to Services, and select your custom search.