Extensions can interact with web pages or servers using content scripts or cross-origin XMLHttpRequests. Extensions can also interact programmatically with browser features such as bookmarks and tabs.
Many extensions—but not Chrome Apps—add UI to Google Chrome in the form of browser actions or page actions. Each extension can have at most one browser action or page action.
- Choose a browser action when the extension is relevant to most pages.
- Choose a page action when the extension's icon should appear or disappear, depending on the page.
Each extension has the following files:
- A manifest file
- One or more HTML files (unless the extension is a theme)
- Optional: Any other files your extension needs—for example, image files
While you're working on your extension, you put all these files into a single folder. When you distribute your extension, the contents of the folder are packaged into a special ZIP file that has a .crx suffix. If you upload your extension using the Chrome Developer Dashboard, the.crx file is created for you. For details on distributing extensions, see Hosting.
Many extensions have a background page, an invisible page that holds the main logic of the extension. An extension can also contain other pages that present the extension's UI. If an extension needs to interact with web pages that the user loads (as opposed to pages that are included in the extension), then the extension must use a content script.