Lazer
Lazer

Reputation: 95000

Saving history of usage to offer suggestions

The problem is that if I click the extension again and want to do a query that I already did previously, I need to type it out again.

How can I do this? The suggestion matching can be a very simple string matching, nothing fancy. But how/where canI save the history?

Upvotes: 1

Views: 53

Answers (1)

serg
serg

Reputation: 111365

If you are asking about standard browser's autocomplete then I don't think there is a way to programmatically create it.

You can build your own with jQuery's autocomplete plugin, for example. You will just feed it previous queries and it will do the rest.

To store previous queries you can use localStorage, which you would need to access from a background page.

Upvotes: 3

Related Questions