This page is obsolete. Please see the new version at:
Overview
Page actions are a simple way to represent actions that can be taken on a page ("Email this page", "Share with Facebook", etc).
Status
First version implemented.
User interface
Page actions are displayed in the right side of the Omnibox. New actions get added to the left of the star:
A maximum of 8 (?) actions can appear at the top level, any additional ones overflow into a drop-down menu:
Manifest
Developers can include page actions in the manifest using the following syntax:
"page_actions": [
{
"id": "myaction", // chosen by developer, and should be unique within their extension
"name": "Do action",
"icons": ["favicon.png", "favicon2.png"]
}
]
Supported icon image formats include for example png, bmp, ico, jpg, gif. If an image larger than 16x16 is specified, it will be resized to fit.
API
chrome.pageActions
// Enables a tab page action for a particular tab. The page action will be automatically
// disabled if the user navigates the tab to a new URL or closes the tab. The action will
// also automatically be enabled/disabled as the user switches tabs. Parameters |title|
// and |iconId| are optional. Specifying |title| allows you to change the tooltip that
// appears when you hover over the icon in the Omnibox and iconId is a zero-based index
// into the icons vector specified in the manifest.
void enableForTab(string pageActionId, {int tabId, string url, string title, int iconId})
// Disables a tab page action for a particular tab.
void disableForTab(string pageActionId, {int tabId, string url})
// chrome.pageActions also contains one property for each page action the extension contains.
// The value of this property is an event that is used to notify the user when the page action
// is executed.
// For example: chrome.pageActions["myaction"].addListener(function(details) { ... });
// This event has the following signature:
event ({string pageActionId, int tabId, string tabUrl})