Index: chrome/common/extensions/docs/examples/api/omnibox/background.html |
diff --git a/chrome/common/extensions/docs/examples/api/omnibox/background.html b/chrome/common/extensions/docs/examples/api/omnibox/background.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ff83ff2ff8a32404146fbc73a7dce0efc07bee27 |
--- /dev/null |
+++ b/chrome/common/extensions/docs/examples/api/omnibox/background.html |
@@ -0,0 +1,19 @@ |
+<script> |
+// This event is fired each time the user updates the text in the omnibox, |
+// as long as the extension's keyword mode is still active. |
+chrome.experimental.omnibox.onInputChanged.addListener( |
+ function(text, suggest) { |
+ console.log('inputChanged: ' + text); |
+ suggest([ |
+ {content: text + " one", description: "the first one"}, |
+ {content: text + " number two", description: "the second entry"} |
+ ]); |
+ }); |
+ |
+// This event is fired with the user accepts the input in the omnibox. |
+chrome.experimental.omnibox.onInputEntered.addListener( |
+ function(text) { |
+ console.log('inputEntered: ' + text); |
+ alert('You just typed "' + text + '"'); |
+ }); |
+</script> |