chrome.experimental.contextMenus
API reference: chrome.experimental.contextMenus
Properties
getLastError
chrome.extensionlastError
Methods
create
void
chrome.experimental.contextMenus.create(, object
createProperties, function
callback)
Undocumented.
An API to add items to context menus.
Parameters
-
createProperties
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
type
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The type of menu item - one of 'normal', 'checkbox', 'radio', or 'separator'. Defaults to 'normal' if not specified.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
title
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- This must be specified unless type is 'separator'.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
checked
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
- For items of type checkbox or radio, should this be selected (radio) or checked (checkbox)? Only one radio item can be selected at a time in a given group of radio items, with the last one to have checked == true winning.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
contexts
(
optional
enumerated
Type
array of
Type
array of
string
paramType
)
-
Undocumented.
- List of contexts this menu item will appear in. Legal values are: 'all', 'page', 'selection', 'link', 'editable', 'image', 'video', and 'audio'. Defaults to ['page'].
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
onclick
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
- Function to be called back when your menu item is clicked.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
parentId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The id of a parent menu item - this makes the item a child of a previously added item.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function(integer menuItemId) {...});
-
menuItemId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The id of the newly created context menu item.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
remove
void
chrome.experimental.contextMenus.remove(, integer
menuItemId, function
callback)
Undocumented.
Remove a context menu item.
Parameters
-
menuItemId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The id of the context menu item to remove.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
- Called when the context menu has been removed.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function() {...});
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
removeAll
void
chrome.experimental.contextMenus.removeAll(, function
callback)
Undocumented.
Remove all context menu items added by this extension.
Parameters
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
- Called when removal is complete.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function() {...});
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
update
void
chrome.experimental.contextMenus.update(, integer
id, object
updateProperties, function
callback)
Undocumented.
Update a previously created context menu item.
Parameters
-
id
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- The id of the item to update.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
updateProperties
(
optional
enumerated
Type
array of
object
)
-
Undocumented.
- The properties to update. Accepts the same values as the create function.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
type
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
title
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
checked
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
contexts
(
optional
enumerated
Type
array of
Type
array of
string
paramType
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
onclick
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
parentId
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- Note: you cannot change an item to be a child of one of it's own descendants.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
- Called when the context menu has been updated.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function() {...});
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
Events
event name
chrome.bookmarksonEvent.addListener(function(Type param1, Type param2) {...});
Undocumented.
A description from the json schema def of the event goes here.
Parameters