-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: add browser.search.getSuggestions method #330
Comments
Cool idea. But I don't think Google will do that. How do you explain to them the purpose of this API? For what cases? And since you know the URL of the unofficial API, you can use it without the API. |
I'm working on an extension that, as one of its features, adds a custom new tab UI with search across history, bookmarks, and, well, the web. Similarly to the existing address bar, it includes search engine suggestions. Having Google hard-coded isn't great for users that have a different search engine selected in their browser. When using the "unofficial API", it isn't possibly to provide all the same query parameters as Chrome does in the address bar. Notably While this is a bit out of my depth, I see this API slightly beneficial for Google. Google is by far the most popular default search engine. It likely that the search suggestions would be used in conjunction with |
To clarify a possible confusion: |
Just following up from the meeting. I think ultimately the thing I wanted to confirm was if you were happy with From the meeting it sounded like this was ok, but in the previous comment you said:
If there is any desire for personalisation it feels like this then becomes a higher-risk API that may need more permissions. |
@oliverdunk that's a good question. The generic results are good enough for most cases, in my experience. |
@NV, our experiments show that the Google Suggestions API returns personalized results without the parameters you specify. Enough user cookies. @oliverdunk, сould you elaborate more on how to get search suggestions using browser.search.search? I studied the Chrome documentation (https://developer.chrome.com/docs/extensions/reference/search/) and experimented, but I did not understand how this API is related to hints. |
@yankovichv it wouldn't send cookies either (assuming that we converge on fully anonymous, generic results). |
I mocked my initially proposed API I proposed and quickly found it quite inflexible. For instance, I wanted to |
There's a
browser.search
API that allows opening a page with search results using the browser default search engine. However, there's currently no API to get search suggestions.Original Proposal
I propose to add
browser.search.getSuggestions
method:getSuggestions should return the request body as text (example).
Revised proposal
The original proposal doesn't allow to control caching or stopping unfinished requests. If we simply expose the URL of the selected search engine, we can use it with
fetch
instead.(This could be asynchronous if that makes more sense for the implementors.)
Related info:
The suggestion response format: OpenSearch/Extensions/Suggestions/1.1
Real-world example: https://www.google.com/complete/search?client=chrome-omni&q=test
The text was updated successfully, but these errors were encountered: