functional-samples/tutorial.open-api-reference/README.md
This example demonstrates how to use the Omnibox API to quickly navigate to Chrome extension API reference pages directly from the address bar.
The extension registers the keyword "api" in Chrome's omnibox. When users type "api" followed by a space, they can search for any Chrome extension API and navigate directly to its documentation page.
The extension uses several Chrome APIs:
chrome.omnibox - Registers the "api" keyword and handles input/selection eventschrome.storage.local - Stores recent search history to provide personalized suggestionschrome.alarms - Used for periodic tip fetching from an external serviceWhen the user types in the omnibox:
onInputChanged provides API suggestions based on user input and search historyonInputEntered opens the selected API's reference page in a new tabThe service worker is organized into modules:
sw-omnibox.js - Handles omnibox events and navigationsw-suggestions.js - Generates API suggestionssw-tips.js - Fetches extension development tips