I don't understand the behavior your are talking about. I tried in Google Chrome and could not figure it out.
In Chrome's address bar, you type the name of a site (say reddit.com), then tab, then some keywords, and that does a google search for your keywords inside reddit.com?
On chrome://settings/searchEngines you can see all the search engines and their search queries listed. In the keyword column, you can also see the associated keyword. This means if you wanted to search in npmjs.com, then type npmjs.com and then a space in the omnibar.
Ofcourse, if you wanted to make it shorter, you can edit the keyword in the same page to say `npm`, then you can search by using npm followed by a space or tab
I've used that in Firebird/Firefox for over ten years. If I remember correctly it's configured by adding a keyword to a bookmark and adding a placeholder within the bookmark URI.
google had this capability for a long time, if you want to search for a result in a specific site, you need to type in the search site:www.reddit.com. i.e: " some error site:www.stackoverflow.com"