Regarding Mozillas Auto-Suggest Extension Tutorial I'd like to design my own auto-suggest extension. The tutorial uses json defined in the autocompletesearchparam
param as suggestion-source.
How would I define another source, like a library method from a chrome-content js-file that returns an object?
Just grab that object and serialize it, using something like JSON.stringify()
(assuming its in the format that the extension wants, if not, you'll need to manipulate your object). Now attach your result string to the the "autocompletesearchparam" attribute or "searchParam" property of your element. Should be as simple as that.
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON/stringify
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With