Home | History | Annotate | Download | only in simple-example
      1 <script>
      2 // This event is fired each time the user updates the text in the omnibox,
      3 // as long as the extension's keyword mode is still active.
      4 chrome.omnibox.onInputChanged.addListener(
      5   function(text, suggest) {
      6     console.log('inputChanged: ' + text);
      7     suggest([
      8       {content: text + " one", description: "the first one"},
      9       {content: text + " number two", description: "the second entry"}
     10     ]);
     11   });
     12 
     13 // This event is fired with the user accepts the input in the omnibox.
     14 chrome.omnibox.onInputEntered.addListener(
     15   function(text) {
     16     console.log('inputEntered: ' + text);
     17     alert('You just typed "' + text + '"');
     18   });
     19 </script>
     20